Opened 10 years ago

Last modified 9 years ago

#12486 confirmed Bug

Unreplaced token "%1" in elements path item's title

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0.1
Keywords: Cc:

Description

  1. Open languages samples.
  2. Change language to Arabic.
  3. Hover over one of the items in the elements path.

There will be "%1 sth".

I looked into the code and lang/ar.js and everything seems to be fine there, so it's worth checking what's going on.

Attachments (1)

Selection_180.png (55.2 KB) - added by Piotrek Koszuliński 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.5CKEditor 4.4.6

comment:2 Changed 10 years ago by Jakub Ś

Status: newpending

I have tried on mac windows and every possible browser and didn't get this. Could you provide more details like:

  1. Where does it happen (OS and browser)?
  2. What do you do before hovering elements path? You click in content area perhaps?

comment:3 Changed 10 years ago by Piotrek Koszuliński

Nothing special...

I just took latest master (but was able to reproduce it on 4.4.4 as well). Focused editor to get something in the elements path and hovered one of the items (anyone). I reproduced this on all browsers. See:

Last edited 10 years ago by Piotrek Koszuliński (previous) (diff)

Changed 10 years ago by Piotrek Koszuliński

Attachment: Selection_180.png added

comment:4 Changed 10 years ago by Jakub Ś

Status: pendingconfirmed
Version: 3.0.1

Problem can be reproduced from CKEditor 3.0.1.

The problem is located in file: plugins/elemntspath/lang/ar.js
There is a code eleTitle: 'عنصر 1%' which should be eleTitle: '%عنصر 1' so that %1 could be replaced with name of element like 'strong' or 'li' or 'p'. The second word is Element in Arabic. With that you should have 'strong element' when hovering.

comment:5 Changed 10 years ago by Piotrek Koszuliński

This is the content of that file for me:

CKEDITOR.plugins.setLang( 'elementspath', 'ar', {
	eleLabel: 'مسار العنصر',
	eleTitle: 'عنصر 1%'
} );

And WOW... In Sublime Text I can see "1%", here, after pasting I see just "1" (and "%" is at the end). So it's some RTL encoding problem ;|

Last edited 10 years ago by Piotrek Koszuliński (previous) (diff)

comment:6 Changed 10 years ago by Piotrek Koszuliński

Ah, I got my mistake. Elementspath plugin looks for "%1", not "1%". And someone translating this item to Arabic switched the order. Additionally, the rendering of this text in at least Chrome is incorrect, because this worked:

> CKEDITOR.instances.editor1.lang.elementspath.eleTitle.replace( /1%/, 'X' )
"عنصر X"

comment:7 Changed 10 years ago by Piotrek Koszuliński

There are 3 places where we have incorrect patterns:

plugins/button/lang/he.js:	selectedLabel: '1% (סומן)'
plugins/elementspath/lang/ar.js:	eleTitle: 'عنصر 1%'
plugins/find/lang/ar.js:	replaceSuccessMsg: 'تم استبدال 1% من الحالات ',

comment:8 Changed 10 years ago by Piotrek Koszuliński

And two more in the core's translations:

lang/pt.js:		invalidCssLength: 'O valor especificado para o campo "1%" deve ser um número positivo, com ou sem uma unidade de medida CSS válida (px, %, in, cm, mm, em, ex, pt, ou pc).',
lang/pt.js:		invalidHtmlLength: 'O valor especificado para o campo "1%" deve ser um número positivo, com ou sem uma unidade de medida HTML válida (px ou %).',

comment:9 Changed 10 years ago by Wiktor Walc

Milestone: CKEditor 4.4.6

comment:10 Changed 9 years ago by Jakub Ś

#13688 was marked as duplicate.

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