Adding translations

Adding translations
0

You can use the Multilingual Plugin to add translations to your Discourse. You can currently add three types of translations:

  • Interface
  • Category name
  • Tag

You can see examples of each type of translation here: Pavilion - Building online communities. Open the link in an incognito window and select “Warlpiri” (for the language of the Warlpiri people).

To add any translation you first have to have an entry for the language of the translations in your Languages list. If there is not currently a language in that list for your translation, you can add one: Adding a custom language.

File format

All translations need to be uploaded as a .yml file. The format depends on the type of translation you’re uploading

Interface (“locales”)

Interface translations follow the same format as locale files in Discourse:

client.<code>.yml

<code>:
   js:
     ...keys:

   admin_js: #(optional)
     ...keys:

   wizard_js: #(optional)
     ...keys:

server.<code>.yml

<code>:
  ...keys:

In example screenshot (above)

client.wbp.yml

wbp:
  js:
    filters:
      categories:
        title: "karlirr-kari"
      
      latest:
        title: "mintirlpari"
      
      unread:
        title: "waji-nyanyi"
        
    topic:
      create: "yirrarni"

Category name

Category name translations use category slugs as keys, using key nesting to represent parent-child relationships, e.g.

category_name.<code>.yml

slug: translated name
parent_slug:
   slug: translated child name

If you want to translate both parents and children in a parent-child category hierarchy, use _ as the key for the parent translation, i.e.

slug: translated name
parent_slug:
   _: translated parent name
   slug: translated child name

In example screenshot (above)

category_name.wbp.yml

welcome: pardu-pardu-mani
clients: kalyardi
knowledge:
  _: milya-pinyi
  clients: kalyardi milya-pinyi

Tag

tag.<code>.yml

tag: translated tag

In example screenshot (above)

tag.wbp.yml

pavilion: parnka
follow: ngurra
2 Likes

Any idea what is wrong with my yaml syntax here? The parent is being translated but not the children

image-critiques:
  _: Críticas - Imagens
  avian-critiques: Críticas - Aves
  flora-critiques: Críticas - Flora
  human-fauna-critiques: Críticas - Humanos e Fauna
  landscpae-critiques: Críticas - Paisagem
  macro-critiques: Críticas - Macro
  non-nature-critiques: Críticas - Não Natureza
  wildlife-critiques: Críticas - Vida Selvagem
  weekly-challenge: Desafio semanal

I suspect the issue is that you need to use quotes for the translations

image-critiques:
  _: "Críticas - Imagens"
  avian-critiques: "Críticas - Aves"
  ...

However, there’s a bigger issue with translations. They’re not persisting between updates to the forum. I’ll need to fix that first then come back to this.

Thanks, but that did not work either. No rush on this!