#30694 closed defect (bug) (fixed)
Missing localization for image toolbar
Reported by: | pavelevap | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | I18N | Keywords: | has-patch commit fixed-major |
Focuses: | Cc: |
Description
I am not sure, but localization did not work for me for edit and remove buttons. See attached patch...
We can use existing strings, so no problems for translators. Also there is no need for context, I guess...
Attachments (1)
Change History (17)
#3
@
10 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 30835:
#5
follow-up:
↓ 6
@
10 years ago
Yes, I know about previous "Edit" string, but this was in different context. For TinyMCE menu it has meaning "noun" in our language. In Image toolbar it has meaning of action (verb). So, I suggested to use other current string "Edit" (without context) which is available. Using the same string for TinyMCE menu and action for editing image is not good...
So we have to rename the whole variable to enable context for this string?
#6
in reply to:
↑ 5
@
10 years ago
Replying to pavelevap:
So we have to rename the whole variable to enable context for this string?
Yes. TinyMCE uses simple JS object for translations. The English strings are keys, the translated strings -- values. If there are two identical keys, the second will overwrite the first.
Don't see a straightforward way to fix this. Perhaps we can change the tooltip to "Edit image". Would be better to keep it at "Edit" so we can eventually use it for the wpViews mini-toolbar too.
#7
@
10 years ago
This will (most likely) be fixed upstream. For now we can use a space to add another Edit
string. Spaces are "meaningless" in HTML so this is 100% backwards compatible.
#9
follow-up:
↓ 11
@
10 years ago
With all of the localization strings in this section of the code using PHP comments to define the string more clearly, wouldn't this be an indicator that the _x
function should be used instead of the standard __
function?
#10
@
10 years ago
I do not think that context is needed here, because "Edit" is used as simple verb in other cases. And I also did not want to create new string before release...
#11
in reply to:
↑ 9
;
follow-up:
↓ 12
@
10 years ago
Replying to cais:
With all of the localization strings in this section of the code using PHP comments to define the string more clearly, wouldn't this be an indicator that the
_x
function should be used instead of the standard__
function?
_x()
is meant to distinguish the same string used in different contexts. It should not be used as a replacement for translator comments or PHP comments.
#12
in reply to:
↑ 11
@
10 years ago
Replying to SergeyBiryukov:
Thanks for the clarification ... that function's use was a little fuzzy to me in this case. My thinking was, if you are adding PHP comments to describe the string to begin with why not add the extra character or two and make it the context
parameter.
The
Remove
string is not in there butEdit
is just few lines above. It's used in the TinyMCE menubar. To enable it for testing, comment out'menubar' => false,
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-editor.php#L653