Wiki > Main > PluginLocalization (compare)
Difference: PluginLocalization (r2 vs. r1)
Rockbox is currently aimed at a wide variety of digital audio players and users. Many of its users are native speakers of a language other than English and many others are blind. Currently, Rockbox provides translations for nearly 40 languages but these translations are limited to the core. All of the plugins are English only but this project aims to change that.
Implement a method for executing localized plugins using a static buffer to hold the strings and ids. This buffer will then be moved into the plugin buffer using plugin_get_buffer(). These versions will load from a single language file per language. In the future it will be nice to only load the necessary strings for each plugin instead of all plugin strings. This same idea can be extended to the core and would allow a universal language file instead of target-specific language files. This constitutes a fairly massive change to the language system and will be the last part of the plugin localization effort.
Preliminary work has been done on the project. Initial versions used static buffers as described above and have progressed onto using the plugin buffer. There are two different approaches in development The latest work on this project can which will be attached to found at the tracker soon. http://www.rockbox.org/tracker/task/9067 .
During building, /apps/plugins/lang/*.lang are run through genlang. The results will be in .rockbox/plangs/*.lng. After a plugin is loaded, a call must be made to plugin_use_lang() in plugin_start() if the plugin wants to use localized strings. This function will initialize the plugin strings and store them in the plugin buffer. If another language was chosen, plugin_use_lang() checks global_settings and loads that language file. These strings are accessed using the p_str() macro. Similarly, if a plugin wishes to use strings from the core lang, the str() macro can be used. These strings are available to all plugins, not just the ones that call plugin_use_lang().
r3 - 09 Jul 2008 - 22:07:40 - TomRossRevision r2 - 03 Jun 2008 - 06:53 - TomRoss
Revision r1 - 29 May 2008 - 05:12 - TomRoss
Copyright © by the contributing authors.