# Dev guideslines for making translation easier

**URL:** https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104
**Category:** Translations
**Created:** [March 29, 2018, 6:01am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104 "2018-03-29T06:01:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Benjol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjol/32/3907_2.png) [@Benjol](https://meta.discourse.org/u/Benjol)
#### Post date: [March 29, 2018, 6:01am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104/1 "2018-03-29T06:01:11Z")

</div>

I’m aware of topics and guidelines for translators, but are there guidelines anywhere for devs so that they can make translation easier?

If not, I have a few ideas 🙂

- Avoid ‘walls of text’. `tos_topic.body` is totally unwieldy, for example. And that’s if you just have to translate it the once. But every time there is a modification, you have to scroll up/down to find the differences.
- Try to avoid ambiguity (i.e. does “User Modified” mean “modified by the user” or “the user has been modified”?). You don’t necessarily need to make the distinction in the text, using the key to disambiguate is a good idea too.
- Don’t hard code a language-specific url inside a no-translate tag (at this time `site_settings.discourse_chronos_default_timezones` has a link to an EN WikiPedia page embedded in a no-translate tag)
- Don’t forget that you should use the alternate translations for texts involving counts of 1 and n.

(Feel free to add other ideas)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [March 29, 2018, 9:48am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104/2 "2018-03-29T09:48:56Z")

</div>

> [@Benjol](#):
>
> Avoid ‘walls of text’. `tos_topic.body` is totally unwieldy, for example. And that’s if you just have to translate it the once. But every time there is a modification, you have to scroll up/down to find the differences.

As a translator I feel your pain. Fortunately there are only a handful of very long texts. There is already a topic where we discussed possible solutions: [https://meta.discourse.org/t/maintaining-huge-translated-strings-in-transifex/27413](https://meta.discourse.org/t/maintaining-huge-translated-strings-in-transifex/27413)

> [@Benjol](#):
>
> Try to avoid ambiguity (i.e. does “User Modified” mean “modified by the user” or “the user has been modified”?). You don’t necessarily need to make the distinction in the text, using the key to disambiguate is a good idea too.

As an alternative, it’s also possible to add comments within the YAML files. They show up in Transifex.

> <https://github.com/discourse/discourse/blob/main/config/locales/client.en.yml#L19-L24>

---

<div class="post-metadata">

### Author: ![Benjol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjol/32/3907_2.png) [@Benjol](https://meta.discourse.org/u/Benjol)
#### Post date: [June 11, 2019, 5:46am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104/3 "2019-06-11T05:46:53Z")

</div>

Be careful about splitting nouns and their adjectives into separate strings. It seems practical in English:

```
{count} tags
{count} topics
{count} users
deleted
updated
selected

```

But this creates problems in languages where you have to accord the adjective with the count (and gender) of the noun.

(An equivalent example in English would be if you were to split the `{count}` from the `tags` - you wouldn’t know whether to write `tags` or `tag`.)

---

<div class="post-metadata">

### Author: ![Benjol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjol/32/3907_2.png) [@Benjol](https://meta.discourse.org/u/Benjol)
#### Post date: [June 11, 2019, 6:10am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104/4 "2019-06-11T06:10:06Z")

</div>

**Try to avoid creating duplicate texts.** I know it’s a bother when you’re in the zone to have to break out and go and see if it already exists, but your effort has leverage because it reduces the work required for the N language translators down the line.

Alternatively, consolidation could be considered a separate dev task, but the earlier it is done the better, because once it gets onto Transifex, the translators will be on it.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [June 11, 2019, 8:13am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104/5 "2019-06-11T08:13:56Z")

</div>

> [@Benjol](#):
>
> Try to avoid creating duplicate texts.

That’s actually bad advice in most cases. We try to avoid reusing texts whenever something could have a different meaning based on context or simply might need a different translation because there is less room for text in the UI.

We did enable translation autofill on Transifex a couple of months ago which will automatically fill new and changed texts with existing translation for the same phrase and makes this a lot easier for translators.

---

<div class="post-metadata">

### Author: ![Benjol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjol/32/3907_2.png) [@Benjol](https://meta.discourse.org/u/Benjol)
#### Post date: [June 11, 2019, 8:30am UTC](https://meta.discourse.org/t/dev-guideslines-for-making-translation-easier/84104/6 "2019-06-11T08:30:40Z")

</div>

OK. Point taken. It’s still a problem when there are minor variations on a theme.
