# Convention localization?

**URL:** <https://farmos.discourse.group/t/convention-localization/1525>\
**Category:** Conventions\
**Created:** [February 10, 2023, 2:01pm UTC](https://farmos.discourse.group/t/convention-localization/1525 "2023-02-10T14:01:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [February 10, 2023, 2:01pm UTC](https://farmos.discourse.group/t/convention-localization/1525/1 "2023-02-10T14:01:57Z")

</div>

@Symbioquine raised an important question in his review of the [Pasture Condition Score](https://farmos.discourse.group/t/pasture-condition-scores/1520) convention proposal:

> [@Pasture Condition Scores (NRCS:pasture-condition-score:1.0)](https://farmos.discourse.group/t/pasture-condition-scores-nrcs1-0/1520/2):
>
> How is this supposed to work with localization? I notice your quick form implementation wraps the indicator titles in `$this->t()`, but the convention specification doesn’t say anything about translated indicator quantity labels being permissible.

In that specific case, the convention dictates that an observation log should be created with a set of quantities that have specific labels (in English). That’s just one example where localization/translation considerations will come up in conventions…

How should language translations / localization be handled more generally in conventions? Let’s use this thread to discuss.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [February 10, 2023, 2:08pm UTC](https://farmos.discourse.group/t/convention-localization/1525/2 "2023-02-10T14:08:13Z")

</div>

@Farmer-Ed hinted at the idea of “regional” convention IDs [in the original thread](https://farmos.discourse.group/t/documenting-conventions/1263/4):

> [@Documenting conventions](https://farmos.discourse.group/t/documenting-conventions/1263/4):
>
> Lots of possibilities from referencing enterprise type (fruit/veg/beef/dairy/poultry etc) to region (EU/US/IRL etc) or a specific QA scheme.

Should convention IDs include a language code? eg: `NRCS:pasture-condition-score-en:1.0`?

Or, maybe some conventions will implicitly assume the language they are written in?

This question of localization is only a consideration where a convention requires you to enter specific strings. Quantity labels and units will probably be the most common places where this comes up…

---

<div class="post-metadata">

**Author:** ![Symbioquine](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/symbioquine/32/284_2.png) [@Symbioquine](https://farmos.discourse.group/u/Symbioquine)\
**Post date:** [February 10, 2023, 2:49pm UTC](https://farmos.discourse.group/t/convention-localization/1525/3 "2023-02-10T14:49:02Z")

</div>

Regional ones make sense to me, but language-specific ones seem a bit more fraught.

In the pasture condition score example, it seems like the ideal case would be to capture the scores with some machine-readable identifier, then allow for the possibility of displaying translated versions of the labels in human-facing contexts. That way the data between farms operating in different languages is still easily comparable and able to be part of the same larger datasets.

That said, I could also see an argument for translations of the conventions themselves to exist. They wouldn’t be separate conventions though, just a different description of the _ **same** _ convention. Similar to how we’ve talked about translating the conventions into machine-readable formats as well.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [February 10, 2023, 3:08pm UTC](https://farmos.discourse.group/t/convention-localization/1525/4 "2023-02-10T15:08:40Z")

</div>

> [@Symbioquine](#):
>
> it seems like the ideal case would be to capture the scores with some machine-readable identifier

Yea that might be the best approach. The only downside to that right now is that there isn’t a mechanism in place for translating quantity labels into a human-readable format. So it would always show the machine-readable ID in the UI currently.

> [@Symbioquine](#):
>
> That said, I could also see an argument for translations of the conventions themselves to exist. They wouldn’t be separate conventions though, just a different description of the _ **same** _ convention. Similar to how we’ve talked about translating the conventions into machine-readable formats as well.

Agreed! This will definitely be necessary. It would be worth figuring out a strategy for this in the proposals currently developing in [GitHub - mstenta/farmOS-conventions](https://github.com/mstenta/farmOS-conventions)
