mojira.dev
MC-25207

attribute.modifier.* ignores the order of %s and %d

In the language pack, '%s' seems to be replaced to string, and '%d' will be decimal value like printf().

I want to change word order in the attribute of some tools. In English, a stone shovel will be: '+2 Attack Damage'.
In order to translate in Japanese, I changed from:

attribute.modifier.plus.0=+%d %s
attribute.modifier.plus.1=+%d%% %s
attribute.modifier.plus.2=+%d%% %s
attribute.modifier.take.0=-%d %s
attribute.modifier.take.1=-%d%% %s
attribute.modifier.take.2=-%d%% %s

To:

attribute.modifier.plus.0=%s +%d
attribute.modifier.plus.1=%s +%d%%
attribute.modifier.plus.2=%s +%d%%
attribute.modifier.take.0=%s -%d
attribute.modifier.take.1=%s -%d%%
attribute.modifier.take.2=%s -%d%%

Results: '2 +与ダメージ' (2 +Attack Damage).
This should be '与ダメージ +2'(Attack Damage +2).

Attachments

Comments 3

Hmm... I was going to say that it probably wasn't possible, because it is just formatting codes (like printf()), but then I looked at the language files, and there are numbers in the codes to specify order. So you need to write:

attribute.modifier.plus.0=%2$s +%1$d
attribute.modifier.plus.1=%2$s +%1$d%%
attribute.modifier.plus.2=%2$s +%1$d%%
attribute.modifier.take.0=%2$s -%1$d
attribute.modifier.take.1=%2$s -%1$d%%
attribute.modifier.take.2=%2$s -%1$d%%

At least, that's how it works for the other strings. No guarantee that it works for attributes, but no reason why it wouldn't either.

Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

No answer, assuming no longer an issue.
Changed the translations at crowdin.net as suggested.

ANBO Motohiko

(Unassigned)

Unconfirmed

Minecraft 1.6.2

Retrieved