[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:misc:internationalization_and_localization_of_shell_scripts [2013/08/09 19:51 (UTC)] – [Maintenance process] didierspaier | howtos:misc:internationalization_and_localization_of_shell_scripts [2015/12/22 22:31 (UTC)] (current) – [Processes diagrams] Typo fix didierspaier | ||
---|---|---|---|
Line 7: | Line 7: | ||
This document is intended to help developers, maintainers and translators to write/ | This document is intended to help developers, maintainers and translators to write/ | ||
- | The reference document is the manual entitled [[http:// | + | The reference document is the manual entitled [[http:// |
The manual encompasses all programming languages usable with gettext, with a special focus on the C language. | The manual encompasses all programming languages usable with gettext, with a special focus on the C language. | ||
Line 55: | Line 55: | ||
Among these actions are execution of some programs of the gettext suite: | Among these actions are execution of some programs of the gettext suite: | ||
- | * gettetxt: marks strings to be insternationalized, then displays localized messages during scripts' | + | * gettetxt: marks strings to be internationalized, then displays localized messages during scripts' |
* xgettext: extracts marked strings from a set of shell scripts to build a POT or a PO file | * xgettext: extracts marked strings from a set of shell scripts to build a POT or a PO file | ||
* msgcmp: | * msgcmp: | ||
Line 65: | Line 65: | ||
=== (1) Internationalization === | === (1) Internationalization === | ||
- | + | ||
Set of shell scripts ───> | Set of shell scripts ───> | ||
Line 141: | Line 141: | ||
This variant of the process is shorter: | This variant of the process is shorter: | ||
- | + | ||
╭─ [msgcmp] <── < | ╭─ [msgcmp] <── < | ||
│ | │ | ||
Line 216: | Line 216: | ||
The POT file will be generated using the ' | The POT file will be generated using the ' | ||
- | I suggest to include | + | Include |
-L Shell (of course!) | -L Shell (of course!) | ||
--strict (to facilitate checks and management of the messages catalogs) | --strict (to facilitate checks and management of the messages catalogs) | ||
Line 273: | Line 273: | ||
==== Practical recommendations for developers and maintainers ==== | ==== Practical recommendations for developers and maintainers ==== | ||
- | Many English words are polysemous: their meaning can only be determined from the context of their usage. | + | Many English words are polysemous: their meaning can only be determined from the context of their usage. |
As a practical consequence, | As a practical consequence, | ||
Example: recently, while downloading a software I saw something like this:\\ 31min gauche\\ Go figure? After a while I realized that " | Example: recently, while downloading a software I saw something like this:\\ 31min gauche\\ Go figure? After a while I realized that " | ||
- | Also, order of words in a sentence vary upon language, furthermore not all languages are written left to right. | + | Also, order of words in a sentence vary upon language, furthermore not all languages are written left to right. |
- | + | ||
- | So I suggest to mark entire paragraphs, or at least entire sentences, not lines, let alone isolated words but in special cases. | + | |
For instance, if text paragraphs were split in lines displayed by ' | For instance, if text paragraphs were split in lines displayed by ' | ||
- | Do not fear to include the variable substitutions in the sentences, | + | Do not fear to include the variable substitutions in the sentences, PO editor will check that they be present as is in the translations. |
=== Recommendations for ' | === Recommendations for ' | ||
Line 307: | Line 303: | ||
In particular, I recommend to favor options which take as first argument a text string instead of a file, to allow line wrapping. It is still possible to preserve the intended layout using white spaces for indentation. | In particular, I recommend to favor options which take as first argument a text string instead of a file, to allow line wrapping. It is still possible to preserve the intended layout using white spaces for indentation. | ||
- | For instance,\\ dialog < | + | For instance, |
+ | | ||
+ | can be replaced with | ||
+ | | ||
==== Practical recommendations for translators ==== | ==== Practical recommendations for translators ==== | ||
- | Depending on amount of work needed and available resources, there can be one translator or a team of translators per target language. | + | Depending on amount of work needed and available resources, there can be one translator or a team of translators per target language. In all cases, I recommend that at least one person be responsible for organizing the team's work, checking the translations and transmitting the checked PO file to the maintainer(s). Let's call this person the team coordinator. |
- | In all cases, I recommend that one person be responsible for organizing the team's work, checking | + | Don't feel obliged to translate verbatim. Not only is this rarely |
- | To qualify as a translator, a person should in my opinion have enough ability of reading shell scripts to understand the meaning | + | Use a specialized PO editor, ' |
- | Also, he or she should not feel obliged | + | While translating, choose a serif fixed width (or " |
- | Not only is this rarely | + | If possible, check the layout of the messages. You could do that looking at the context |
- | It is highly advisable | + | This is especially important if you are translating dialog boxes. In particular, take care not to write too long sentences on one single line if it appears |
- | This will not only prevent inadvertently editing ' | + | Bear in mind that in VGA mode (used in text installers, in particular), |
- | For instance ' | + | Do not add question marks that are not present in the original message. |
- | If possible, I suggest that you check the layout | + | If the message refers to tags (text on the buttons) |
- | You could do that looking at the context in the relevant source file. | + | Avoid colloquialisms and technical slang. |
- | This is especially important if you are translating | + | To " |
- | In particular, take care not to write too long sentences on one single | + | In addition, you will have to comply to gettext' |
+ | * If a word beginning with a dollar sign is included in the original text it should be present in the translation with exactly the same spelling (case matters). | ||
+ | * The translation text should include a " | ||
+ | * A single backslash character " | ||
- | Bear in mind that in VGA mode (used in text installers, in particular), | + | To check your translation against gettext' |
+ | msgfmt -c < | ||
- | Do not add question marks that are not present in the original message. | + | ==== Warning |
- | If the message refers to tags (text on the buttons) | + | Preserve carefully syntax |
- | I suggest to avoid colloquialisms | + | * ' |
+ | * ' | ||
+ | * " | ||
- | In addition, you will have to comply to gettext' | + | When translating shell commands, preserve English names of paths when needed. But you may and should translate arguments |
- | * If a word beginning with a dollar sign is included in the original text it should | + | |
- | * The translation should or not begin or end with a " | + | |
- | * a single backslash character " | + | |
- | To check your translation against gettext' | + | Didier Spaier |
- | following command: | + | |
- | msgfmt -c <name of the PO file> | + | |
====== Sources ====== | ====== Sources ====== | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
{{tag> | {{tag> | ||
+ |