I searched for the issue and this forum, can’t find a solution for the official API / Widget for thrid party plugin i18n.
Can we use the same method as the core to do the translation? My plugins are English only or Chinese only currently, I hope I can make them internationalization.
There is a Draft PR at Github, that implements a possible concept for translatable plugins.
It is a working solution. But there is no consens yet how the UI should be implemented.
IMO the main problem was, that I needed to change 50 files. I used the tiddlywiki menubar plugin to show the concept. I needed to change all the languag-files 2 times and I needed to add a test-library server to be able to test anything.
This server adds additional complexity to the PR. … With TW v5.2.24 this library-test server will be part of the default editions. … So the draft-PR can be simplified and 14 files can be removed.
I also found a bug in the plugin-library icon handling, which is there for ever, but only visible in the plugin import popup, if the plugin uses a custom icon. …
I needed to add code indentation to the main plugin-macro tiddler. The plugin handling UI is one of the most complex wikitext code we have in the whole system. … Making the wikitext code human readable is usually a separated PR which can take several weeks to be merged.
I still think the directory structure introduced in the PR is easy to implement and maintainable for both the core-devs and for plugin authors.
I would need to have a closer look again. AND I’d also have to have a closer look at the issues you mentioned in the OP.
Other languages like zh-Hans are provided via sub-plugin
In plugin.info, add main plugin as dependents , "dependents": "$:/plugins/oflg/fishing", so it appears as a sub-plugin.
The principle is the sub-plugin will overwrite tiddlers provided by main plugin, so language pack will overwrite the $:/language/fishing/discard in the main plugin.
Hi @linonetwo extracting the name of the language from the title of the current language plugin is brittle. Better to get the value of $:/language, defaulting to “$:/languages/en-GB”, and then get the “name” field of that tiddler.