Opened 14 years ago
Closed 13 years ago
#19090 closed defect (bug) (fixed)
Write strings in numbered argument conversion specifications form for better understanding
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
Strings should be written in numbered argument conversion specifications from so that they can be translated into other languages like Chinese without sounding weird.
For example, we've got this string here http://core.trac.wordpress.org/browser/trunk/wp-admin/user-new.php#L75
$message = __("Hi,\n\nYou have been invited to join '%s' at\n%s with the role of %s.\nPlease click the following link to confirm the invite:\n%s\n");
The placeholders are all unnumbered, so I am unable to rearrange the arguments to make them sound better. Chinese translation requires get_option('blogname') to be the first, $_REQUEST[ 'role' ] as the second, then site_url(), and site_url("/newbloguser/$newuser_key/") as the last, which cannot be fulfilled with the current string.
Attachments (2)
Change History (9)
#1
@
14 years ago
- Component changed from Users to I18N
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.3
- Severity changed from major to normal
#2
follow-ups:
↓ 3
↓ 4
@
14 years ago
Surely the translation can just specify the placeholder/argument ordering as part of the translated string itself without the original string having to change?
If there's some reason this cannot be done I would've thought that most strings should specify ordering and that there would be a lot more instances of troublesome strings than just this one.
#3
in reply to:
↑ 2
@
14 years ago
- Severity changed from normal to trivial
- Summary changed from Write strings in numbered argument conversion specifications form for translating to Write strings in numbered argument conversion specifications form for better understanding
- Type changed from defect (bug) to enhancement
Replying to duck_:
Surely the translation can just specify the placeholder/argument ordering as part of the translated string itself without the original string having to change?
If there's some reason this cannot be done I would've thought that most strings should specify ordering and that there would be a lot more instances of troublesome strings than just this one.
It's a very reasonable point which I didn't think of... :(
I am changing the ticket properties now.
#4
in reply to:
↑ 2
@
14 years ago
- Owner set to westi
- Severity changed from trivial to normal
- Status changed from new to accepted
- Type changed from enhancement to defect (bug)
Replying to duck_:
Surely the translation can just specify the placeholder/argument ordering as part of the translated string itself without the original string having to change?
If there's some reason this cannot be done I would've thought that most strings should specify ordering and that there would be a lot more instances of troublesome strings than just this one.
We should make it as easy as possible for translators to do the translations. Part of this is using numbered placeholders where appropriate so as to make the translation process faster.
#5
follow-up:
↓ 6
@
13 years ago
Almost related to [15522].
Also the patch above is missing translators notes/comments
19090.patch makes the string more consistent with the one in
admin_created_user_email()
:http://core.trac.wordpress.org/browser/trunk/wp-admin/user-new.php#L22