[gnome-summary] Translating XSLs



All,

Apart from translating the "meat" (content) of the summaries, there's
some constant data that is reused every time.

This data is kept inside XML Stylesheets (I think XSL stands for XML
Stylesheet Language, but I may be wrong, and it's not very important
either :) in Gnome CVS:
  web-devel-2/scripts/gnome-summary-xml/*.xsl

I suggest everyone to make a per-language directory (i.e. I would
create a directory web-devel-2/scripts/gnome-summary-xml/sr), and
copy the entire structure there.

That would allow people to modify stylesheets completely, so it has
its bad sides (like, once original stylesheets are updated, it's hard
to update all per-language stylesheets), but it is currently the only
way for it to work correctly for some languages (like Serbian).

The reason is that iso-8859-1 charset is hardcoded in a couple of
places (read: BAD!), and I need UTF-8, or I'll get entities inside
text files (read: BAD, again! :).  Also, I need to write a simple
snippet of XSL to determine different word forms depending on the
number (also known as "plural forms"), inside summary-text.xsl:

	<xsl:choose>
	  <xsl:when test="@closed mod 10 = 1 and @closed mod 100 != 11">
	    <xsl:text>bug.</xsl:text>
	  </xsl:when>
	  <xsl:when test="(@closed mod 10 > 1) and (@closed mod 10 &lt; 5) and (@closed mod 100 > 19 or @closed mod 100 &lt; 10)">
	    <xsl:text>buggas.</xsl:text>
	  </xsl:when>
	  <xsl:otherwise>
	    <xsl:text>bugs.</xsl:text>
	  </xsl:otherwise>
	</xsl:choose>

(bug, buggas and bugs are here just to illustrate the difference, for
real stuff, check http://kvota.net/sri/xsl/ for a complete set of 
Serbian XSLs)


Basically, if you don't have such requirements, you can go ahead and
translate all visible strings inside XSL files, and it will work for
you.  Look into "create-sr-summary.sh" for example on how to adjust
the create-summary.sh script to work for your language.


Also, a question is due now: Sri, am I allowed to commit these
stylesheets for Serbian in a "sr" subdirectory of gnome-summary-xml?

I hope this helps anyone.

Cheers,
Danilo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]