Localization / Translation issue with version 3.1.20

Hello,

After I updated my OctoberCMS installation to version 3.1.20 my template back-end translations aren’t shown anymore. Furthermore, I’m a bit confused about which translation file should be used for which purpose.

Current Solution

The template is and should stay compatible with OctoberCMS v2 and v3. I figured out, that the following solution worked for both versions (with and without the RainLab.Translate plugin) … until now.

files
 

  1. config/lang.yaml

Contains all front-end translations for all languages (in my case english and german). The file is linked within the main theme.yaml file using translate: config/lang.yaml. As far as I remember, this solution is used by RainLab.Translate (at least in v1+). Example:

en:
    page.404.title: "Error 404"
de:
    page.404.title: "Fehler 404"

 

  1. lang/[locale].json

Contains all front-end translation strings as single-nested key → value paired object. I guess this solution is used on October CMS installations without RainLab.Translate installed. Example:

{
    "page.404.title": "Error 404"
}

 

  1. lang/[locale]/lang.php

Contains all back-end translation strings as single-nested array-key pairs, worked so far in OC v2 and OC v3 … until now. Example:

<?php

return [
    "option.sections.brand" => "Brand Settings"
];

Current Issue

I didn’t changed anything on the above described translation structure, I just updated to version 3.1.20, which broke all back-end translations. I tried to add a deeply nested solution on file 3. (‘option’ => [ ‘sections’ => [ ‘brand’ => ‘…’ ] ]) and also tried to add the translation string (nested and unnested) on the other both files, but I still receive theme.newshub::lang.option.sections.brand, even after clearing the cache.

  1. Is the above described file structure right and valid?
  2. Where are my translated strings, what did I do wrong?

Thanks.

Sincerely,
Sam.

Fixed it by upgrading RainLab.Translate to v2, still curious why it doesn’t work with v1.x anymore.

Thanks for reporting back. We’re unsure why this would be a problem in v1 Translate either.

You can put translations in many places

app/lang
theme/*/lang
plugins/*/*/lang

One difference is the lang directory moved to app/lang, that could be related.