Opened 17 years ago

Last modified 13 years ago

#1032 assigned New Feature

Possibility to override language entries from configuration

Reported by: Frederico Caldeira Knabben Owned by:
Priority: Normal Milestone:
Component: UI : Language Version:
Keywords: Cc:

Description

There should be a configuration entry to make it possible to override language file entries with custom texts. In this way it would be possible to set language entries from the server side (see #1014).

Attachments (2)

1032.patch (1004 bytes) - added by Artur Formella 15 years ago.
1032_2.patch (1.4 KB) - added by Artur Formella 15 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 16 years ago by Wojciech Olchawa

Keywords: Confirmed added
Type: BugTask

comment:2 Changed 16 years ago by Wojciech Olchawa

Type: TaskNew Feature

Changed 15 years ago by Artur Formella

Attachment: 1032.patch added

comment:3 Changed 15 years ago by Artur Formella

Keywords: Review? added

Usage:

CKEDITOR.replace( 'editor1', { 
	lang :
	{
		pl :
		{
			source : 'aaaa'
		},
		en :
		{
			source : 'bbbb'
		},
		source : 'cccc'
	}
});

Of course: CKEDITOR.lang.en.source = cccc

comment:4 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

The idea is quite good. The implementation instead needs some review.

  1. Please save "editor.config.lang" and "editor.config.lang[ entry ]" into local variables. Their references are being repeated many times.
  1. There is no need to make any check at line 155. Let's make it possible to extend the current lang in any case, even if the language entries are not available (it could be used for custom entries, for example).
  1. Also, "CKEDITOR.lang[ editor.langCode ]" is wrong. You should simply do "editor.lang".
  1. Our current language file take the entries from an object tree. So, it I want to override the table title string, I would do this:
    lang :
    {
        table :
        {
            title : 'My Table Title'
        }
    }

... in this case, the entire editor.lang.table object will be replaced with the above one, loosing all other entries inside of it.

Changed 15 years ago by Artur Formella

Attachment: 1032_2.patch added

comment:5 Changed 15 years ago by Artur Formella

Keywords: Review? added; Review- removed

comment:6 Changed 15 years ago by Artur Formella

Owner: set to Artur Formella
Status: newassigned

comment:7 Changed 15 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.0CKEditor 3.x

comment:8 Changed 15 years ago by Artur Formella

Component: GeneralUI : Language
Owner: Artur Formella deleted
Status: assignednew

comment:9 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:10 Changed 13 years ago by Frederico Caldeira Knabben

Status: reviewassigned
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy