CKFinder is fully localizable considering specific language cultural aspects, like date formatting.
Contents
Automatic Language Detection
By default, CKFinder will try to detect the user language. If a localization file is available for that language the interface is automatically adapted to it. If no language file is available, a default language is loaded (by default US English).
To disable the automatic language detection, simply edit the ckfinder.html file, and look for the UI configuration block (right after "var CKFConfig"). Then change the value of the AutoDetectLanguage entry to "false". You may also change the default language by setting the DefaultLanguage entry to any of the available languages.
For example, the following forces the interface to load the German localization file, disabling the automatic detection feature:
AutoDetectLanguage : false, DefaultLanguage : 'de',
Localizing CKFinder
Localize is the act of adapting a software to a culture. In CKFinder, this is done by creating a localization file in the "core/lang" folder.
For example, to create a German localization file, just follow these steps:
- Create a copy of the English localization file (en.js) and name it de.js.
- Edit the de.js file, making all necessary translations there. This file is in JavaScript format, so all string rules must respect the JavaScript specifications.
- Save the file. We recommend using the UTF-8 encoding.
- Edit the UI configuration block in the ckfinder.html file, adding the language code to the Languages entry (note that all languages are separated by comma with no spaces).
- You may disable the automatic language detection and set the new language as the default one, to force the browser to load your file.
- Test the interface.
The following are some notes about a few localization entries in the language file:
- Dir: sets the interface reading direction. At this time, CKFinder is not compatible with right-to-left languages, so leave this entry as 'ltr'.
- HelpLang: if you don't have also localized the help files, leave this entry intact ('en') or set it to any of the available help translated languages.
- HelpTip: if you don't have localized the help files, we recommend indicating the help language in the tooltip. For example, in Italian you may translate it to "Aiuto (Inglese)".
Localizing the Help files
It is possible to localize the CKFinder help files. Just follow these steps to translate it to, for example, German:
- In the "core/help" folder, create a copy of the "en" folder and rename it to "de".
- Edit all related files inside the "de" folder.
- Screenshots may also be replaced in the "de/files/images" folder.
- In the localization file for German (core/lang/de.js), set the HelpLang entry to "de".
That's it. Your users will now enjoy a full localized experience with CKFinder.
Contributing Localizations
We of course welcome localization files contributions. In this way, others can also give their contributions to make the translations better and more complete. Feel free to contact us for it.