Edgewall Software

Changes between Version 82 and Version 83 of TracL10N


Ignore:
Timestamp:
Jan 7, 2010, 3:47:50 PM (14 years ago)
Author:
Christian Boos
Comment:

#EditingGuidelines section added - some intro about the .po files (better late than never)

Legend:

Unmodified
Added
Removed
Modified
  • TracL10N

    v82 v83  
    9595on [http://transifex.org/wiki/About Transifex].
    9696
     97
     98
     99
     100=== Editing Guidelines ===
     101
     102There are tons of good guidelines on the web about how to write good translations.
     103See for example: [http://techbase.kde.org/Localization/Concepts/PO_Odyssey PO_Odyssey] and [http://l10n.kde.org/docs/translation-howto/gui-step-by-step.html step-by-step], and other resources from http://l10n.kde.org.
     104
     105In short, a translation unit is typically something like:
     106{{{
     107#: trac/ticket/templates/milestone_delete.html:41
     108#: trac/ticket/templates/milestone_view.html:105
     109msgid "Delete milestone"
     110msgstr "Supprimer le jalon"
     111}}}
     112
     113- the "#:" lines are comments indicating the locations of the message in
     114  the source.
     115- `msgid "..."` is the message itself, this should never be changed
     116- `msgstr` is your translation; you should keep there the same structure,
     117  as in the msgid. In particular the presence of "\n" at the beginning or
     118  the end of the msgid should be mirrored in msgstr
     119- right after an automatic catalog update you'll see lots of:
     120  - `# fuzzy` comments: this identifies translations that are only
     121  approximated (the msgid has changed)
     122  - `msgstr ""` translations: those are newly added translations
     123
     124There are a few more complex situations.
     125
     126Here's a message containing parameters:
     127{{{
     128#: trac/ticket/templates/milestone_view.html:26
     129#, python-format
     130msgid ""
     131"Completed %(duration)s ago\n"
     132"              (%(date)s)"
     133msgstr ""
     134"Atteint il y a %(duration)s\n"
     135"                (%(date)s)"
     136}}}
     137
     138Note that you need to have to keep the parameters names from `msgid`
     139in `msgstr`, although you can reorder them as needed.
     140
     141Another example, here's how a structured message looks like:
     142{{{
     143#: trac/ticket/templates/milestone_delete.html:45
     144msgid ""
     145"[1:Note:] See\n"
     146"      [2:TracRoadmap] for help on using\n"
     147"      the roadmap."
     148msgstr ""
     149"[1:Note :] consultez [2:TracRoadmap] pour obtenir de l'aide sur "
     150"l'utilisation de la feuille de route."
     151}}}
     152
     153The `[1: ...]` groups are used when the message contains markup
     154(this is Genshi specific).
     155It is important to keep the same semantic structure.
     156As with message parameters, the groups can be reordered but you should
     157have the same groups in msgid and msgstr.
     158
     159Of course, you can have messages that combine markup groups and
     160parameters names:
     161{{{
     162#: trac/ticket/templates/milestone_view.html:32
     163#, python-format
     164msgid ""
     165"[1:%(duration)s late]\n"
     166"              (%(date)s)"
     167msgstr ""
     168"[1:%(duration)s en retard]\n"
     169"                (%(date)s)"
     170}}}
     171
     172
     173Finally, there's the translation of sentences which have a singular and
     174a plural form:
     175{{{
     176#: trac/ticket/templates/query.html:29
     177#: trac/ticket/templates/query_results.html:30
     178#: trac/ticket/templates/report_view.html:94
     179#, python-format
     180msgid "%(num)s match"
     181msgid_plural "%(num)s matches"
     182msgstr[0] "%(num)s résultat"
     183msgstr[1] "%(num)s résultats"
     184}}}
     185
     186- when such a message is newly added, you'll have [[br]]
     187  `#, fuzzy, python-format` as the first comment.
     188  Be careful to remove only the `fuzzy, ` part, but not the `python-format`
     189  keyword.
     190- some languages (zh, ko) don't have plural forms (plural == 1),
     191  so you only have to put a `msgstr[0]` line.
     192- some other languages have more than 2 plural forms, so you need as
     193  many `msgstr[]` as needed.
     194
     195''Note: '' there are some problems with Genshi and Babel when all the `msgstr[]` need to have the same content. Also, Babel seems to handle well different parameters for msgid and msgid_plural, whereas `msgfmt` complains about those.
     196{{{
     197#!comment
     198File that bug report ;-)
     199
     200progress bar macros
     201
     202#: trac/templates/macros.html:214
     203#, python-format
     204msgid "%(num)s of %(total)s %(unit)s %(title)s"
     205msgid_plural "%(num)s of %(total)s %(units)s %(title)s"
     206msgstr[0] "%(num)s %(unit)s « %(title)s » sur %(total)s"
     207msgstr[1] "%(num)s %(units)s « %(title)s » sur %(total)s"
     208
     209#: trac/templates/macros.html:227
     210#, python-format
     211msgid "%(title)s %(unit)s:"
     212msgid_plural "%(title)s %(units)s:"
     213msgstr[0] "%(unit)s « %(title)s » :"
     214msgstr[1] "%(units)s « %(title)s » :"
     215
     216#: trac/templates/macros.html:237
     217#, python-format
     218msgid "Total %(unit)s:"
     219msgid_plural "Total %(units)s:"
     220msgstr[0] "%(unit)s au total :"
     221msgstr[1] "%(units)s au total :"
     222
     223
     224-- cboos
     225}}}
     226
     227
    97228=== Terms (Definitions) === #term-definitions
    98229