There is a field type named "fire" and a keybinding named "fire".
They should have different name, or in different context.
- OS: Arch Linux
- Game Version: 0.D-12504-g90156182f7
- Graphics version: Tiles
- Ingame language: Chinese (Simplified)
- Mods loaded: [ dda, no_npc_food ]
Is this an issue in the translation? Or is this an issue in comprehension? The keybinding is actually "Fire wielded weapon" so I'm assuming it's the former. If it's the latter, then in English, the context of the two would be enough to prevent any confusion I would imagine. The fields are going to be nouns, and the keybindings should be verbs, unless they relate to opening a menu or some such. The idea of there being a "fire" key that did anything other than firing your weapon would be misleading in this context. You would usually use the term "light" for starting a fire. If I saw a keybinding for "light" I wouldn't consider turning on a torch to be the intended action, either. On the other hand, the notion of there being a field which fires a weapon is very strange.
@Funguss
It's an issue with translation. And the keybinding is "fire", not "Fire wielded weapon".
https://github.com/CleverRaven/Cataclysm-DDA/blob/7ddabba082bac9d22d92d536d313152b3df97c32/data/raw/keybindings.json#L2267-L2273
Aha. It's important to note where, as in this case we're _both_ right. :wink:

As I said above, it's all in the context, and in this instance it happens to be an id. As long as there isn't a conflict there shouldn't be an issue. That said, you could always add a comment if you feel it's not clear enough, though I imagine most people would just be perplexed as to why it needs clarification.
Also, I think you misunderstood me when I said translation, as I meant the translated game files (I notice you're using Chinese language files). From what you've said it seems more like comprehension. Did you personally find it ambiguous in this context? Is it only in this context it's ambiguous, or is it also ambiguous in the keybindings menu in game?
Sorry I didn't make the issue clear at first.
There is no difficulty to understand "fire" in English. But when translating it, I need a context to distinguish its different meanings. Like this:
https://github.com/CleverRaven/Cataclysm-DDA/blob/7ddabba082bac9d22d92d536d313152b3df97c32/data/json/effects.json#L591
https://github.com/CleverRaven/Cataclysm-DDA/blob/7ddabba082bac9d22d92d536d313152b3df97c32/data/json/item_actions.json#L455
Ok! I must admit I have very little language experience, I only know bits and pieces here and there, so it's difficult for me to see where the problem lies. Also, I had various assumptions about how text is translated that I obviously need to get straight in my head. I assumed that all the strings that needed translating were held in a separate series of text files, hence having the ID simply as "fire".
Anywho, for future reference, what I said should hold up in the majority of cases: key bindings relate to verbs as (generally) they'll be a specific action taken by the player. The only situation I can think of where this wouldn't be the case is where menus are bound to a key, though you would describe the action as "opening a menu", so the verb is implied. I've not considered this before, but it does make sense that all input would involve a verb, as verbs are "doing words" and that is precisely what a keypress is. I'm sure there must be some situation where this isn't the case but as a rule of thumb it should suffice in most situations.
As for fields, these are almost certainly going to be nouns, as a field is going to be some form of object. Unless somebody uses them in some kind of hack code that should also stand true, in which case the field itself is likely to be invisible and thus translation should be a moot point.
I'm absolutely _terrible_ when it comes to defining words, so I hope saying fire in the context of a field is a noun, and fire in the context of keybindings is a verb, is enough to make it clear (that being said, in fields fire = flame, and in keybindings fire = to shoot). Hopefully these rules of thumb help you out going forward, too! Regarding the text files, how would you suggest making them clearer?
Need to add context somewhere.
@Funguss
I don't know how to explain it. Take Chinese as example. "fire" can be translate to 火焰(flame) or 射击(to shoot).
Currently in zh_CN.po (.po are generated by scripts):
#: lang/json/field_type_from_json.py lang/json/keybinding_from_json.py
msgid "fire"
msgstr "火焰" # I can only translate once.
I expect it to be:
#: lang/json/field_type_from_json.py
msgctxt "field"
msgid "fire"
msgstr "火焰" # I can translate twice. This is "flame".
#: lang/json/keybinding_from_json.py
msgctxt "keybinding"
msgid "fire"
msgstr "射击" # And this is "to shoot"
Or just rename it(considering that there is already "Fire wielded weapon"):
#: lang/json/field_type_from_json.py
msgid "fire"
msgstr "火焰"
#: lang/json/keybinding_from_json.py
msgid "Fire wielded weapon"
msgstr "用手持武器射击"
The python extraction script need some tweaks to add context. so these strings dont get merged.
Example:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/lang/extract_json_strings.py#L452
Place to fix:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/lang/extract_json_strings.py#L747
and
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/lang/extract_json_strings.py#L1006
However adding context to everything will probably bloat the final string count to some degree.
However adding context to everything will probably bloat the final string count to some degree.
That's why I've made the translation class. We can change the name member of action_attributes and field_intensity_level from std::string to translation so an optional context can be specified in the json files.
Most helpful comment
@Funguss
I don't know how to explain it. Take Chinese as example. "fire" can be translate to 火焰(flame) or 射击(to shoot).
Currently in zh_CN.po (.po are generated by scripts):
I expect it to be:
Or just rename it(considering that there is already "Fire wielded weapon"):