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

13729214351308
13729214351308

Hi, Octo team, How to do localization job for the octorbercms? We'd like to translate all the skin into other language, but i do not know where to go, please give a guideline.

Thanks~!

xgenvn
xgenvn

If you want to translate October CMS backend interface, I think you have to translate the Lang definition under each module first. I'm gonna do it for my main language too.

Shahiem
Shahiem

You can make a translation directory for your language.

Path: CMS\modules\backend\lang

brunomagconcept
brunomagconcept

Hi,

I have made another directory in CMS\modules\backend\lang\ro\lang.php and have translated the \en\lang.php file. But nothing appears in the backend, although I logged off and relogged in.

What else do I need to do in order for OctoberCMS to see this newly added language?

Thanks!

brunomagconcept
brunomagconcept

Hi,

I've managed to find out.

For anyone interested, you have to add a line in modules/backend/models/BackendPreferences.php in the $locales array. Then another in modules/system/lang/en.php - > in the 'locale' key, and you need to add a different lang file in each directory, as you only get a partial translation if you only translate modules/backend/lang/.

Cheers ! :)

pikusfikus
pikusfikus

Hi, after I change or add any file in folder modules/ all of changes dissapear after composer update. How to add new language to backend without this problem?

Vojta Svoboda
Vojta Svoboda

You have to move lang files here: /app/lang/backend/cs/lang.php or /app/lang/backend/cs/validation.php (where cs is language code, and backend is namespace). Namespace can be: backend, system or cms. It overrides default translation. See documentation http://octobercms.com/docs/plugin/localization

Last updated

pikusfikus
pikusfikus

Hi, thank you for your reply! But, unfortunately, I couldn't get it worked. It works for plugins like it is written in documentation, but doesn't work for modules (backend, cms, system). I've just added these files, maybe, should I do soemthing more?

Kind regards

Vojta Svoboda
Vojta Svoboda

It works fine, I try it now. Just make copy of these files: /modules/backend/lang/en.php -> /app/lang/backend/cs/lang.php /modules/cms/lang/en.php -> /app/lang/cms/cs/lang.php Then make some translations and set locale in /app/config/app.php set 'locale! => 'cs' and that is it.

pikusfikus
pikusfikus

Great! Now it works. Thank you very much! Have a nice day!

Journalt
Journalt

I have a problem with the pagination translation, I am using the simplePaginate() function, which returns "next" and "previous" links in Laravel, but in OctoberCMS, it displays "pagination.next" and "pagination.previous".

I tried the solutions above but none work for the frontend. Also I tried to create a file "pagination.php" in the "modules/cms/lang/en/" folder but it doesn't work either.

I think there's a bug with Laravel ? I have no idea how to solve this.

pikusfikus
pikusfikus

@Vojta Hi, I have one question more. Could do you tell me how can I translate backend view "backend::mail.restore". And also I woudl like to know how to tranlate a validation file, because your approach doesn't work for validation translation (separated file named "validation.php" in "/app/lang/system/pl/validation.php I have no idea how do to this without changing system files. Thank you in advance, and kind regards.

Last updated

Vojta Svoboda
Vojta Svoboda

@pikusfikus Yes, it doesn't work, because October uses Laravel validation. So you should override Laravel validation translation, and not October translation.

Just create file /app/lang/<locale>/validation.php. You can copy it from validation.php file located in /modules/system/lang/en/validation.php and override it ;-)

Last updated

pikusfikus
pikusfikus

@Vojta Great! Thank you very much for your reply. It was very helpful :)

Renatio
Renatio

Anybody knows how to override validation.php in current build?

@Vojta solution is not working for me.

Edit: Ok, now You must use: /lang/{locale}/system/validation.php

Last updated

Vojta Svoboda
Vojta Svoboda

It was solution for Laravel 4 version. Now you should use /resource/ folder like this:

https://github.com/laravel/lumen/tree/master/resources/lang/en

Last updated

webBook
webBook

Vojta Svoboda said:

It works fine, I try it now. Just make copy of these files: /modules/backend/lang/en.php -> /app/lang/backend/cs/lang.php /modules/cms/lang/en.php -> /app/lang/cms/cs/lang.php Then make some translations and set locale in /app/config/app.php set 'locale! => 'cs' and that is it.

Ahoj Vojto, mas prelozenou administraci do cestiny? Docela by se mi sikla... info@webbook.cz Dik.

pikusfikus
pikusfikus

Vojta Svoboda said:

It was solution for Laravel 4 version. Now you should use /resource/ folder like this:

https://github.com/laravel/lumen/tree/master/resources/lang/en

Hi, I tried this solution and it also doesn't work. I also tried both solution for Laravel 4 and Laravel 5 with resources. Did you try it?

Vojta Svoboda
Vojta Svoboda

Right folder is:

/lang/cs/rainlab/user/lang.php

where 'cs' is locale, 'rainlab' is vendor name, 'user' is plugin name and lang.php is file which should be overwritted.

Sorry for previous bad informations.

pikusfikus
pikusfikus

Vojta Svoboda said:

Right folder is:

/lang/cs/rainlab/user/lang.php

where 'cs' is locale, 'rainlab' is vendor name, 'user' is plugin name and lang.php is file which should be overwritted.

Sorry for previous bad informations.

Thank you for your reply. And what location should be used for validation.php?

1-20 of 25

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