Opened 16 years ago
Closed 16 years ago
#2746 closed Task (fixed)
V3: Language file organization
Reported by: | Frederico Caldeira Knabben | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Must have (possibly next milestone) | Milestone: | CKEditor 3.0 |
Component: | General | Version: | |
Keywords: | Confirmed | Cc: |
Description
Currently, we are placing all language entries into a single object definition in the main en.js file. We are ending up with a long list of keys with strings associated to then, just like we have in FCKeditor.
We are again using prefixes to group related keys in this long dictionary. So we have things like dlgTableTitle, dlgReplaceTitle and dlgFindTitle, each one being a reference to the specific dialog title.
We have now the chance to review the way we define this dictionary. We can make it easier to maintain, simpler to read and even smaller in size by grouping things inside an object "tree". For example:
CKEDITOR.lang['en'] = { link : { button : 'Link\u200b', dialog : 'Link', info : 'Link Info', target : 'Target', ... unlink : 'Unlink', ... }, specialchar : { dialog : 'Select Special Character' }, find : { dialogFindReplace : 'Find and Replace', find : { dialog : 'Find', button : 'Find', ... }, replace : { dialog : 'Replace', button : 'Replace', findLbl : 'Find what:', replaceLbl : 'Replace with:', ... } }, ... };
Note that I've used the plugin name as the main grouping object for each set of entries. I think this is the best way to do that, even if we have a single entry for each plugin (avoiding issues if we need further entries in the future).
We should be then able to simply call things like editor.lang.link.button
to grab the relative string, instead of {{{editor.lang.linkButton))).
Also note that prefixes like "dlg" are also to be avoided. Most of the language entries for dialog based plugins are dialog related things, so there is no sense on prefixing all of them with "dlg".
Change History (3)
comment:1 Changed 16 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ok. Fixed by [2837].
It seems to be done and all dialogs are working correctly.