I've just started using I2 Localization, however when I SetTerm to a term that doesn't yet have an entry, there's no indication that there's a problem to resolve, it seems to silently fail and leave the default text.
Is there a way to detect which terms have been set while running but don't have entries or translations?
Last Edit: 5 days 6 hours ago by impbox. Reason: Solved
The administrator has disabled public write access.
Raise Exception when a term is missing?
2 weeks 4 days ago #3224
Setting an invalid term is also useful sometimes and the plugin handles them a bit differently.
When you set a term, the Localize component looks it up in one of the LanguageSources you created. If its found, then its translation is used, parameters, plurals, etc.
However, when the term is empty or can't be found, then the plugin tries to infer it from the label it is trying to localize. It takes the text of the label and see if there is a term with that name, if so, it uses that term.
That its very useful when you are setting your translations, given that you can select all your labels, add a Localize component to them, and without setting a term for each of them, the plugin finds automatically the corresponding term based on the text. (e.g. if the label reads "Play", then it finds for that in the LanguageSource and replaces the text for its translation to the current language)
This is also useful when you are changing the term dynamically using a 3rd party plugin that only knows how to modify the Label's text (e.g. Flow Dialogs and other similar plugins). In that case, you just set the term to empty, and as soon as someone modifies the label's text, it uses that as the term name.