Opened 15 years ago
Closed 15 years ago
#19090 closed defect (bug) (fixed)
Write strings in numbered argument conversion specifications form for better understanding
| Reported by: | jiehanzheng | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | I18N | Version: | 3.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
15 years ago
- Component Users → I18N
- Keywords has-patch added
- Milestone Awaiting Review → 3.3
- Severity major → normal
#2
follow-ups:
↓ 3
↓ 4
@
15 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
@
15 years ago
- Severity normal → trivial
- Summary Write strings in numbered argument conversion specifications form for translating → Write strings in numbered argument conversion specifications form for better understanding
- Type defect (bug) → 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
@
15 years ago
- Owner set to
- Severity trivial → normal
- Status new → accepted
- Type enhancement → 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
@
15 years ago
Almost related to [15522].
Also the patch above is missing translators notes/comments
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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