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

Vojta Svoboda
Vojta Svoboda

Same as for other lang files: /lang/cs/rainlab/user/validation.php

pikusfikus
pikusfikus

Vojta Svoboda said:

Same as for other lang files: /lang/cs/rainlab/user/validation.php

It doesn't work. I want to implement this functionality: http://laravel.com/docs/5.0/validation#custom-error-messages.

Specifying Custom Messages In Language Files

In some cases, you may wish to specify your custom messages in a language file instead of passing them directly to the Validator. To do so, add your messages to custom array in the resources/lang/xx/validation.php language file.

How could I do it with OctoberCMS?

Vojta Svoboda
Vojta Svoboda

What concrete error message you want to translate? You can't just /resources/lang/xx/validation.php. You always should provide plugin or module name.

EngBadr
EngBadr

Hello , I follow these steps to localize the following modules:

modules
\backend\lang
\cms\lang
\system\lang

by these steps copy the following directories. and rename them to my prefred language Arabic for example will use (ar-sa)

modules
\backend\lang\en
\cms\lang\en
\system\lang\en

i.e

modules
\backend\lang\ar-sa
\cms\lang\ar-sa
\system\lang\ar-sa

translate every thing in the files

modules
\backend\lang\ar-sa\lang.php
\cms\lang\ar-sa\lang.php
\system\lang\ar-sa\lang.php
\system\lang\ar-sa\client.php
\system\lang\ar-sa\validation.php

in each file inside modules\system\lang\ar-sa\lang.php I added the language value to the array i.e 'locale' => [ 'ar-sa' => 'Saudi Arabia - Ar',

so I added this value to all files inside modules\system\lang{local}

Finally inside modules\backend\models\BackendPreferences.php

Then I added the value of ar-sa
'ar-sa' => [Lang::get('system::lang.locale.ar-sa'), 'flag-sa'],

Now it working fine but

My Questions are

Is this the right method to loclize the three modules?
Is this will not effected by future update?

Last updated

Vojta Svoboda
Vojta Svoboda

Yes it will works but after first update all changes will be lost. But you can copy these files to origin repository and send pull request - changes will become part of OctoberCMS, so you will download it with future update.

For topic how to translate lang files with future updates compatibility see http://octobercms.com/forum/post/localication-problems-where-to-overwrite-octobercms-lang-settings-in-general

Last updated

21-25 of 25

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