All the list item separators within text must be translatable #58265
Labels
l10n
Localization and translations best practices
[Type] Bug
An existing feature does not function as intended
Description
Splitting this out from #58201 (comment)
While searching for
join( ', '
through the codebase, it turned out that such a separator is used to delimit list items embedded in translatable strings. That approach may work for English and other Western languages but it's not okay. The list item separator needs to be translatable.In WordPress core, the
wp_get_list_item_separator()
function internally applies a translation function and returns a separator string. See alsoWP_Locale->get_list_item_separator()
.Gutenberg needs a similar approach where the list item separator and possibly in the future other separators, etc. are in a centralized location and can be reused throughout the codebase.
So far, in #58256 there is a proposal to add a
l10n
object topackages/editor/utils
to provide a translation mechanism for the list item separator.Whatever the final implementation will be, all the occurrences of a comma used as list item separator within the user interface text needs to be replaced with a translatable string.
Step-by-step reproduction instructions
N/A
Look for usage of such
.join( ', ' )
pattern in the codebease e.g.:gutenberg/packages/editor/src/components/entities-saved-states/entity-type-list.js
Line 62 in 5795b6e
This example is used here in the Global Styles, when saving changes:
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: