Extend plugin languages


Trying to extend a plugin languages. Wouldn’t want to edit languages.yaml in a plugin folder directly. Any instrunctions how do I do that?


@Karmalakas, To add an extra translation for a plugin, you can do the following. Also see the docs about Translation Overrides.

Let’s add 'Italian to the plugin:

  • Lookup the string from the plugin you want to override. Eg from plugin ‘Test’ look in file user/plugins/test/languages.yaml:
        TEXT_VARIABLE: Text Variable
        TEXT_VARIABLE_HELP: Text to add to the top of a page
  • Create file user/languages/it.yaml
  • Copy the following into the new file:
      TEXT_VARIABLE: <Translation in Italian>
      TEXT_VARIABLE_HELP: <Translation in Italian>
  • Add language it to user/config/system.yaml:
      supported: [en, it]
  • If plugin Test has the snippet {{ 'PLUGIN_TEST.TEXT_VARIABLE' | t }} in a template , it will be translated into Italian when you browse to the Italian version of the page.
1 Like

OK, so this works for front-end, but not Admin. I translated Login plugin to LT. Everything is in user/languages/lt.yaml

  USERNAME: "Vartotojo vardas"
  EMAIL: "El. paštas"
  USERNAME_EMAIL: "Vartotojo vardas/El. paštas"

I also went to my profile (top left of Admin) and changed the language, but still can’t see any changes. And actually none of Admin strings are translated - whole Admin is still in English. What am I missing?

It seems I just had to re-login to Admin