release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > SummerOfCode > SummerOfCode2008 > PluginLocalization (r2)

Rockbox Plugin Localization Project

General

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.

Plan

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.

Status

Preliminary work has been done on the project. Initial versions used static buffers as described above and have progressed onto using the plugin buffer. The latest work on this project can be found at http://www.rockbox.org/tracker/task/9067 .

Implementation

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().

Who's working on this

TomRoss
Edit | Attach | Print version | History: r3 < r2 < r1 | Backlinks | View wiki text | More topic actions...
r2 - 03 Jun 2008 - 06:53:13 - TomRoss
Copyright by the contributing authors.