yoast-components icon indicating copy to clipboard operation
yoast-components copied to clipboard

Consider to avoid spaces at the end of translatable strings.

Open afercia opened this issue 8 years ago • 1 comments

Not sure if there's already a convention about this, however there are some cases where translatable strings have an intentional space at the end. Mostly used when the strings ends with a colon : and they're supposed to be followed by other strings or values.

This can easily lead to two issues:

  • translators miss the trailing space therefore the resulting translated string will be incorrectly joined with what is supposed to be after the string
  • strings can be sort of duplicate with similar strings without the space

Example:

screen shot 2017-02-10 at 18 10 04

Reference:

// Reference: node_modules/yoastseo/js/snippetPreview.js:377
__( 'SEO title preview:', 'wordpress-seo' ),

// Reference: node_modules/yoastseo/js/snippetPreview.js:378
__( 'Slug preview:', 'wordpress-seo' ),


// Reference: yoast-components/composites/SearchResultForm/SearchResultForm.js:42
// Reference: yoast-components/composites/SearchResultPreview/SearchResultPreview.js:41
__( 'SEO title preview: ', 'wordpress-seo' ),

// Reference: yoast-components/composites/SearchResultForm/SearchResultForm.js:44
__( 'Slug preview: ', 'wordpress-seo' ),

afercia avatar Feb 10 '17 17:02 afercia

Just checked this again and found 6 occurrences of : " ) see below:

screen shot 2017-09-08 at 11 50 13

afercia avatar Sep 08 '17 09:09 afercia