| 1 |
User Interface Translation Notes |
| 2 |
================================ |
| 3 |
|
| 4 |
.. warning:: |
| 5 |
|
| 6 |
This page is severely out of date! Much of what is described may no |
| 7 |
longer apply. If you wish to translate FontForge's interface, please |
| 8 |
use Crowdin: https://crowdin.com/project/fontforge |
| 9 |
|
| 10 |
.. epigraph:: |
| 11 |
|
| 12 |
| **CASCA:** Ay, he spoke Greek. |
| 13 |
| **CASSIUS:** To what effect? |
| 14 |
| **CASCA:** Nay, an I tell you that, I'll ne'er |
| 15 |
| look you i' the face again: but those that |
| 16 |
| understood him smiled at one another and |
| 17 |
| shook their heads; but, for mine own |
| 18 |
| part, it was Greek to me. |
| 19 |
|
| 20 |
-- *Julius Caesar*, I, ii |
| 21 |
-- Shakespeare |
| 22 |
|
| 23 |
FontForge uses a standard mechanism called gettext to provide translations of |
| 24 |
user interface strings into different language. Gettext is described profusely |
| 25 |
at the `gettext site <http://www.gnu.org/software/gettext/manual/>`_, the |
| 26 |
following are some brief notes on what you need to know to translate FontForge's |
| 27 |
UI. |
| 28 |
|
| 29 |
.. contents:: |
| 30 |
:depth: 2 |
| 31 |
:backlinks: none |
| 32 |
:class: clear-both |
| 33 |
|
| 34 |
|
| 35 |
.. _uitranslationnotes.Obtaining: |
| 36 |
|
| 37 |
Obtaining the strings |
| 38 |
--------------------- |
| 39 |
|
| 40 |
.. epigraph:: |
| 41 |
|
| 42 |
| **CHAPLAIN:**...legal matters and so forth |
| 43 |
| Are Greek to me; except of course |
| 44 |
| That I understand Greek. |
| 45 |
|
| 46 |
-- *The Lady's not for Burning*, II |
| 47 |
-- Christopher Fry |
| 48 |
|
| 49 |
In a gettext based package, the translatable strings live in a "pot" file. In |
| 50 |
FontForge's case it is called "FontForge.pot". |
| 51 |
|
| 52 |
You can download the |
| 53 |
`current version of this file from here. <https://crowdin.com/project/fontforge>`_ |
| 54 |
|
| 55 |
.. _uitranslationnotes.Modifying: |
| 56 |
|
| 57 |
Creating and Modifying a "po" file |
| 58 |
---------------------------------- |
| 59 |
|
| 60 |
.. epigraph:: |
| 61 |
|
| 62 |
| The Bellman looked uffish, and wrinkled his brow, |
| 63 |
| 'If only you'd spoken before! |
| 64 |
| It's excessively awkward to mention it now, |
| 65 |
| With the Snark, so to speak, at the door!' |
| 66 |
| |
| 67 |
| 'We should all of us grieve, as you may well believe |
| 68 |
| If you never were met with again- |
| 69 |
| But surely, my man, when the voyage began |
| 70 |
| You might have suggested it then?' |
| 71 |
| |
| 72 |
| 'It's excessively awkward to mention it now |
| 73 |
| As I think I've already remarked.' |
| 74 |
| And the man they called "Hi!" replied with a sigh, |
| 75 |
| 'I informed you the day we embarked.' |
| 76 |
| |
| 77 |
| 'You may charge me with murder- or want of sense- |
| 78 |
| (We are all of us weak at times): |
| 79 |
| But the slightest approach to a false pretense |
| 80 |
| Was never among my crimes!' |
| 81 |
| |
| 82 |
| 'I said it in Hebrew- I said it in Dutch- |
| 83 |
| I said it in German and Greek: |
| 84 |
| But I wholly forgot (and it vexes me much) |
| 85 |
| That English is what you speak!' |
| 86 |
|
| 87 |
-- The Hunting of the Snark, Lewis Carroll |
| 88 |
|
| 89 |
You should now have a FontForge.pot file (if you don't see the |
| 90 |
:ref:`above section <uitranslationnotes.Obtaining>` on how to get one). |
| 91 |
|
| 92 |
The pot file is in the same format as the "po" file which you need to generate. |
| 93 |
Simply rename FontForge.pot to the language/locale that you are working on. In |
| 94 |
most cases you will probably want to rename it just to the language |
| 95 |
|
| 96 |
:: |
| 97 |
|
| 98 |
$ mv FontForge.pot fr.po |
| 99 |
|
| 100 |
But sometimes that will not be enough. For example, Traditional and simplified |
| 101 |
chinese are sufficiently different that a locale must also be specified: |
| 102 |
|
| 103 |
:: |
| 104 |
|
| 105 |
$ mv FontForge.pot zh_TW.po |
| 106 |
|
| 107 |
Once you have created your po file it is time to start modifying it. I shall use |
| 108 |
French as an example in the following (because I almost speak French), obviously |
| 109 |
you will need to make changes appropriate for your language. |
| 110 |
|
| 111 |
The po file begins with some lines like: |
| 112 |
|
| 113 |
:: |
| 114 |
|
| 115 |
# (American) English User Interface strings for FontForge. |
| 116 |
# Copyright (C) 2000-2006 by George Williams |
| 117 |
# This file is distributed under the same license as the FontForge package. |
| 118 |
# George Williams, <[email protected]>, 2006. |
| 119 |
# |
| 120 |
#, fuzzy |
| 121 |
msgid "" |
| 122 |
msgstr "" |
| 123 |
"Project-Id-Version: PACKAGE VERSION\n" |
| 124 |
"POT-Creation-Date: 2006-08-19 07:32-0700\n" |
| 125 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 126 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 127 |
"Language-Team: LANGUAGE <[email protected]>\n" |
| 128 |
"MIME-Version: 1.0\n" |
| 129 |
"Content-Type: text/plain; charset=CHARSET\n" |
| 130 |
"Content-Transfer-Encoding: 8bit\n" |
| 131 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
| 132 |
|
| 133 |
You should change this to: |
| 134 |
|
| 135 |
:: |
| 136 |
|
| 137 |
# (French) French User Interface strings for FontForge. |
| 138 |
# Copyright (C) 2004-2006 by Pierre Hanser & Yannis Haralambous |
| 139 |
# This file is distributed under the same license as the FontForge package. |
| 140 |
# |
| 141 |
#, fuzzy |
| 142 |
msgid "" |
| 143 |
msgstr "" |
| 144 |
"Project-Id-Version: 20060821\n" |
| 145 |
"POT-Creation-Date: 2006-08-19 07:32-0700\n" |
| 146 |
"PO-Revision-Date: 2006-08-20 14:46+0100\n" |
| 147 |
"Last-Translator: Pierre Hanser\n" |
| 148 |
"Language-Team: French <[email protected]>\n" |
| 149 |
"MIME-Version: 1.0\n" |
| 150 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 151 |
"Content-Transfer-Encoding: 8bit\n" |
| 152 |
"Plural-Forms: nplurals=2; plural=n>1;\n" |
| 153 |
|
| 154 |
Most of these are pretty self-explanatory. Fill in your name and email address |
| 155 |
where appropriate, and the date on which you last worked on the file. The |
| 156 |
plurals line is a little more complex, and I'll describe it |
| 157 |
:ref:`later <uitranslationnotes.plurals>`. |
| 158 |
|
| 159 |
Next there are thousands of string entries. They look something like this: |
| 160 |
|
| 161 |
:: |
| 162 |
|
| 163 |
#: ttfinstrs.c:2184 typofeatures.c:1450 ../gdraw/gaskdlg.c:1076 |
| 164 |
#: ../gdraw/gaskdlg.c:1332 ../gdraw/gaskdlg.c:1391 ../gdraw/gfiledlg.c:152 |
| 165 |
#: ../gdraw/gmatrixedit.c:711 ../gdraw/gsavefiledlg.c:280 |
| 166 |
msgid "_Cancel" |
| 167 |
msgstr "" |
| 168 |
|
| 169 |
You should change these to: |
| 170 |
|
| 171 |
:: |
| 172 |
|
| 173 |
#: ttfinstrs.c:2184 typofeatures.c:1450 ../gdraw/gaskdlg.c:1076 |
| 174 |
#: ../gdraw/gaskdlg.c:1332 ../gdraw/gaskdlg.c:1391 ../gdraw/gfiledlg.c:152 |
| 175 |
#: ../gdraw/gmatrixedit.c:711 ../gdraw/gsavefiledlg.c:280 |
| 176 |
msgid "_Cancel" |
| 177 |
msgstr "_Annuler" |
| 178 |
|
| 179 |
So the translation goes into the msgstr line. (The comment lines above indicate |
| 180 |
in what source files and on what lines the "_Cancel" string is used -- this |
| 181 |
information may be helpful if you want more information about context). If you |
| 182 |
don't want to translate a string just leave the msgstr as a null-string, and the |
| 183 |
English text will be used ("OK" seems to be left untranslated in many languages) |
| 184 |
|
| 185 |
:: |
| 186 |
|
| 187 |
#: ttfinstrs.c:2184 typofeatures.c:1450 ../gdraw/gaskdlg.c:1076 |
| 188 |
#: ../gdraw/gaskdlg.c:1332 ../gdraw/gaskdlg.c:1391 ../gdraw/gfiledlg.c:152 |
| 189 |
#: ../gdraw/gmatrixedit.c:711 ../gdraw/gsavefiledlg.c:280 |
| 190 |
msgid "_OK" |
| 191 |
msgstr "" |
| 192 |
|
| 193 |
Some strings contain mnemonics. The mnemonic is preceded by an underscore. |
| 194 |
|
| 195 |
That seems fairly straight forward. But there are always complications. |
| 196 |
Sometimes an English word might be translated by different French words |
| 197 |
depending on context. For example in French the English word "New" might be |
| 198 |
translated as either "Nouveau" or "Nouvelle" depending on the gender of the |
| 199 |
thing being created. In Japanese the word for the latin language is different |
| 200 |
from the latin script. So to disambiguate some strings a little bit of context |
| 201 |
information may appear before the actual string to be translated: |
| 202 |
|
| 203 |
:: |
| 204 |
|
| 205 |
msgid "File|_New" |
| 206 |
msgstr "_Nouveau" |
| 207 |
|
| 208 |
or |
| 209 |
|
| 210 |
:: |
| 211 |
|
| 212 |
msgid "Anchor|_New" |
| 213 |
msgstr "_Nouvelle" |
| 214 |
|
| 215 |
The context will be any text before an "|". It should not be translated. Indeed |
| 216 |
both it and the "|" should be completely omitted. |
| 217 |
|
| 218 |
.. _uitranslationnotes.plurals: |
| 219 |
|
| 220 |
Finally we have the problem of plurals. Suppose we have a string |
| 221 |
|
| 222 |
:: |
| 223 |
|
| 224 |
msgid "%d Group" |
| 225 |
|
| 226 |
We need to inflect the word "Group" depending on the number of groups we've got |
| 227 |
-- and each language has different rules. |
| 228 |
|
| 229 |
Remember, at the beginning of the file there was a line: |
| 230 |
|
| 231 |
:: |
| 232 |
|
| 233 |
"Plural-Forms: nplurals=2; plural=n>1;\n" |
| 234 |
|
| 235 |
This says that this language has two plural forms, the singular form is used |
| 236 |
when there are 0 or 1 entries (n<=1), and the plural form is used for n>1 |
| 237 |
entries. That rule is correct for French. English looks like: |
| 238 |
|
| 239 |
:: |
| 240 |
|
| 241 |
"Plural-Forms: nplurals=2; plural=n!=1;\n" |
| 242 |
|
| 243 |
A language like classical Greek, which has a dual form, might look like |
| 244 |
|
| 245 |
:: |
| 246 |
|
| 247 |
"Plural-Forms: nplurals=3; plural=n<=1?0:n==2?1:2;\n" |
| 248 |
|
| 249 |
The expression is a c language expression. When there is a string that might be |
| 250 |
plural it has a slightly different form in the po file |
| 251 |
|
| 252 |
:: |
| 253 |
|
| 254 |
#: groups.c:1558 |
| 255 |
msgid "%d Group" |
| 256 |
msgid_plural "%d Groups" |
| 257 |
msgstr[0] "%d Groupe" |
| 258 |
msgstr[1] "%d Groupes" |
| 259 |
|
| 260 |
Obviously, in a language with three forms there would be additional |
| 261 |
``msgstr[n]`` entries. |
| 262 |
|
| 263 |
|
| 264 |
.. _uitranslationnotes.Updating: |
| 265 |
|
| 266 |
Updating an already existing "po" file |
| 267 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 268 |
|
| 269 |
After a few months, you will probably find that I've added some additional |
| 270 |
strings to FontForge, and you may want to update your original po file. |
| 271 |
|
| 272 |
Once again you :ref:`grab a current "pot" file <uitranslationnotes.Obtaining>` |
| 273 |
and you type: |
| 274 |
|
| 275 |
:: |
| 276 |
|
| 277 |
$ msgmerge fr.po FontForge.pot >fr-new.po |
| 278 |
|
| 279 |
This will update your po file to contain any new strings for you to translate. |
| 280 |
It will also make guesses for these new strings. Some of these guesses are |
| 281 |
correct, some are very strange, so you will want to examine the guessed strings |
| 282 |
(they will be marked with the word "fuzzy" -- emacs has a mode that makes |
| 283 |
checking these easy). |
| 284 |
|
| 285 |
|
| 286 |
.. _uitranslationnotes.Testing: |
| 287 |
|
| 288 |
Testing a "po" file |
| 289 |
^^^^^^^^^^^^^^^^^^^ |
| 290 |
|
| 291 |
Once you have completed your po file you will want to test it. |
| 292 |
|
| 293 |
#. If you have a copy of the fontforge source distribution you can test it by |
| 294 |
|
| 295 |
* copying your new file into the fontforge/po directory: |
| 296 |
|
| 297 |
:: |
| 298 |
|
| 299 |
$ cp fr.po fontforge-20060819/fontforge/po |
| 300 |
* Reconfiguring fontforge, and installing it |
| 301 |
|
| 302 |
:: |
| 303 |
|
| 304 |
$ cd fontforge-20060819 |
| 305 |
$ ./configure |
| 306 |
$ make |
| 307 |
$ su |
| 308 |
# make install |
| 309 |
#. Or, if you want to do things manually: |
| 310 |
|
| 311 |
* First you need to compile it: |
| 312 |
|
| 313 |
:: |
| 314 |
|
| 315 |
$ msgfmt -o fr.mo fr.po |
| 316 |
|
| 317 |
and create an "mo" file. |
| 318 |
* This file you will want to rename and move to the appropriate directory. If |
| 319 |
fontforge is installed in /usr/local/bin then you would say |
| 320 |
|
| 321 |
:: |
| 322 |
|
| 323 |
$ mv fr.mo /usr/local/share/locale/fr/LC_MESSAGES/FontForge.mo |
| 324 |
|
| 325 |
Then make sure your locale is set properly (and that your operating system has |
| 326 |
the support files it needs for that locale) and start fontforge. You should see |
| 327 |
your translation |
| 328 |
|
| 329 |
:: |
| 330 |
|
| 331 |
$ LANG=fr_FR.UTF-8; export LANG |
| 332 |
$ fontforge -new |
| 333 |
|
| 334 |
.. image:: /images/fontview.fr.png |
| 335 |
|
| 336 |
-------------------------------------------------------------------------------- |
| 337 |
|
| 338 |
|
| 339 |
.. _uitranslationnotes.More: |
| 340 |
|
| 341 |
Still more strings to translate! |
| 342 |
-------------------------------- |
| 343 |
|
| 344 |
FontForge has some strings that do not fit into the standard gettext mechanism. |
| 345 |
These are strings for which fontforge wants to know all translations at all |
| 346 |
times. For exampe the truetype 'name' table encourages designers to provide a |
| 347 |
translation for the stylistic variant of the font into as many languages as |
| 348 |
possible. So if you had a Bold font it would be nice if the 'name' table |
| 349 |
contained: An English entry, "Bold"; A French entry, "Gras"; A German entry, |
| 350 |
"Fett". To make this easier on the designer FontForge would like to have all |
| 351 |
translations of "Bold" built into it at all times, all translations of "Italic", |
| 352 |
"Condensed", and so forth. |
| 353 |
|
| 354 |
:doc:`There is a table of the stylistic names FontForge recognizes on the Font Info page. <fontstyles>` |
| 355 |
|
| 356 |
There is a second list of names for which FontForge would like multiple |
| 357 |
translations because these also appear in the 'name' table translated into as |
| 358 |
many languages as possible. These are the names of the mac's Feature/Setting |
| 359 |
strings, and they may be found on |
| 360 |
`Apple's Font Feature registry <http://developer.apple.com/fonts/Registry/index.html>`_. |
| 361 |
|
| 362 |
Finally I would like to make it as easy as possible to embed the |
| 363 |
`OFL <http://scripts.sil.org/OFL>`_ into a font created by FontForge, and I |
| 364 |
would like to encourage its translation (And that of its accompanying FAQ) into |
| 365 |
as many languages as possible. |
| 366 |
|
| 367 |
SIL regards translation as important but adds the following caveats (in their |
| 368 |
`FAQ <http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=OFL-FAQ_web>`_): |
| 369 |
|
| 370 |
**5.5 How about translating the license and the FAQ into other languages?** |
| 371 |
|
| 372 |
SIL certainly recognises the need for people who are not familiar with |
| 373 |
English to be able to understand the OFL and this FAQ better in their own |
| 374 |
language. Making the license very clear and readable is a key goal of the |
| 375 |
OFL. |
| 376 |
|
| 377 |
If you are an experienced translator, you are very welcome to help |
| 378 |
translating the OFL and its FAQ so that designers and users in your language |
| 379 |
community can understand the license better. But only the original English |
| 380 |
version of the license has legal value and has been approved by the |
| 381 |
community. Translations do not count as legal substitutes and should only |
| 382 |
serve as a way to explain the original license. SIL - as the author and |
| 383 |
steward of the license for the community at large - does not approve any |
| 384 |
translation of the OFL as legally valid because even small translations |
| 385 |
ambiguities could be abused and create problems. |
| 386 |
|
| 387 |
We give permission to publish unofficial translations into other languages |
| 388 |
provided that they comply with the following guidelines: |
| 389 |
|
| 390 |
- put the following disclaimer in both English and the target language |
| 391 |
stating clearly that the translation is unofficial: |
| 392 |
|
| 393 |
"This is an unofficial translation of the SIL Open Font License into |
| 394 |
$language. It was not published by SIL International, and does not legally |
| 395 |
state the distribution terms for fonts that use the OFL. A release under |
| 396 |
the OFL is only valid when using the original English text. |
| 397 |
|
| 398 |
However, we recognize that this unofficial translation will help users and |
| 399 |
designers not familiar with English to understand the SIL OFL better and |
| 400 |
make it easier to use and release font families under this collaborative |
| 401 |
font design model. We encourage designers who consider releasing their |
| 402 |
creation under the OFL to read the FAQ in their own language if it is |
| 403 |
available. |
| 404 |
|
| 405 |
Please go to http://scripts.sil.org/OFL for the official version of the |
| 406 |
license and the accompanying FAQ." |
| 407 |
|
| 408 |
- keep your unofficial translation current and update it at our request if |
| 409 |
needed, for example if there is any ambiguity which could lead to confusion. |
| 410 |
|
| 411 |
If you start such a unofficial translation effort of the OFL and its |
| 412 |
accompanying FAQ please let us know, thank you. |
| 413 |
|
| 414 |
`The text of the current version of the OFL <http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=OFL_web>`_. |
| 415 |
If anyone is interested in translation both the OFL and its FAQ |
| 416 |
`please let me know <mailto:[email protected]>`_ (via |
| 417 |
mailing list) and I will provide Web space for both. I had intended to include |
| 418 |
these translations in the font's 'name' table, but have been asked not to |
| 419 |
because of the possible legal ramifications. |
| 420 |
|
| 421 |
At the moment (Feb 2007) OFL version 1.1 has just been released. I have |
| 422 |
collected the :doc:`following unofficial translations <OFL-Unofficial>`. |