Translatable plugins

Just thought that command labels, settings labels and others that are brought by plugin could have language file that would translate them according to language of Joplin user.

No high priority.

1 Like

Its possible to do manually - there is global setting that allow for locale retrieval

so the thing would be to create helper inside plugin generator that would fetch translations (from /src/langs.json for example).
This would encourage plugin developers to add those translations.

It's a good point, but I wonder if the plugin system needs to support this? As you found out, you can already get the current locale, and localisation can be done with existing tools like i18next or by creating your own translation function. The plugin basically doesn't need anything from the app for this.

The only benefit of generator doing files for langs would be that all plugins would have same standard way of translating.

Since most of translations are made by community and not developer, users could translate plugins without learning each individual plugin's structure.

Its not a priority so just a thing to think about.

That’s a good point, I’ll try to think of some simple way to add this. Maybe just a string map in a json file would suffice.

In fact, it doesn't work well. According to my personal experience using i18next, when I want to use more complex functions, typescript type definition will become a problem.


Of course, you can choose code generation, or more simply ignore the type system. . .

Yes I don't have a good experience using i18n either and I feel it's buggy and poorly documented, but for those who want a ready-made solution it could be an option. I wouldn't use it for the plugin system in any case.

i18next/formatjs are two popular internationalization solutions, but the user experience and documentation are very bad. Relatively speaking, i18next may be better. . . However, it is not recommended to integrate it into the core of the plug-in system. Perhaps, just implement a simple string mapping similar to the internationalization of the vscode plug-in. If you need more advanced functions, you need to choose the library by yourself.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.