Hi everyone,
I looked at bit into the current state of separate localization plugins (JEP-216[1]) this weekend.
Currently, there is one such plugin, localization-zh-cn[2]. It includes both Simplified Chinese translations, as well as supporting infrastructure to enable their use, IIUC partly/mostly based on how the Translation Assistance Plugin could be used to load local user-provided translations.
The plugin supports two of the three major localization 'types' (views and Stapler resources) and I'm currently looking into adding support for the third[3], localizer/Messages.properties.
AFAIUI, we have two options how to continue from here to support further externalized localizations, and I'm not sure these have been properly evaluated so far (corrections welcome).
Option A:
Rename the plugin from `localization-zh-cn` to `localization` and add other languages to this plugin. Some supporting infra code will need to be adapted to make this work; right now `_zh_CN` is partly hardcoded. Will require some additional governance to support many additional contributors to this one plugin. Might result in many more releases than are needed for a specific user group, or changes not being published in a timely manner.
Option B:
Duplicate all of the support infrastructure from localization-zh-cn into, for example, localization-de, and maintain it twice. I'm not even sure it'd work based on the code in localization-zh-cn that deals with identifying conflicting plugins[4].
Option C:
Move the supporting infrastructure from `localization-zh-cn` into a new `localization-support` plugin and generalize it to work for any locale. Add a dependency from localization-zh-cn to localization-support.
`localization-support` is expected to remain fairly unchanging, while `localization-zh-cn` (and any other specific localization plugin) would be regularly updated to include new translations.
It adds an additional (expected to be fairly stagnant) plugin, plus one plugin per locale, but these individual plugins would only receive updates when there's actually something relevant for their user group.
Options B and C also make more sense for the 'Languages' category in the setup wizard (which would otherwise be exactly one plugin).
IMO, Option C is preferable, but it requires some refactoring to pull out supporting infrastructure from `localization-zh-cn`, but it seems to be most consistent with how this has been set up.
WDYT?
Daniel
1:
https://github.com/jenkinsci/jep/tree/master/jep/216 and
https://github.com/jenkinsci/jep/pull/191
2:
https://github.com/jenkinsci/localization-zh-cn-plugin
3:
https://github.com/kohsuke/localizer/pull/16 and
https://github.com/jenkinsci/jenkins/pull/3729
4:
https://github.com/jenkinsci/localization-zh-cn-plugin/blob/master/src/main/java/jenkins/plugins/localization/LocalizationMonitor.java