| 1 |
From: Danilo Šegan <[email protected]> |
| 2 |
Date: 2005-09-05 |
| 3 |
Archive: http://mail.gnome.org/archives/gnome-doc-devel-list/2005-September/msg00000.html |
| 4 |
================================================================================ |
| 5 |
|
| 6 |
I've finally started on Serbian localisation of g-d-u stylesheets. |
| 7 |
(Yeah, I know you've asked for translators to really get on with this |
| 8 |
way earlier, we are now in hard-code freeze and everything, but lets |
| 9 |
improve l10n.xml even more now :) |
| 10 |
|
| 11 |
And here are the things I may need. |
| 12 |
|
| 13 |
First off, any list numbering can take also use Serbian alphabet |
| 14 |
ordering: |
| 15 |
|
| 16 |
А Б В Г Д Ђ Е Ж З И Ј К Л Љ М Н Њ О П Р С Т Ћ У Ф Х Ц Ч Џ Ш |
| 17 |
а б в г д ђ е ж з и ј к л љ м н њ о п р с т ћ у ф х ц ч џ ш |
| 18 |
|
| 19 |
This is unusable for anything other than Serbian, since all other |
| 20 |
Cyrillic languages miss at least some of these letters, and commonly |
| 21 |
have some others. This is probably not easy to add because I even if |
| 22 |
XSL has support for it, libxslt currently doesn't implement it, so you |
| 23 |
can't simply do |
| 24 |
|
| 25 |
<xsl:template name="db.digit.format.sr" > |
| 26 |
<xsl:param name="digit"/> |
| 27 |
<xsl:number format="а" lang="sr"/><!-- this is lowercase Cyrillic a --> |
| 28 |
</xsl:template> |
| 29 |
|
| 30 |
... |
| 31 |
<xsl:when test="$format = 'sr-lower'"> |
| 32 |
<xsl:call-template name="db.digit.format.sr"> |
| 33 |
<xsl:with-param name="digit" select="$digit"/> |
| 34 |
</xsl:call-template> |
| 35 |
</xsl:when> |
| 36 |
|
| 37 |
but you'd have to implement something like the following (Euclidean? |
| 38 |
:) algorithm: |
| 39 |
|
| 40 |
<xsl:template name="db.digit.format.sr.lower" > |
| 41 |
<xsl:param name="digit"/> |
| 42 |
<xsl:choose> |
| 43 |
<xsl:when test="$digit>30"> |
| 44 |
<xsl:call-template name="db.digit.format.srk"> |
| 45 |
<xsl:with-param name="digit" select="floor($digit div 30)"/> |
| 46 |
</xsl:call-template> |
| 47 |
<xsl:call-template name="db.digit.format.srk"> |
| 48 |
<xsl:with-param name="digit" select="$digit mod 30"/> |
| 49 |
</xsl:call-template> |
| 50 |
</xsl:when> |
| 51 |
<xsl:when test="$digit<31"> |
| 52 |
<xsl:value-of select="substring('абвгдђежзијклљмнњопрстћуфхцчџш',$digit,1)"/> |
| 53 |
</xsl:when> |
| 54 |
</xsl:choose> |
| 55 |
</xsl:template> |
| 56 |
|
| 57 |
(this one is for lowercase, and seems to work in my standalone tests :). |
| 58 |
|
| 59 |
Is it ok to add something like this and introduce a new "format" |
| 60 |
"sr-lower" and "sr-upper" that will call-template these ones as |
| 61 |
appropriate? We should probably even generalise this to any alphabet |
| 62 |
anyway (i.e. instead of hard-coded substring alphabet, pass that up |
| 63 |
too :). |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
Next, I wonder if we could use different roles for things like |
| 69 |
declensions of labels (<xref> stuff), eg: |
| 70 |
- "on figure 5" is "na *slici* 5" (locative) |
| 71 |
- "from figure 5" is "sa *slike* 5" (genitive) |
| 72 |
- "we blame figure 5" is "krivimo *sliku* 5" (accusative) |
| 73 |
- "figure 5" is "*slika* 5" (nominative) |
| 74 |
... (we have three more, like "with figure 5" [instrumental], "hey, |
| 75 |
figure 5, talk to me" [vocative] and "figure 5 misses something" |
| 76 |
[dative], but I don't want to bore you with examples; oh, I already |
| 77 |
did :) |
| 78 |
|
| 79 |
|
| 80 |
Now, imagine a following paragraph: |
| 81 |
|
| 82 |
<para>On <xref linkend="figure-sample"/>, if you take a good look, |
| 83 |
you'll see something. If we remove <xref linkend="figure-sample"/>, |
| 84 |
you'll end up seeing nothing.</para> |
| 85 |
|
| 86 |
would have to be translated to something like the following in |
| 87 |
Serbian: |
| 88 |
|
| 89 |
<para>On <xref linkend="figure-sample" xrefstyle="locative"/>, if you |
| 90 |
take a good look, you'll see something. If we remove <xref |
| 91 |
linkend="figure-sample" xrefstyle="accusative"/>, you'll end up seeing |
| 92 |
nothing.</para> |
| 93 |
|
| 94 |
and it should be rendered like: |
| 95 |
|
| 96 |
<p>On <a href="#figure-sample">slici 5</a>, if you take a good look, |
| 97 |
you'll see something. If we remove <a href="#figure-sample">sliku |
| 98 |
5</a>, you'll end up seeing nothing.</p> |
| 99 |
|
| 100 |
Note the "slici" and "sliku" renderings. Do l10n stylesheets support |
| 101 |
that already (I didn't look :), or do we need to work on that as well? |
| 102 |
|