Opened 14 years ago

Closed 14 years ago

Last modified 5 years ago

#9200 closed patch

Use data file for translations

Reported by: criezy Owned by: sev-
Priority: normal Component: GUI: Translations
Version: Keywords:
Cc: Game:

Description

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.

Attachments (2)

translations_dat_tool.diff (152.1 KB ) - added by criezy 14 years ago.
Tool to generate translations.dat
translations_dat.diff (143.0 KB ) - added by criezy 14 years ago.
Modifications to the TranslationManager

Download all attachments as: .zip

Change History (5)

by criezy, 14 years ago

Attachment: translations_dat_tool.diff added

Tool to generate translations.dat

by criezy, 14 years ago

Attachment: translations_dat.diff added

Modifications to the TranslationManager

comment:1 by sev-, 14 years ago

Owner: changed from criezy to sev-
Status: newclosed

comment:2 by sev-, 14 years ago

Excellent! I committed it as is.

However there is a problem, currently the code requires that translations.dat file sits in same directory as scummvm.exe, although logically would be to keep it in themepath. I'll look into that.

comment:3 by digitall, 5 years ago

Component: GUI: Translations
Note: See TracTickets for help on using tickets.