In general, translating software is most likely followed by testing the translation, unless for those who don’t care about the quality. Doing this needs a dirty procedure, however.
All I knew in the old days is to overwrite translation files (.mo files) with my own. Usually default location for those translation files is /usr/share/locale (or /usr/share/locale-langpack for Ubuntu). But after each time system update is done so that software is updated, I have to overwrite the translation file again and again, fighting with system update. Tedious.
Recently I’ve learnt a new brilliant/ugly trick (depends on point of view), which works for most software: setting the $LANGUAGE environment variable. It looks like:
export LANGUAGE=../../../$HOME/.local/share/locale/zh_HK:zh_HK
This trick works on the assumption that /usr/share/locale/ or whatever directory would be appended to each path defined in $LANGUAGE. In this way user’s own translation will always override the system one, thus facilitates testing regardless of whether system translation is overwritten or not. Two caveats though:
- Have to remember removing the file after testing, otherwise custom translation will be used forever, even when system contains more up-to-date translation.
- Not all applications obey
$LANGUAGE variable. For example, poedit doesn’t honor it.