Tinkers Construct

Tinkers Construct

160M Downloads

[Suggestion] Increase the possibility of translating tool name

koh-gh opened this issue · 14 comments

commented

Minecraft Version

1.18.1

Forge Version

39.0.76

Mantle Version

1.8.31

Tinkers' Construct Version

3.4.1.46

Problem description

(1) Currently, if the language file does not have a format entry for the material, the tool default name will be determined by the following rules:

Material Name + " " + Tool Name

This is a reasonable format for alphabetic languages, but it looks undesirable for non-alphabetic languages.

Example:
The name of a pickaxe made of iron would be "Iron Pickaxe" in English. Currently, only the material and the tool name are translatable, so translating both would results "鉄 ツルハシ" in Japanese. However, the preferred translation in Japanese is "鉄のツルハシ".

(2) Also, tool default name that are created with multiple materials are constructed by adding "-" between the materials. For example, a mattock made of iron and copper is described as "鉄-銅 マトック" in Japanese, but it is preferable to describe it as "鉄と銅のマトック".

The former can be solved by adding a format entry for all materials, but I don't think that's a smart way to do it.

Suggested solution

(1) Make the space between materials and tools translatable. For example, "item.tconstruct.tool_space".

For English, set "item.tconstruct.tool_space":" "
For Japanese, set "item.tconstruct.tool_space": "の".

(2) Make the combiner that joins multiple materials translatable. For example, "item.tconstruct.tool_combiner".

For English, set "item.tconstruct.tool_combiner":"-".
For Japanese, set "item.tconstruct.tool_combiner": "と".

I believe that these modifications are also effective for Chinese and maybe other languages.
Of course, I would like you to keep the specification that only allows us to change the name of a tool of a specific material in the format entry.

Alternatives considered

I created a PR in 1.16 to solve this problem by adding format entries to all materials, but since I thought there would be even more new materials in 1.18, and (2) could not be solved in this way, I came up with the above solution.

Additional context

Screenshot about (1)
2022-02-15_14 20 22
I'm currently using a language file with added format to most of the material, so I'm showing a stone variant of the pickaxe.

Screenshot about (2)
2022-02-15_14 20 34

Confirm the following

  • Confirm you have checked the roadmap, what's new, and the FAQ for your issue
commented

The problem with this solution is there are a lot of places where we form tooltips by concatenating with spaces. Is it true you can always replace the space with and dash with for english to japanese? If so this is not hard to do, but if not we would need to consider a more complex solution.

What about places we write things like Harvest Level: and then a number? Is that also supposed to use ? Going to need a bit more information on this topic across all of Tinkers' Construct rather than just tool names.

commented

This suggestion is only for the way the names of tools are constructed. I understand that the pattern of tool/toolpart names can be one of the following:

  • Material + " " + tool/toolpart name
  • Material1 + "-" + Material2 + " " tool name
    (The same applies if there are three or more materials)

All spaces and dashes that appear in these two patterns can be replaced with the same characters (in this case, and ). I believe this will work well for Chinese and other languages.

It should not be applied to anything else. The Harvest Level: part of the example does not need to be changed.

I understand from looking at the source files that the modifications are limited and easy to fix. You probably only need to fix the following two source files.

  • TooptipUtil.java
  • MaterialItem.java

Strictly speaking, it might be better to be able to replace other spaces, dashes, and etc. as well, but I didn't care much about the others in my play. The default names of tools are the ones we see the most when playing Tinkers' Construct, so I think it's better to make them natural through translation.

commented

Basically just deciding how generic this needs to be. Most likely, you will get a translatable string format.tconstruct.space or something similar, generic because it lets me use it in many places in the future. Plus, if there was another spot you remembered, I could add it to there while making the change.

commented

I think the scope of this application should be limited only to the case of combining tool names and materials. For example, item frame, shuriken, and platform create separate translations now , but if you generate them dynamically, format.tconstruct.space can be applied. It would be nice to be able to translate other spaces as well, but that translation may not be . Because there are several Japanese postpositional particles(, , etc.), which are used according to the context. Japanese is very difficult. Sorry.

commented

Sorry for no response on this for awhile, I did not want to handle this half-heartedly.

I mentioned above that I am not satisfied with a solution that only works for tool names, as we have a lot of places that need similar separators.

The one that comes up most frequently is the tooltips of modifiers, e.g. the +X Conducting Power from the conducting modifier. How would you translate strings like that? If that uses regular spaces, what makes the spaces in tool names different?

As another example, we dash separate names of tools when you have multiple, should that dash also be a different character?

commented

As a side note, "in this case", if it is translated by the same rule(show +Xのconducting power), it will be understood in Japanese. However, this may not always be the case.

commented

Thanks for your reply.

The space connecting the material name and the tool means "made from". As already mentioned above, if space is meant to be "made from", then this proposal is equally applicable, but it should not be applied to other meanings of space.

The spece of +X conducting power indicates the degree of conducting power (like "strong" or "weak"). Since the meaning is different as mentioned above, I intend to suggest only the name of the tool this time.

The reason for this suggestion is that tool names are the most commonly produced words in TiC, and we believe that they are likely to become attached to them.

The dash that connects multiple materials means "and". If the item were made of multiple materials and TiC used dash, I would think the other suggestion() would work, but I don't think there is currently such a thing.

commented

I added two translation keys for this:

"item.tconstruct.tool.format": "%s %s": lets you change not only the separator (e.g. "%sの%s") but also the ordering for tool names (e.g. "%2$s %1$s"). I suspect Japanese is the same order as english but some other language may want a different ordering.
"item.tconstruct.tool.material_separator": "-" is just like requested

commented

I think it's a great improvement. This improvement will not only increase the translatability of tool names, but it can also be expected that the tool names added by addons will be somewhat appropriate even if they do not have translations.

As soon as the development build is updated, I'll try to create translations and see the results.

commented

Yes. I think item.tconstruct.tool.format can be applied both tool name and tool parts name.

commented

Thank you for your quick response.
These are screenshots on 3.6.0.73.
2022-12-28_12 08 25
2022-12-28_12 08 36
2022-12-28_12 10 21

The tool names are nicely displayed. However, tool parts names are still space-separated.

Could you apply the same rules to the names of the tool parts as the tool names? (The space in the names of tool parts is also "made from", and I think the same rules as for tool names can be applied.)

commented

Sure, I will look into that in the future. I suspect the existing format string will work?

commented

Tool parts use that format string in 3.6.1.85

commented

2023-01-19_17 25 54
It seems to work good. I've checked other toolparts and they look good. Very grateful for the update.