Use data file for translations
|Reported by:||criezy||Owned by:||sev-|
To avoid using memory for all the existing translations the attached patches replace the static arrays generated by po2c by a translations.dat file. The TranslationManager instance loads the list of language from the translations.dat file when it is constructed. Then when a language is set it loads the translation for that language from the same file.
I have split the changes in two patches: + translations_dat_tool.diff adds a create_translations tool that generate the translations.dat file. + translations_dat.diff modifies the TranslationManager in ScummVM
Currently it still uses po2c so that I didn't have to implement the po file parser in the create_translations tool. That means that to update the translations we still need perl and we need to recompile the create_translations tool. To ease the test of translations I would like to get read of po2c altogether and implement the po files parsing directly in the create_translations tool. I have kept that for later though as I don't think it is critical.
To generate translations.dat, just execute 'make update-translations' (as before except that now we do not need to recompile ScummVM afterward). The file is generated in gui/themes/
I didn't include gui/themes/translations.dat in the patches, but it should also be committed to the repository.
I am adding the patches there so that I can get some feedback before committing.
Ticket imported from: #3044975. Ticket imported from: patches/1305.