How to contribute by editing .po files
Last modified: July 31, 2009 - 19:33
- Get a .pot file for the module you want to translate.
.pot-files contain all the strings to be translated. For core, you can find these files at http://drupal.org/project/drupal-pot.
For contributed modules, use the Translation template extractor. Some module authors place a .pot file in the folder /po (for 5.x) or /translations (for 6.x) for their modules. Be aware that if the .pot file is older than the module version you want to use, it may not be updated with all text strings.
If you want to improve an existing translation, see Recycling old translations. - Rename the .pot-file file to lanugagecode.po (for instance de.po or fr.po).
- Open the .po file in an editor and start translating.
You can use either a plain text editor, or a translation editor. - When you have finished, contribute the translation back to drupal.org (to a translation project for core, or the module issue queue for contributed modules), and import it into your sites.
Examples of .pot and .po files
From the .pot file for views:
#: modules/user/views_handler_filter_user_name.inc:29
msgid "Enter a comma separated list of user names."
msgstr ""
#: modules/user/views_handler_filter_user_name.inc:112
msgid "Unable to find user: @users"
msgid_plural "Unable to find users: @users"
msgstr[0] ""
msgstr[1] ""The same strings in de.po (German translation):
#: modules/user/views_handler_filter_user_name.inc:29
msgid "Enter a comma separated list of user names."
msgstr "Eine kommagetrennte Liste von Benutzernamen."
#: modules/user/views_handler_filter_user_name.inc:112
msgid "Unable to find user: @users"
msgid_plural "Unable to find users: @users"
msgstr[0] "Benutzer konnte nicht gefunden werden: @users"
msgstr[1] "Benutzer konnten nicht gefunden werden: @users"In the second string @users is a variable, and will be replaced with a number in the user interface. Words starting with @, !, and %, as well as words inside {} and expressions like {text}.text are variables and should not be translated.
