Make WordPress Core

Opened 5 years ago

Closed 6 months ago

Last modified 5 months ago

#50087 closed defect (bug) (fixed)

Context-splitting needed for the string "none"

Reported by: tobifjellner's profile tobifjellner Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
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 (3)

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

Download all attachments as: .zip

Change History (18)

@audrasjb
5 years ago

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

#1 @audrasjb
5 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
5 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
5 years ago

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

#4 in reply to: ↑ description @SergeyBiryukov
5 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
5 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
5 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
5 years ago

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

#7 @audrasjb
5 years ago

  • Keywords needs-refresh removed

#8 @swissspidy
19 months ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to Future Release

@shailu25
7 months ago

Refreshed patch.

#9 @shailu25
7 months ago

  • Keywords needs-refresh removed

#10 @audrasjb
7 months ago

  • Milestone changed from Future Release to 6.6
  • Owner set to audrasjb
  • Status changed from new to reviewing

This ticket was mentioned in PR #6706 on WordPress/wordpress-develop by @shailu25.


6 months ago
#11

Trac Ticket: 50087

#12 @shailu25
6 months ago

Refresh the Patch With Latest Trunk.

PR:6706

Version 0, edited 6 months ago by shailu25 (next)

#14 @audrasjb
6 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

Fixed with [58284].

Note: See TracTickets for help on using tickets.