Skip to main content

no-untranslated-text

Enforce text labels in JSX to be wrapped by translate calls.

When the i18n feature is used, this rule ensures that all labels appearing on the website are translatable, so no string accidentally slips through untranslated.

ルールの詳細

このルールに対する不適切なコード例:

// Hello World is not translated
<Component>Hello World</Component>

このルールに対する適切なコード例:

// Hello World is translated
<Component>
<Translate>Hello World</Translate>
</Component>

ルールの設定方法

Accepted fields:

OptionTypeDefault説明
ignoredStringsstring[][]Text labels that only contain strings in this list will not be reported.

When Not To Use It

If you're not using the i18n feature, you can disable this rule. You can also disable this rule where the text is not supposed to be translated.

Further Reading