# Can a word be changed based on the gender of a variable?

**URL:** https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485
**Category:** Translations Team Discussion
**Created:** [September 6, 2018, 6:04am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485 "2018-09-06T06:04:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Nylander](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@Nylander](https://discourse.cataclysmdda.org/u/Nylander)
#### Post date: [September 6, 2018, 6:04am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/1 "2018-09-06T06:04:50Z")

</div>

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 “Di **n** 1%s flænges af glasskårene!”, but if 1%s is common gender the sentence should be “Di **t** 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?

---

<div class="post-metadata">

### Author: ![pingpong](https://avatars.discourse-cdn.com/v4/letter/p/4bbf92/32.png) [@pingpong](https://discourse.cataclysmdda.org/u/pingpong)
#### Post date: [September 6, 2018, 8:02am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/2 "2018-09-06T08:02:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![cainiao](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@cainiao](https://discourse.cataclysmdda.org/u/cainiao)
#### Post date: [September 6, 2018, 11:15am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/3 "2018-09-06T11:15:33Z")

</div>

You cant put two translated strings for one source string.  
So you need to be creative here.

---

<div class="post-metadata">

### Author: ![cainiao](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@cainiao](https://discourse.cataclysmdda.org/u/cainiao)
#### Post date: [September 6, 2018, 11:18am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/4 "2018-09-06T11:18:22Z")

</div>

Somewhat related: [https://github.com/CleverRaven/Cataclysm-DDA/issues/21861](https://github.com/CleverRaven/Cataclysm-DDA/issues/21861)

---

<div class="post-metadata">

### Author: ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)
#### Post date: [September 7, 2018, 3:11am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/5 "2018-09-07T03:11:56Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ecchi\_squid](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/ecchi_squid/32/6386_2.png) [@ecchi\_squid](https://discourse.cataclysmdda.org/u/ecchi_squid)
#### Post date: [September 7, 2018, 4:34am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/6 "2018-09-07T04:34:54Z")

</div>

Insert LGBT comment here \<—

---

<div class="post-metadata">

### Author: ![Nylander](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@Nylander](https://discourse.cataclysmdda.org/u/Nylander)
#### Post date: [September 10, 2018, 9:34am UTC](https://discourse.cataclysmdda.org/t/can-a-word-be-changed-based-on-the-gender-of-a-variable/16485/7 "2018-09-10T09:34:50Z")

</div>

It seems to be far beyond my abilities to implement a gender system. I guess I just have to be creative.
