Changes between Version 50 and Version 51 of DevelopersGuide/DevelopingPlugins


Ignore:
Timestamp:
2011-07-01T21:06:18+02:00 (14 years ago)
Author:
stoecker
Comment:

Description of translation process and advantages of SVN usage

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DevelopingPlugins

    v50 v51  
    173173For SVN managed plugins, the links to old versions and the translated descriptions are automatically added to the [http://josm.openstreetmap.de/plugin plugin information], so JOSM can use that when it displays the list of plugins in the preference dialog.
    174174
    175 == Managing a plugin ==
     175== Translating a plugin ==
     176
     177JOSM uses a gettext-compatible translation system, but uses its own file format for storing the data. To use the translation feature you need to do following:
     178
     179* Simply use '''tr()''', '''trn()''', '''trc()''', '''trnc()''', '''marktr()''' like for other gettext based applications. See [source:trunk/src/org/openstreetmap/josm/tools/I18n.java I18n class] for description and lots of examples in other source files.
     180* Extract the strings and translate them:
     181 * a) Use the normal gettext tools
     182  * Extract strings with {{{xgettext -k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3 ...}}}
     183  * Use {{{msgmerge}}} to update translation files
     184 * b) Use the ant tools of JOSM translation toolchain, see [osm:source:applications/editors/josm/i18n i18n directory].
     185* Create the language files and store them in the plugin file:
     186 * Language files are stored in directory "data" of a plugin and named with the lowercase language code with extension '''.lang'''.
     187 * These files are always a set. The English base file and the translation files must be created together or they will not work correctly.
     188 * The perl script [osm:source:applications/editors/josm/i18n/i18n.pl i18n.pl] must be called with a destination directory and the '''.po''' files to create translation data.
     189
     190== Managing a plugin in OSM SVN ==
    176191There is an SVN repository for JOSM plugins in the main OSM SVN repository, see [http://svn.openstreetmap.org/applications/editors/josm/plugins/ here]. Note that this repository is different from the [http://josm.openstreetmap.de/svn/ main JOSM SVN repository] which only manages the JOSM core.
    177192
    178193You can easily get write access to the JOSM plugins repository by [http://wiki.openstreetmap.org/wiki/Accounts#SVN_access_.28OSM_software.29 following these steps]. If your plugin should be available for other users too and if you want to integrate it into the JOSM plugin update procedure you should submit it to the JOSM plugins repository. The following [http://svn.openstreetmap.org/applications/editors/josm/plugins/00_README readme file] might be helpful too.
    179194
    180 == Updating a plugin ==
     195Managing a plugin in OSM SVN instead of own systems (which is also possible) has some advantages:
     196 * Other users can fix bugs and improve the code
     197 * Translations are done together with JOSM core and thus reach a larger number of translators
     198 * Links for JOSM core compatibility are automatically inserted
     199
     200=== Updating a plugin in SVN ===
    181201
    182202You have found a bug in a plugin and you are able to fix it. Then your next steps are: