Hi again everybody!
I’m trying to translate the string “The glass shards slash your 1%s!” to danish, but I have encountered a small technical problem that i require some assistance to solve. The thing is that if 1%s is neuter the translated sentence should be “Din 1%s flænges af glasskårene!”, but if 1%s is common gender the sentence should be “Dit 1%s flænges af glasskårene!”.
Is it possible to change a word based on the gender of a varible, and if so how? If such a system doesn’t exist, how difficult would it be to implement it?
I mean you could try to add gender/quantity context which more accurately reflect different languages and dialects representations, but I imagine by then you’re adding a universal translator to Cataclysm.
For a productive suggestion, look at how gender is implemented and in print statements. That should be stored in a multi-valued variable and might be useful as a template for how to extend it.
You cant put two translated strings for one source string.
So you need to be creative here.
Somewhat related: https://github.com/CleverRaven/Cataclysm-DDA/issues/21861
Unfortunately gettext only does split translations like this on numbers by default.
Adding support to split phrases based on gender of terms is likely possible, but I think its stretching what gettext is capable of, and I’m not sure how much work it would be.
Insert LGBT comment here <—
It seems to be far beyond my abilities to implement a gender system. I guess I just have to be creative.