Opened 16 years ago

Closed 15 years ago

#3698 closed New Feature (fixed)

CKLangTool should sort language entries

Reported by: Wiktor Walc Owned by: Wiktor Walc
Priority: Normal Milestone:
Component: Project : CKPackager Version:
Keywords: Confirmed Review+ Cc:

Description

(as the title says)

Attachments (4)

3698.patch (38.8 KB) - added by Wiktor Walc 15 years ago.
test_assets.zip (10.4 KB) - added by Wiktor Walc 15 years ago.
3698_2.patch (1.6 KB) - added by Wiktor Walc 15 years ago.
langtool.jar (877.4 KB) - added by Wiktor Walc 15 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 15 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.0CKEditor 3.1

Changed 15 years ago by Wiktor Walc

Attachment: 3698.patch added

Changed 15 years ago by Wiktor Walc

Attachment: test_assets.zip added

comment:2 Changed 15 years ago by Wiktor Walc

Keywords: Review? added
  • test_assets.zip - just in case anyone had problems with creating Arabic files using this patch.
  • langtool.jar - compiled version added for easier testing

Few words about new patch..

Previously en.js was used as a template, all language files were constructed just like the English translation, including spacing (tabs, multiple spaces, new lines etc.).

In the new CKLangTool version also the English file is modified. It means that is no longer used as a template (per se), but only as a source of language entries.

Inline and block comments are detected and assigned to the nearest language entry. It means that in current en.js file, the following part of file:

	// Toolbar buttons without dialogs.
	source			: 'Source',
	newPage			: 'New Page',
	save			: 'Save',
	preview			: 'Preview',

will be changed into:

	newPage			: 'New Page',
	preview			: 'Preview',
	save			: 'Save',
	// Toolbar buttons without dialogs.
	source			: 'Source',

so be careful when adding comments.

As a result of sorting, note that two special entries in language files:

	/**
	 * The language reading direction. Possible values are "rtl" for
	 * Right-To-Left languages (like Arabic) and "ltr" for Left-To-Right
	 * languages (like English).
	 * @default 'ltr'
	 */
	dir : 'ltr',

	/*
	 * Screenreader titles. Please note that screenreaders are not always capable
	 * of reading non-English words. So be careful while translating it.
	 */
	editorTitle		: 'Rich text editor, %1',

are sorted just like the other entries and are no longer at the top.

comment:3 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed
Milestone: CKEditor 3.1

I'm afraid we have a big misunderstanding here. I think the ticket has been originally created for a very small thing, to have the _translationstatus.txt file entries ordered alphabetically, so we avoid changes like this: [4564/CKEditor/trunk/_source/lang/_translationstatus.txt].

The feature that's being proposed instead is about the entries in the files, which is definitely something not to be done. The entries in the en.js file are added in a certain logical order and that order must not change. For example, we leave "width" and "height" together because they refer to the same kind of thing... dialog titles are in the beginning of their lang blocks, etc.

All this shows us that "(as the title says)" is something really bad to have in the ticket description.

Changed 15 years ago by Wiktor Walc

Attachment: 3698_2.patch added

comment:4 Changed 15 years ago by Wiktor Walc

Keywords: Review? added; Review- removed

The attached patch contains code that sorts lines with translation status before saving them to _translationstatus.txt.

Changed 15 years ago by Wiktor Walc

Attachment: langtool.jar added

comment:5 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:6 Changed 15 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [4660].

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