This was discussed in the thread "Translations of Math environments in LyX
output for LyX 2.2" at http://www.mail-archive.com/lyx-docs@lists.lyx.org/msg08633.html
and has been reviewed. The problem was that in 2.1, the portuguese translation
was correct in lib/layouttranslations but different in po/pt_PT.po. In fact,
the translation is the same for all three languages spanish, portuguese and
brazilian portuguese.
After some discussion between Georger, Pedro, Pavel and me Georger came to the
conclusion that Mapa is not the correct translation of Chart in this context.
Originally he proposed Gráfico, but since that would be identical to the
translation of Graph we decided that Diagram is better. It is a bit more
general than Gráfico, but it is also used in pt_PT, and the german translation
uses the german equivalent, which is more general as well. Those who need a
Gráfico can still use Graph.
Unfortunately Geoger based the new .po file on the remerged one at
259196e1a6, so we have now the situation that pt_BR is remerged, but the
other languages are not.
These strings were translated manually in lib/layouttranslations, but not in
zh_TW.po. If this is the correct translation for document output, then it is
certainly also correct for the user interface.
This string was translated manually in lib/layouttranslations, but not in
ar.po. If this is the correct translation for document output, then it is
certainly also correct for the user interface.
lib/layouttranslations contains translations for all strings from layout files
that can appear in document output. These translations are read from .po files
by po/lyx_pot.py (using python polib), so up to date po files are needed.
Now it produces the same output if running under python3 (tested with 3.4.2)
or python2 (tested with 2.7.9). python3 always uses unicode strings
internally, so we have to specify the file encoding on opening a file, such
that strings can be converted from and to the file encoding on reading and
writing. Using the io module for file io ensures that the behaviour is the
same for python2 and python3. For python2 we also have to mark string literals
as unicode strings by using the u prefix (which is a noop in python3).
Many thanks to José for review and pointing out all the details.