| 97 | |
| 98 | |
| 99 | |
| 100 | === Editing Guidelines === |
| 101 | |
| 102 | There are tons of good guidelines on the web about how to write good translations. |
| 103 | See 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 | |
| 105 | In 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 |
| 109 | msgid "Delete milestone" |
| 110 | msgstr "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 | |
| 124 | There are a few more complex situations. |
| 125 | |
| 126 | Here's a message containing parameters: |
| 127 | {{{ |
| 128 | #: trac/ticket/templates/milestone_view.html:26 |
| 129 | #, python-format |
| 130 | msgid "" |
| 131 | "Completed %(duration)s ago\n" |
| 132 | " (%(date)s)" |
| 133 | msgstr "" |
| 134 | "Atteint il y a %(duration)s\n" |
| 135 | " (%(date)s)" |
| 136 | }}} |
| 137 | |
| 138 | Note that you need to have to keep the parameters names from `msgid` |
| 139 | in `msgstr`, although you can reorder them as needed. |
| 140 | |
| 141 | Another example, here's how a structured message looks like: |
| 142 | {{{ |
| 143 | #: trac/ticket/templates/milestone_delete.html:45 |
| 144 | msgid "" |
| 145 | "[1:Note:] See\n" |
| 146 | " [2:TracRoadmap] for help on using\n" |
| 147 | " the roadmap." |
| 148 | msgstr "" |
| 149 | "[1:Note :] consultez [2:TracRoadmap] pour obtenir de l'aide sur " |
| 150 | "l'utilisation de la feuille de route." |
| 151 | }}} |
| 152 | |
| 153 | The `[1: ...]` groups are used when the message contains markup |
| 154 | (this is Genshi specific). |
| 155 | It is important to keep the same semantic structure. |
| 156 | As with message parameters, the groups can be reordered but you should |
| 157 | have the same groups in msgid and msgstr. |
| 158 | |
| 159 | Of course, you can have messages that combine markup groups and |
| 160 | parameters names: |
| 161 | {{{ |
| 162 | #: trac/ticket/templates/milestone_view.html:32 |
| 163 | #, python-format |
| 164 | msgid "" |
| 165 | "[1:%(duration)s late]\n" |
| 166 | " (%(date)s)" |
| 167 | msgstr "" |
| 168 | "[1:%(duration)s en retard]\n" |
| 169 | " (%(date)s)" |
| 170 | }}} |
| 171 | |
| 172 | |
| 173 | Finally, there's the translation of sentences which have a singular and |
| 174 | a 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 |
| 180 | msgid "%(num)s match" |
| 181 | msgid_plural "%(num)s matches" |
| 182 | msgstr[0] "%(num)s résultat" |
| 183 | msgstr[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 |
| 198 | File that bug report ;-) |
| 199 | |
| 200 | progress bar macros |
| 201 | |
| 202 | #: trac/templates/macros.html:214 |
| 203 | #, python-format |
| 204 | msgid "%(num)s of %(total)s %(unit)s %(title)s" |
| 205 | msgid_plural "%(num)s of %(total)s %(units)s %(title)s" |
| 206 | msgstr[0] "%(num)s %(unit)s « %(title)s » sur %(total)s" |
| 207 | msgstr[1] "%(num)s %(units)s « %(title)s » sur %(total)s" |
| 208 | |
| 209 | #: trac/templates/macros.html:227 |
| 210 | #, python-format |
| 211 | msgid "%(title)s %(unit)s:" |
| 212 | msgid_plural "%(title)s %(units)s:" |
| 213 | msgstr[0] "%(unit)s « %(title)s » :" |
| 214 | msgstr[1] "%(units)s « %(title)s » :" |
| 215 | |
| 216 | #: trac/templates/macros.html:237 |
| 217 | #, python-format |
| 218 | msgid "Total %(unit)s:" |
| 219 | msgid_plural "Total %(units)s:" |
| 220 | msgstr[0] "%(unit)s au total :" |
| 221 | msgstr[1] "%(units)s au total :" |
| 222 | |
| 223 | |
| 224 | -- cboos |
| 225 | }}} |
| 226 | |
| 227 | |