-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
When translating widgets (e.g. to Slovenian, German), we want to keep them accessible via English names, too, because we often don't know the translated name. We achieve this by keeping adding the widget name to keywords in translations. (We also keep other English keywords there.) We cannot do this if the widget doesn't have keywords in the original code.
Also, in cases where we don't feel we need keywords in English because the name is "unique enough", keywords may be necessary in other languages. We cannot add them if there is nowhere to add.
If there are no sensible keywords for English, we can just use the widget name as keyword. Pay attention, though that the same string may appear multiple times. Add spaces or whatever necessary. Perhaps, we add ### as the first keyword; it won't have any effect (other than easter-egg), but will help us distinguish the keywords in translations.
To this end, we should
- add a test to base widget tests that checks that the widget has keywords (in its class definition, not inherited),
- check that keywords are given as a comma-separated string, not a list of strings (because in the latter case the number of keywords in translation must match their original number),
- perhaps: require that keywords that have only a single keyword that matches the widget name in lower case have a keyword
###to avoid ambiguities, - add keywords to all widgets.
We may add this requirement for core widgets and potentially exclude others.