OpenVAA / voting-advice-application

An open-source platform for creating Voting Advice Applications (VAAs)
https://openvaa.org/en
GNU General Public License v3.0
10 stars 0 forks source link

build: add an automatic check for missing translations when merging into main #507

Closed kaljarv closed 1 month ago

kaljarv commented 6 months ago

Check that all of the translation keys in all locales (and fields in App Labels) match, before merging into main. Better yet, define the content type dynamically to always all appropriate keys from the translations, but this maybe limited to only those that are mostly frequently edited if exposing all of them is unwarranted.

Consider also adding a check that confirms that all separate translations files are included in the keys list in i18n/translations/index.ts

Consider also if we can automatically generate a translation key string literal type so we get code completion for $t(key: AutoGeneratedTranslationKeyType).

One challenge is that the json translation files currently have multiple levels of hierarchy, which might be an issue for Strapi's Content Type – Component – Field model.

kaljarv commented 4 months ago

New thing to consider:

Translation key + Translated string

A question is how should we define the target language: as a part of the key, as its own field, or have the translated string be a LocalizedString json object?

kaljarv commented 4 months ago

Remove all localisation stuff from Strapi so as not to mix things up.