Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 867 Bytes

i18n-hyphenated-range.md

File metadata and controls

24 lines (18 loc) · 867 Bytes

Disallow using a hyphenated numerical ranges in translatable strings (i18n-hyphenated-range)

Using hyphenated numerical ranges in translatable strings is incompatible with Android linting rules and can lead to translation pipeline issues. See Android Lint: TypographyDashes for more information.

Rule details

Examples of incorrect code for this rule:

__( '1-10' );
__( '1 - 10' );
__( '1  -  10' );

Examples of correct code for this rule:

__( '-10' );
__( '1 0 -1' );
__( '1–10' ); // Note the use of 'en' dash (U+2013) vs hyphen (U+002D)
__( '1—10' ); // Note use of 'em' dash (U+2014) vs hyphen (U+002D)
__( '1\u201310' );
__( 'Text - with a hyphen - is fine.' );