Make WordPress Core

Opened 4 years ago

Last modified 11 months ago

#50087 new defect (bug)

Context-splitting needed for the string "none"

Reported by: tobifjellner's profile tobifjellner Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch needs-refresh
Focuses: Cc:

Description

The strings "None" and "none" are used in many places.

Unfortunately, this string is impossible to translate correctly in many languages.
The reason is that depending on what noun is described, this word may need to be presented in various forms.

Here are the places I can see right now. Unfortunately, I don't have enough knowledge to trace the JS sources.

Note that some of the places are using the word "None" qualifies the same thing, for instance "Alignment" and therefore these occurrences could share the same string for translation.

Line numbers are given as reference as of May 4 2020.

none

wp-admin/includes/meta-boxes.php:1240 type of personal relation
wp-admin/includes/meta-boxes.php:1273 type of geographical relation
wp-admin/includes/meta-boxes.php:1296 type of family relation

None

wp-includes/script-loader.php:954 ?? (term list for JavaScript)
wp-includes/media-template.php:738 Alignment
wp-includes/media-template.php:765 Embedded Player
wp-includes/media-template.php:850 Media link target
wp-includes/media-template.php:994 Alignment
wp-includes/media-template.php:1011 Media URL
wp-includes/media-template.php:1058 Alignment
wp-includes/media-template.php:1134 Media URL
wp-includes/media-template.php:1254 Preload type
wp-includes/media-template.php:1353 Preload type
wp-includes/deprecated.php:688 Dropdown categories (this string could actually simply be replaced by the number 0)
wp-includes/js/dist/components.js:33393 ?? (minified JavaScript)
wp-includes/js/dist/block-library.js:7854 ?? (minified JavaScript)
wp-includes/js/dist/block-library.js:9029 ?? (minified JavaScript)
wp-includes/js/dist/block-library.js:21371 ?? (minified JavaScript)

For reference, I've only seen one place where _x is used, thus enabling correct translation of the string:
None _x
wp-includes/class-wp-editor.php?marks=1336#L1336

Attachments (2)

50087.diff (6.5 KB) - added by audrasjb 4 years ago.
i18n: Add context to the use of None string across WordPress Admin
50087.1.diff (6.4 KB) - added by audrasjb 4 years ago.
i18n: Add context to the use of None string across WordPress Admin

Download all attachments as: .zip

Change History (10)

@audrasjb
4 years ago

i18n: Add context to the use of None string across WordPress Admin

#1 @audrasjb
4 years ago

  • Keywords has-patch added

Nice catch @tobifjellner, I second this, it's not always easy to get the context of those strings.
In 50087.diff, I tried to fix everything that can be handled on Core side. The block editor part should be opened as an issue on GitHub. I can take care of that is you want (and if you opened an issue on GitHub please share the issue link here so it could be tracked :)

Thanks,
Jb

#2 @tobifjellner
4 years ago

Hi @audrasjb No, I just opened this ticket here. It would be great if you could follow through on the scripting side of things.

#3 @audrasjb
4 years ago

Ok I'll take care of that, thanks again!

#4 in reply to: ↑ description @SergeyBiryukov
4 years ago

Replying to tobifjellner:

none

wp-admin/includes/meta-boxes.php:1240 type of personal relation
wp-admin/includes/meta-boxes.php:1273 type of geographical relation
wp-admin/includes/meta-boxes.php:1296 type of family relation

Could these three be combined to just "Type of relation"?

Is there a locale where they all need different translation?

#5 @tobifjellner
4 years ago

Could these three be combined to just "Type of relation"?

I guess we can do that for now. If we get feedback that further splitting is needed, then we can always do that later.

#6 @audrasjb
4 years ago

  • Keywords needs-refresh added

Hey,

Pull request opened on GitHub: https://github.com/WordPress/gutenberg/pull/22095

Could these three be combined to just "Type of relation"?

Yes I think so, I'll update my patch accordingly.

@audrasjb
4 years ago

i18n: Add context to the use of None string across WordPress Admin

#7 @audrasjb
4 years ago

  • Keywords needs-refresh removed

#8 @swissspidy
11 months ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.