diff options
author | Don Scorgie <dscorgie@src.gnome.org> | 2006-07-24 18:55:17 +0000 |
---|---|---|
committer | Don Scorgie <dscorgie@src.gnome.org> | 2006-07-24 18:55:17 +0000 |
commit | e912042367f726b87fe1c2015138ca0b53011f5a (patch) | |
tree | d3898c57c017cbb2e5130c2ded20af0e9fd4dad4 | |
parent | 3957fa707e49427cc696b31b5bf8c6adfaada372 (diff) | |
download | yelp-e912042367f726b87fe1c2015138ca0b53011f5a.tar.gz |
Make translation of "Repeat search online" string easier.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/yelp-search-pager.c | 15 | ||||
-rw-r--r-- | stylesheets/search2html.xsl | 7 |
3 files changed, 19 insertions, 6 deletions
@@ -4,6 +4,9 @@ * stylesheets/search2html.xsl: Add a new link to the search results to allow repeating the search online at the GNOME support forums + Additionally: Allow better translation of the message + Allow translation of the site name + 2006-07-23 Brent Smith <gnome@nextreality.net> diff --git a/src/yelp-search-pager.c b/src/yelp-search-pager.c index 4637b801..c948087c 100644 --- a/src/yelp-search-pager.c +++ b/src/yelp-search-pager.c @@ -69,7 +69,7 @@ typedef struct _SearchContainer SearchContainer; #define ONLINE_CHECK_BEFORE "http://gnomesupport.org/forums/search.php?search_keywords=" #define ONLINE_CHECK_AFTER "&search_cat=1" -#define ONLINE_NAME "GNOME Support Forums" +#define ONLINE_NAME N_("the GNOME Support Forums") struct _YelpSearchPagerPriv { xmlDocPtr search_doc; @@ -696,6 +696,7 @@ process_xslt (YelpSearchPager *pager) int number_of_results; gchar *title = NULL, *text = NULL; gchar *tmp = NULL, *check = NULL; + gchar **split = NULL; xmlNodePtr online = NULL; d (xmlDocFormatDump(stdout, priv->search_doc, 1)); @@ -772,16 +773,22 @@ process_xslt (YelpSearchPager *pager) check = g_strconcat (ONLINE_CHECK_BEFORE, priv->search_terms, ONLINE_CHECK_AFTER, NULL); - tmp = g_strdup (_("Repeat the search online at ")); + /* TRANSLATORS: Please don't do anything funny with the + * format arguement. It isn't really going through a printf + * The %s is used to indicate where the name of the site (linked) + * should be. This is done in the XSLT + */ + tmp = g_strdup (_("Repeat the search online at %s")); + split = g_strsplit (tmp, "%s", 2); - online = xmlNewTextChild (priv->root, NULL, BAD_CAST "online", BAD_CAST tmp); + online = xmlNewTextChild (priv->root, NULL, BAD_CAST "online", BAD_CAST split[0]); g_free (tmp); xmlNewProp (online, BAD_CAST "name", BAD_CAST ONLINE_NAME); xmlNewProp (online, BAD_CAST "href", BAD_CAST check); g_free (check); - + xmlNewTextChild (priv->root, NULL, BAD_CAST "online1", BAD_CAST split[1]); outdoc = xsltApplyStylesheetUser (priv->stylesheet, priv->search_doc, diff --git a/stylesheets/search2html.xsl b/stylesheets/search2html.xsl index 340d16df..0fe9e086 100644 --- a/stylesheets/search2html.xsl +++ b/stylesheets/search2html.xsl @@ -122,7 +122,7 @@ <xsl:apply-templates select="."/> </xsl:for-each> <br/> - <xsl:apply-templates select="online"/> + <xsl:apply-templates select="online"/><xsl:apply-templates select="online1"/> </dl> </div> </body> @@ -180,10 +180,13 @@ <xsl:template match="online"> <hr/> <br/> - <xsl:value-of select="."/> + <xsl:apply-templates/> <a href="{@href}"> <xsl:value-of select="@name"/> </a> </xsl:template> +<xsl:template match="online1"> + <xsl:apply-templates/> +</xsl:template> </xsl:stylesheet> |