#2746: V3: Language file organization
-----------------------+----------------------------------------------------
Reporter: fredck | Owner:
Type: Task | Status: new
Priority: High | Milestone: CKEditor 3.0
Component: General | Version:
Keywords: Confirmed |
-----------------------+----------------------------------------------------
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".
--
Ticket URL: <http://dev.fckeditor.net/ticket/2746>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac