I18n API For Plugin API
Check for existing issues
- [x] Completed
Describe the feature
Just drafting this Here, For supporting it. Unsure about how it's supposed to Supported or how it's Implementation should work.
Any Ideas, positive critics are appreciated.
If applicable, add mockups / screenshots to help present your vision of the feature
No response
The plugin.json file can optionally include a reference to a langs directory:
{
"i18n": "plugin/path/to/langs/directory"
}
This directory should contain language files, following the same structure as src/langs in Acode.
In the plugin init function, Acode will fetch correct language file and provide a strings JSON object containing the localized strings for the current language. The plugin can then use these strings anywhere
for example:
console.log(strings["hello"]);
Interesting 🤔, I didn't include that. As Plugin devs can get-in their own Library too.
As Translators still need to translate The Plugin itself and nothing is related to Acode's side for it.
Nothing as Strong Thoughts 🤔
I think this should be very easy, just a variable to see the app's language and configure the plugin according to the developer's wishes.
It was enough to create a logic for the readme in different languages in the plugin.json pointing to each language, this is very easy to implement
{
"readme": "README.pt.md",
"readmes": {
"en": "README.en.md",
"pt": "README.pt.md"
}
}
This way it doesn't break other plugins or developers who don't want to add it.
What do you think? They just use i8next and that's it!
This feature is needed please look into it