Prevent community mods from warning on unused translations in the common assets

Currently when linting translations, we check for any unused translation keys. This works fine for the default mods, which own the entire sets of translation files. For community mods, they often import the translation files from the common mod assets, but they may only use some of the translations provided. Currently, they would get warnings about not using translations from the common files they have imported.

Since the community mods don't own those translations, getting warnings about it is annoying. To solve this issue, introduce a AllowUnusedTranslationsInExternalPackages in the mod.yaml which defaults to true. This will prevent reporting of unused translation keys from external assets. Keys that are used for external assets will still be validated, and keys from the mod assets will be both validated and unused keys will be reported.

We default the new flag to true and don't provide an update rule. This means community mods will get the new behaviour. For the default mods, we do want to check the "external" assets, since we control those assets. So the default mods have their mod.yaml updated to disable the flag and retain the existing behaviour of checking everything.
This commit is contained in:
RoosterDragon
2024-07-27 22:56:20 +01:00
committed by Gustas
parent 0aac5885fb
commit bd809e5af7
11 changed files with 50 additions and 33 deletions

View File

@@ -130,6 +130,8 @@ Translations:
d2k|languages/chrome/en.ftl
d2k|languages/rules/en.ftl
AllowUnusedTranslationsInExternalPackages: false
Weapons:
d2k|weapons/debris.yaml
d2k|weapons/smallguns.yaml