Freevo Plugin Writing HOWTO: Writing your own plugins for Freevo | ||
---|---|---|
Prev | Chapter 4. Notes for writing a plugin | Next |
Please keep in mind that Freevo has i18n support, meaning that the
plugin can be translated into different languages. To support that,
please add _()
to each visible text string.
If your plugin is an external plugin and not distributed with Freevo,
please use self._()
for the translation and set
the module for the translation with the function
translation
. This function exists for items and
plugins. A item will inherit the translation settings from it's
parent, so you only need to load it once.
class PluginInterface(plugin.Plugin): def __init__(self): plugin.Plugin.__init__(self) self.translation('my_app') def foo(self): return self._('Text to translate')
To update the translation you need to call the script update.py in the i18n directory of Freevo or when you have an external plugin, call setup.py (see Plugin Distribution for details).