i18n: lint against more invalid usages of gettext helpers
f3f35799
This extends the require-valid-i18n-helpers
rule to detect usages of
gettext (__
) with a namespace. In such cases, the namespace is
displayed as is in the UI, so we should either remove the namespace, or
use the s__
helper instead.
note: Technically, this could flag some usages as being invalid when a |
character is included on purpose within the string. IMO, it's better to "overlint" and ignore the false positives, rather than not lint against this at all and let some ignored namespaces appear in the UI.
What motivated this change is that I stumbled across one of those usages while browsing GitLab.com:
63fcbb54
This ensures that, when pluralizing some translation with n_gettext
,
both the singular and plural forms use the same translation namespace,
or no namespace at all.