Last updated 25 July 2010.

When there's a new version of a module or core, some of the source strings will have minor changes from the previous version, such as corrections of grammar and typos, as well as any rewrites. For these strings, it's useful to have the translations for the old strings available for reuse. There's a program which compares two files and marks translations of similar-but-not-identical source strings as "fuzzy". Here's how you get a file of such fuzzy matches to import to the localization server.

  1. Export a template file for the new version, and a translation file for the old version(s)
  2. Run the command msgmerge (Unix). This will result in a translation file for the new version, with all matching and almost-matching strings from the old version.
  3. Run the command msgattrib with the parameter --fuzzy. This removes all the non-fuzzy strings, and then removes the "fuzzy" tag from all the remaining strings.
  4. Consider reviewing the file in a .po editor to remove the most obvious wrong suggestions.
  5. Import the resulting file to the localization server as suggestions.

Important: Review the suggestions carefully. Some fuzzy matches will be completely wrong. For instance, msgmerge may suggest "field" as a fuzzy match for "file".

If you do this for Drupal 7.x, the following contributed modules may have reusable translations for core:

  • CCK
  • FileField
  • ImageField

Comments

jcisio’s picture

Would it be automatically done by LDO? Many strings are slightly changed between minor versions for contrib, and it happened even for core, that would be great if LDO could automatically create a suggestion for non translated strings based on old strings.