TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.97k stars 1.18k forks source link

[BUG] Plugin Translation - Needs to respect the language plugin "dependents" field #8263

Open pmario opened 2 months ago

pmario commented 2 months ago

@Jermolene, @linonetwo -- breaking change

German Austria - de-AT and German Germany de-DE are very similar. That's why the de-AT language uses "dependents": ["$:/languages/de-DE"], to install both languages if needed.

I did translate the menu-bar plugin for de-DE but switching to German Austria does not use that info for the menu-bar plugin !!

image

The default language switching works as expected: See "Jannuar" vs "Jänner"

image

linonetwo commented 2 months ago

How does it work for regular translation? Is enable de-AT also enable de-DE ? I thought there will only be one language plugin being enabled.

pmario commented 2 months ago

The PluginSwitcher seems to use it. The accumulatePlugins seems to extract "dependents" first and then the one which is activated.

https://github.com/Jermolene/TiddlyWiki5/blob/91e0b2afb6e6729d9f5f8333a88db83d77133489/core/modules/pluginswitcher.js#L55-L59

linonetwo commented 2 months ago

@pmario How to get dependents using fitler? This is not working

$tw.wiki.filterTiddlers('[[$:/languages/]addsuffix[de-AT]get[dependent]]') 

Oh, it is dependents