Plugin Localization
The aim of this article is to explain how to localize custom plugins.
Each plugin may provide its own language files. CKFinder will load the correct language file automatically.
Basic Rules
- All language files must be located in the
lang
folder (<plugin directory>/lang
) and should have the same naming pattern as core CKFinder language files. - Language files should be in the JSON format.
- To avoid conflicts, all defined translations are available in finder.lang within their own namespace, for example translations defined by the
FolderInfo
plugin are available asfinder.lang.FolderInfo
.
Localizing a Plugin
Let us assume that you want to localize a custom plugin called FolderInfo
.
Create language files in the
lang
folder. For example to create English and Spanish language files, create:<FolderInfo>/lang/en.js
<FolderInfo>/lang/es.js
In the plugin definition add a property informing CKFinder that language files are available:
lang: 'en,pl',
For any text that you used in the plugin, remove the hardcoded texts and replace them with references to entries from the language file, e.g.:
finder.lang.FolderInfo.title
Example
See the FolderInfo plugin for a complete example of a plugin with its own language files.
Translating CKFinder
Please check the Translating CKFinder article to learn how you can contribute core CKFinder translations. Your help is much appreciated — thank you!