Product Opener - How to update interface translations in

From Open Food Facts wiki
Jump to navigation Jump to search

Project:ProductOpener > Product Opener documentation


The translations for the strings used in Product Opener are located in

For Open Food Facts, the part of containing translations is copied in the wiki so that users can add and edit translations:

This how-to explains how to push new translations from the wiki live.

Review diffs

In the wiki, use the "View history" function to review what was added / changed.


We will be using a copy of

Copy the current to

Edit and copy and paste the translations from the wiki in (replacing the current translations).


  • contains some code before and after the translations, keep it.
  • Make sure to use a UTF-8 editor (and that character set is set to UTF-8), or you will lose special alphabets when doing the copy and paste.

Check updated

Duplicate language keys

A common error is contributors who copy and paste strings to translate them, but who then forget to change the language key (e.g. "en" to the language their translating to).

A script makes sure there is only one value for each key:

stephane@ks3095298:~/product-opener/scripts$ ./ ../cgi/
Checking ../cgi/
key column has 2 values for lang pt

-> we have twice pt => for the string "column" (side column of the web site)

Perl syntax is a Perl module, the syntax needs to be correct. You can test it by running perl

Bareword found where operator expected at line 3303, near ""Geef de ingrediënten met de vermelding "Kan"
        (Missing operator before Kan?)
Bareword found where operator expected at line 3303, near "", "Geproduceerd"

Most errors are mismatched or forgotten " and ' to terminate strings, or strings that contain " or '. (use the other one for delimiters)

Restart Apache

When issues are fixed, copy to then stop and start Apache.

sudo apache/bin/apachectl stop
sudo apache/bin/apachectl start

Note: apachectl restart does not reload preloaded Perl modules like, you have to stop and start.

Check that the changes are live and display correctly on the site.

Update the wiki

Any fixes you made to the file need to be saved immediately on the wiki.

Commit changes

For Open Food Facts, commit your changes to the git repository.