-
Notifications
You must be signed in to change notification settings - Fork 154
Creating new language module
By default UNA supports English and Russian languages. If you want to translate to to another language then the best way is to create new language module. The easiest way to do this is to clone Russian module.
-
Copy Russian module from
/modules/boonex/russian/
to your own directory, for example/module/vendor/french/
, where vendor is your or organization name. -
Edit
modules/vendor/french/install/config.php
file and change all possible values, particularly:-
'name' => 'vend_fr'
- for 2 letters code use ISO 639-1 standard and some abbreviation for your or your organization name 'title' => 'French'
'version' => '1.0.0'
'vendor' => 'Vendor'
-
'compatible_with' => array('9.0.0')
- specify particular version here 'home_dir' => 'vendor/french/'
'home_uri' => 'fr'
-
'db_prefix' => 'bx_fr_'
- database tables prefix, it's not used but needed anyway 'class_prefix' => 'VendFr'
'language_category' => 'Vendor French'
- comments at the top of the page
-
-
Edit
modules/vendor/french/install/installer.php
file by changing the comment at the top of the page and class name, useclass_prefix
specified in point 1:class VendFrInstaller extends BxDolStudioInstaller
-
Edit
modules/vendor/french/install/langs/en.xml
file, by changing only the following:- change all language key prefixes to your own, for example from
_bx_rsn_
to_vend_fr_
- change translations from
Russian
to 'French`
- change all language key prefixes to your own, for example from
-
Edit SQL files in
modules/vendor/french/install/sql/
folder by changing all occurrences of the following:-
bx_ru
tovend_fr
- thename
value from the point 1 -
boonex/russian/
tovendor/french/
- thehome_dir
value from the point 1 -
Russian
toFrench
- thetitle
value from the point 1 -
'ru'
to'fr'
- thehome_uri
value from point 1 -
_bx_rsn_
to_vend_fr_
- like in point 4
-
-
Change images in
modules/vendor/french/template/images/icons/
folder, use the following guide and PSD template to create new one, please use flag picture - instructions on how to create module icon -
It's recommended to translate from English, to do it go to
modules/vendor/french/data/langs/
folder, then:-
in
system
folder: remove 'ru.xml' file, -
in
system
folder: copymodules/boonex/english/data/langs/system/en.xml
file from English -
in
system
folder: then rename it fromen.xml
to 'fr.xml' -
in
system
folder: editfr.xml
by changing the header:<resources name="fr" flag="fr" title="French">
and translate the values:
<string name="_lang_key"><![CDATA[Translate only here]]></string>
-
repeat the same for each module folder, but copy original English translation from
install/langs
folder in the module. For example for Posts module copy and renamemodules/boonex/posts/install/langs/en.xml
file tobx_posts/fr.xml
-
-
When new version of UNA is released you need to update module and add/remove/change some language keys. The list of changed language keys can be found in English module update files, also you can also use it as a template to create own language module update. For example the here is the list of changes from 9.0.0 to 9.0.1 for English language.
IMPORTANT NOTE: documentation was moved here - https://una.io/wiki/Introduction