Forumlar - Seditio CMS - SE » User Guide - Localization-files for Seditio

explaination and creating a new localization
 

Author
Message
Kaan

Administrators

Online status

678 posts

#223   2013-05-24 20:52 GMT        
In a default installation of Cotonti, all text is displayed in English. This is common known, but not always suitable for your site.

Those texts can be change via the language files.

There are already localization available for Seditio. See https://www.seditio.com.tr/eski2/.....c=locales
Each version of seditio uses its own version of the language files.


1. Language code
Each language has his own 2-character ISO language code. eg. Turkish: tr ; English: en ; Russian: ru ; German: de ; Dutch: nl ; …
This language code is used in each language-file. eg. Xxxx.en.lang.php, Xxxx.tr.lang.php, ...

2. Locations of the language files
There are different kind of language files which are located in different locations. In the list below you can substitute lang_code with a 2-character ISO code of an actual language.

/lang This folder contains common and core language files. Each language has its own directory named as its language code eg. /lang/en/
/lang/lang_code/admin.lang_code.lang.php administration backend localization
/lang/lang_code/main.lang_code.lang.php common lexis
/lang/lang_code/message.lang_code.lang.php localized service messages
/plugins/plugin_name/lang/plugin_name.lang_code.lang.php contains plugin localization (language) files
/themes/theme_name/theme_name.lang_code.lang.php contains theme localization (language) files
/images/smilies/lang/lang_code.lang.js contains names for the smilies

3. Content of the language files
Eg. Main.en.lang.php
PHP:
<?php
/**
 * English Language File (main.lang.php)
 *
 * @package Seditio
 * @version 171
 * @author Seditio Translators Team
 * @copyright Copyright (c) Seditio Team 2006-2013
 * @license BSD
 */

defined('SED_CODE') or die('Wrong URL.');
/**
 * Main strings
 */

$L['Access'] = 'Access';
$L['Action'] = 'Action';
$L['Active'] = 'Active';
$L['Activity'] = 'Activity';
$Ls['Guests'] = array('guests','guest');
t]
First part is general info about the file.
Below “defined('SED_CODE') or die('Wrong URL.');” you can find the language strings.
Before “=” you can find the strings that is used in the .tpl e.g. {PHP.L.Access}. This string in the tpl will be replaced by the text between brackets after the “=”.
Sometimes you see array after ‘=’, this means that the engine will decide upon some parameters to choose between the items in the array. Like above it will use plural or not.

4. Changing the language of your site
There are 2 ways to change the language used at the site.
- Change the language in the users own profile. This will effect only the user that changed his language
- Change the language in /data
PHP:
$cfg['defaultlang'] = 'en';                      // Default language code
e code[/highlight]
This will change the language for all guests and all new registered users.
There is also a setting in admin-menu to force the default language for all users.
http://yoursite.com/admin.php?m=.....re&p=lang

5. Creating your own localization
- Copy all language files and change the 2-character ISO code to the language you will use (For the location of the files, see above)
- Translate all texts after “=” between the brackets. Don’t change the word array or the text before “=”, or the strings will become unusable.


Bunlara baktınızmı?
Seditio 175+ Forum Hide Link
Seditio Veritabanı Yönetimi
Seditio Etiket (Tags) Sistemi
Kişiliğim, hayatım hakkında konuşabilirsiniz. Fikir yürüte bilirsiniz. Beni öyle böyle sanabilirsiniz. Ama emin olamazsınız. Sizin hakkımdaki yorumlarınız, sanmalarınız benim gerçek de ne olduğumu değiştirmez. Baktığım yeri söyleye bilirsiniz ama ne gördüğümü ASLA...