Opened 14 years ago
Closed 14 years ago
#5599 closed Bug (fixed)
Labels for special characters need to be resourced.
Reported by: | Damian | Owned by: | Tobiasz Cudnik |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.5 |
Component: | General | Version: | |
Keywords: | IBM | Cc: | Satya Minnekanti, joek, jamcunni@… |
Description
The labels in the special characters dialog are hard coded with English values. These labels should be resourced to enable translation.
Attachments (9)
Change History (37)
comment:1 Changed 14 years ago by
Milestone: | CKEditor 3.3 → CKEditor 3.4 |
---|
comment:2 Changed 14 years ago by
Owner: | set to Tobiasz Cudnik |
---|
Changed 14 years ago by
Attachment: | 5599_1.patch added |
---|
comment:3 Changed 14 years ago by
Keywords: | Review? added |
---|---|
Status: | new → assigned |
comment:4 Changed 14 years ago by
Keywords: | Review- added; Review? removed |
---|
comment:5 Changed 14 years ago by
I don't think localization files are the correct place for keeping array of characters shown by Special Chars dialog. I'm not saying this won't have benefits for localization, although for such things config file seems quite more logical.
We can place chars in config and take labels from lang files if they exists, but in the same time give ability to define custom labels in the config, for people who needs custom special chars.
Saying this in the code, it would looks like this (config.js):
CKEDITOR.config.specialChars = [ '”', '–', /* ... */, [ '&custom;', 'Custom Char Label' ] ];
We can also provide a way of adding new special chars without overriding ones defined by default using the same way as plugins list does today.
comment:6 Changed 14 years ago by
I'm pretty agree with the configuration approach, the problem is the bytes of keeping translation in the config, plugin specific lang files could be used for it.
comment:7 Changed 14 years ago by
I liked the proposed patch approach, partially. Let's try to make things logic, smaller and flexible.
- Localization stuff should go into language files.
- Let's take the opportunity to reduce the loading size of the editor, having a plugin language file, loading it on demand when opening the dialog for the first time, similarly to the a11y plugin.
- It's still nice to have the option to set the label text into the configurations directly. The patch approach is ok for it.
- To reduce further the size, and to make the configuration easier, there is no need to have
["€", lang.euro]
in the settings. We can have some simple label resolve rules for it:- If the entry is an Array, take the second element of it (if available) as the label.
- Otherwise, check whether there is a language entry for the "exact" special character entry. If the entry is an entity, strip the "&" and ";".
- Finally, if nothing is found, use the character itself as the label.
Changed 14 years ago by
Attachment: | 5599_2.patch added |
---|
comment:8 Changed 14 years ago by
Keywords: | Review? added; Review- removed |
---|
Second patch implementes Fred's suggestions, with exception of pre-pending "sign_" prefix for numerical-only chars, as object keys can't be numeric in JS without quoting, which may be missing in out langtool.
Changed 14 years ago by
Attachment: | 5599_3.patch added |
---|
comment:9 Changed 14 years ago by
Previous patch was missing external language file for labels. Third one fixes that.
comment:10 Changed 14 years ago by
Keywords: | Review- added; Review? removed |
---|
Instead of
chars[ chars.length ] = extraChars[ i ]
You can use
chars.push = extraChars[ i ]
But in this case I think that it should be possible to use Array.concat (untested):
chars = editor.config.specialChars.concat( editor.config.extraSpecialChars );
The plugins shouldn't be available in source mode:
modes : { wysiwyg:1, source:1 },
comment:11 Changed 14 years ago by
Keywords: | Review? added; Review- removed |
---|
Ive fixed those 2 things in last patch.
comment:12 Changed 14 years ago by
Keywords: | Review- added; Review? removed |
---|
It looks like the last patch has been created differently. I'm not able to apply it. Can you please recreate it?
Changed 14 years ago by
Attachment: | 5599_5.patch added |
---|
comment:13 Changed 14 years ago by
Keywords: | Review? added; Review- removed |
---|
comment:14 Changed 14 years ago by
Milestone: | CKEditor 3.4 → CKEditor 3.5 |
---|
comment:15 Changed 14 years ago by
Milestone: | CKEditor 3.4.1 → CKEditor 3.5 |
---|
comment:16 Changed 14 years ago by
Status: | review → review_failed |
---|
There's entity missed between '‛' and 'ŷ'
Changed 14 years ago by
Attachment: | 5599_6.patch added |
---|
comment:17 Changed 14 years ago by
Status: | review_failed → review |
---|
I've added the missing sbquo entity, fixed labels for uppercased entities and abandoned "sign_" prefix, as it should not be a problem for our releaser.
comment:18 Changed 14 years ago by
Status: | review → review_failed |
---|
In such way how do we distinguish the lang entry between entities in decimal and hexadecimal?
comment:19 Changed 14 years ago by
Ok, forgive my last comment, besides, I think the 'extraSpecialChars ' could be removed and just get merged into the config.
Changed 14 years ago by
Attachment: | 5599_7.patch added |
---|
comment:20 Changed 14 years ago by
Status: | review_failed → review |
---|
Now we're using only one config entry, i've also added an example how to extend it.
comment:21 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:22 Changed 14 years ago by
Status: | review_passed → review_failed |
---|
Please move the configuration entry from the core files to the plugin file.
Changed 14 years ago by
Attachment: | 5599_8.patch added |
---|
comment:23 Changed 14 years ago by
Status: | review_failed → review |
---|
comment:24 Changed 14 years ago by
Cc: | jamcunni@… added |
---|
comment:25 Changed 14 years ago by
Status: | review → review_failed |
---|
Pls change config initialization to our convention.
Changed 14 years ago by
Attachment: | 5599_9.patch added |
---|
comment:26 Changed 14 years ago by
Status: | review_failed → review |
---|
I've modified the config in a way the Autogrow plugin have, although it's not KISS at all.
comment:27 Changed 14 years ago by
Status: | review → review_passed |
---|
Last patch fails the following case:
config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] );
So let's back to 5599_8.patch which is kept the same as "smiley" plugin.
comment:28 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [6088], using 5599_8.patch.
It's great, but how about using directly Numeric/Character entities as lang entry?