yoast-components
yoast-components copied to clipboard
Consider to avoid spaces at the end of translatable strings.
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:

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' ),
Just checked this again and found 6 occurrences of : " ) see below:
