(→Localizing the Help Files: Minor clarification added) |
|||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | CKFinder is fully localizable | + | {{#CUSTOMTITLE:CKFinder Localization}} |
+ | __TOC__ | ||
+ | CKFinder is fully localizable, including language-specific cultural aspects like date formatting. | ||
== Automatic Language Detection == | == Automatic Language Detection == | ||
+ | By default CKFinder will try to detect the user language. If a localization file is available for that language, the interface will be adapted to it automatically. If no matching language file is available, a default language will be loaded (US English by default). | ||
− | + | In order to disable automatic language detection, edit the <code>config.js</code> file and set the language to one of available languages by using the <code>[http://docs.cksource.com/ckfinder_2.x_api/symbols/CKFinder.config.html#.language config.language]</code> configuration setting. | |
− | + | For example, the following setting forces CKEditor to display the interface in German, disabling the automatic detection feature: | |
+ | <source lang="javascript"> | ||
+ | config.language = 'de'; | ||
+ | </source> | ||
− | |||
− | |||
− | |||
== Localizing CKFinder == | == Localizing CKFinder == | ||
+ | ''Localization'' is the act of adapting software to a culture. In CKFinder this is done by creating the main localization file in the <code>lang</code> folder as well as a small localization file for the server side part of CKFinder inside the <code>core/connector/ext/lang</code> folder. | ||
− | + | For example, to create a Japanese localization file, follow the steps described below: | |
− | + | * Create a copy of the English localization file (<code>en.js</code>) and name it <code>jp.js</code>. | |
− | For example, to create a | + | * Edit the <code>jp.js</code> file and translate all language strings. This file is in JavaScript format, so the string format must respect the JavaScript specification. |
− | + | * Save the file. We recommend using the UTF-8 encoding. | |
− | + | * Open the <code>ckfinder.js</code> file in your favourite editor (make a backup first), and search for: | |
− | + | <source lang="javascript"> | |
− | + | var l={};a.lang={ko:{cs:1,de:1,en:1,'es-mx':1,hu:1,lv:1,nl:1,no:1,'pt-br':1,sk:1,sv:1,'zh-tw':1, | |
− | + | da:1,el:1,es:1,fr:1,it:1,nb:1,nn:1,pl:1,ru:1,sl:1,'zh-cn':1} | |
− | + | </source> | |
− | + | and add '''<code>'jp':1</code>''' there: | |
+ | <source lang="javascript"> | ||
+ | var l={};a.lang={ko:{'jp':1,cs:1,de:1,en:1,'es-mx':1,hu:1,lv:1,nl:1,no:1,'pt-br':1,sk:1,sv:1,'zh-tw':1,da:1, | ||
+ | el:1,es:1,fr:1,it:1,nb:1,nn:1,pl:1,ru:1,sl:1,'zh-cn':1} | ||
+ | </source> | ||
+ | Save the file. | ||
+ | * You may disable automatic language detection and set the new language as the default one in order to force the browser to load your file. | ||
+ | * Test the user interface to check the correctness of your localization. | ||
+ | * Note: to avoid having to change <code>ckfinder.js</code>, you can send us your translation (see [[#Contributing_Localizations|Contributing Localizations]]) and we will include it in the next release. | ||
The following are some notes about a few localization entries in the language file: | The following are some notes about a few localization entries in the language file: | ||
+ | * <code>dir</code> – sets the interface reading direction. You can choose between <code>ltr</code> for Left-to-Right languages like English and <code>rtl</code> for Right-to-Left languages like Hebrew or Arabic. | ||
+ | * <code>HelpLang</code> – sets the language of the Help files. If you have not localized them, leave this entry intact (<code>en</code>) or set it to any of the available translated Help files. | ||
+ | * <code>HelpTip</code> – if you have not localized the Help files, we recommend you indicate the Help language in the tooltip. For example, for Italian you may translate it to "Aiuto (Inglese)". | ||
− | + | == Setting the Date and Time Format == | |
− | * | + | CKFinder supports adjusting the date format to the standards of your language. Use the following entries to configure the date and time format: |
− | * | + | * <code>DateTime</code> – sets the date and time format. Use the values provided in the comment to adjust this entry to your needs. |
+ | * <code>DateAmPm</code> – sets the AM/PM display. | ||
− | == Localizing the Help | + | == Localizing the Help Files == |
+ | It is possible to localize the CKFinder Help files. Follow these steps to translate them to, for example, German: | ||
+ | * Create a copy of the <code>en</code> subfolder in the <code>help</code> folder and rename it to <code>de</code>. | ||
+ | * Translate the texts of all related HTML files inside the <code>de</code> folder. | ||
+ | * In the localization file for German (<code>lang/de.js</code>), set the <code>HelpLang</code> entry to <code>de</code>. | ||
− | + | === Localizing Help Screenshots === | |
+ | We recommend to reuse the English language CKFinder screenshots since they are always up-to-date (and you will not need to redo them yourself). | ||
− | + | It is also our policy to keep the bilingual names of CKFinder commands and terms in the localized Help files, with the localized version given first, and its its English equivalent given in parentheses. Examples: German: '''Abbrechen''' ('''Cancel'''), French: '''Envoyer''' ('''Upload'''), Spanish: '''Seleccionar''' ('''Select'''). | |
− | |||
− | |||
− | |||
− | + | Your users will now enjoy a fully localized experience with CKFinder. | |
== Contributing Localizations == | == Contributing Localizations == | ||
+ | All localization contributions are most welcome by CKSource and much appreciated by the international audience of our product as well as your users. The same goes for all efforts to improve existing translations and complete them. Feel free to [http://cksource.com/contact contact us] if you have any questions or would like to send us your submission. | ||
− | We | + | <note>We prepared a '''''nice gift''''' for each person who will send us a complete (new) translation ;-) Just make sure to provide us with your e-mail address so we can contact you.</note> |
Latest revision as of 22:41, 27 September 2011
Contents
CKFinder is fully localizable, including language-specific cultural aspects like date formatting.
Automatic Language Detection
By default CKFinder will try to detect the user language. If a localization file is available for that language, the interface will be adapted to it automatically. If no matching language file is available, a default language will be loaded (US English by default).
In order to disable automatic language detection, edit the config.js
file and set the language to one of available languages by using the config.language
configuration setting.
For example, the following setting forces CKEditor to display the interface in German, disabling the automatic detection feature:
config.language = 'de';
Localizing CKFinder
Localization is the act of adapting software to a culture. In CKFinder this is done by creating the main localization file in the lang
folder as well as a small localization file for the server side part of CKFinder inside the core/connector/ext/lang
folder.
For example, to create a Japanese localization file, follow the steps described below:
- Create a copy of the English localization file (
en.js
) and name itjp.js
. - Edit the
jp.js
file and translate all language strings. This file is in JavaScript format, so the string format must respect the JavaScript specification. - Save the file. We recommend using the UTF-8 encoding.
- Open the
ckfinder.js
file in your favourite editor (make a backup first), and search for:
var l={};a.lang={ko:{cs:1,de:1,en:1,'es-mx':1,hu:1,lv:1,nl:1,no:1,'pt-br':1,sk:1,sv:1,'zh-tw':1, da:1,el:1,es:1,fr:1,it:1,nb:1,nn:1,pl:1,ru:1,sl:1,'zh-cn':1}
and add 'jp':1
there:
var l={};a.lang={ko:{'jp':1,cs:1,de:1,en:1,'es-mx':1,hu:1,lv:1,nl:1,no:1,'pt-br':1,sk:1,sv:1,'zh-tw':1,da:1, el:1,es:1,fr:1,it:1,nb:1,nn:1,pl:1,ru:1,sl:1,'zh-cn':1}
Save the file.
- You may disable automatic language detection and set the new language as the default one in order to force the browser to load your file.
- Test the user interface to check the correctness of your localization.
- Note: to avoid having to change
ckfinder.js
, you can send us your translation (see Contributing Localizations) and we will include it in the next release.
The following are some notes about a few localization entries in the language file:
-
dir
– sets the interface reading direction. You can choose betweenltr
for Left-to-Right languages like English andrtl
for Right-to-Left languages like Hebrew or Arabic. -
HelpLang
– sets the language of the Help files. If you have not localized them, leave this entry intact (en
) or set it to any of the available translated Help files. -
HelpTip
– if you have not localized the Help files, we recommend you indicate the Help language in the tooltip. For example, for Italian you may translate it to "Aiuto (Inglese)".
Setting the Date and Time Format
CKFinder supports adjusting the date format to the standards of your language. Use the following entries to configure the date and time format:
-
DateTime
– sets the date and time format. Use the values provided in the comment to adjust this entry to your needs. -
DateAmPm
– sets the AM/PM display.
Localizing the Help Files
It is possible to localize the CKFinder Help files. Follow these steps to translate them to, for example, German:
- Create a copy of the
en
subfolder in thehelp
folder and rename it tode
. - Translate the texts of all related HTML files inside the
de
folder. - In the localization file for German (
lang/de.js
), set theHelpLang
entry tode
.
Localizing Help Screenshots
We recommend to reuse the English language CKFinder screenshots since they are always up-to-date (and you will not need to redo them yourself).
It is also our policy to keep the bilingual names of CKFinder commands and terms in the localized Help files, with the localized version given first, and its its English equivalent given in parentheses. Examples: German: Abbrechen (Cancel), French: Envoyer (Upload), Spanish: Seleccionar (Select).
Your users will now enjoy a fully localized experience with CKFinder.
Contributing Localizations
All localization contributions are most welcome by CKSource and much appreciated by the international audience of our product as well as your users. The same goes for all efforts to improve existing translations and complete them. Feel free to contact us if you have any questions or would like to send us your submission.