This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

code200.miha
code200.miha

What is suggested way to translate/override system messages (translations under /modules/system/lang/)?

Thanks, Miha

Eoler
Eoler

code200.miha said: What is suggested way to translate/override system messages (translations under /modules/system/lang/)?

The principle is similar to overriding plugin localizations: https://octobercms.com/docs/plugin/localization#overriding

Copy system (framework) localization files as described here: https://octobercms.com/forum/post/localication-problems-where-to-overwrite-octobercms-lang-settings-in-general

code200.miha
code200.miha

Thank you Eoler so much :) I was searching but was unable to find the answer.

For anyone looking for solution - the links Eoler provided will clarify everything. To sum up:

create /lang/{locale}/system/validation.php

And there you can override anything in lets say system validation.php like this:

return [
    "validation" => [
        "required"         => "SOMETHING LOCAL :attribute field is required.",
    ]
];

Last updated

Eoler
Eoler

code200.miha said: Thank you Eoler so much :) I was searching but was unable to find the answer.

Great! Now I expect you to contact https://github.com/acasar and organize publishing base Laravel 5.1 Slovenian translations and let me reuse it for https://goo.gl/opRjXf ;-)

As a courtesy, I'm preparing Croatian equivalents (if you need to expand to neighboring markets).

code200.miha
code200.miha

How do you translate custom and attributes? This doesnt seem to be working for me in the way proposed ...

p.s. regarding translations ... I dont have any problems sharing what I produce. I doubt I will have time to work on 3rd party extension though :)

code200.miha
code200.miha

How do you translate custom and attributes? This doesnt seem to be working for me in the way proposed ...

p.s. regarding translations ... I dont have any problems sharing what I produce. I doubt I will have time to work on 3rd party extension though :)

Eoler
Eoler

code200.miha said: How do you translate custom and attributes? This doesnt seem to be working for me in the way proposed ...

Custom model attributes?

Model.php :
    public $implement = [
        '@RainLab.Translate.Behaviors.TranslatableModel',
    ];
    public $translatable = ['title', 'description'];
    public $attributeNames = [
        'title'       => 'author.plugin::model.model_name.title',
        'description' => 'author.plugin::model.common.description',
        ...
    ];
lang/<code>/model.php :
return [
    'common' => [
        'description' => 'Description',
    ],
    'model_name' => [
        'title'    => 'Service Title',
    ],
    ...
];

regarding translations ... I dont have any problems sharing what I produce. I doubt I will have time to work on 3rd party extension though :)

Sure, It was written half-jokingly. Maybe Anže already has all needed framework translations...

1-7 of 7

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.