iD language code mismatch ckeditor‘s language with 4-char

Description

In short:
2-char language code is the same definition in iD and ckeditor.
4-char language code is not , ie zh_CN:

In iDemepiere : zh_CN
In ckeditor : zh-cn
in all browse : zh-CN (function ”navigator.language“ )

and:
java style : zh_CN
ZK style : zh_CN

ckditor use browser's name style , iD give its lang code to ck return a mismatching
language UI. ( input "zh_CN" ,output "zh") .

there's 2 solutions:

  1. hack office ckeditor js in org.idempiere.zk.extra\lib\ckez.jar
    file: ckez.jar\web\js\ckez\ext\CKeditor\ckeditor.js Line 217
    action: replace "-" to "_"

  2. convert lang and put it to ckeditor .
    file: Language.java (org.adempiere.base\src\org\compiere\util)
    action: convert it

Reference:

  1. https://groups.google.com/d/msg/idempiere/4Mvb8VYOC-c/MTE_P6U2BQAJ

  2. WTextEditorDialog.java (org.adempiere.ui.zk\WEB-INF\src\org\adempiere\webui\window)

I'm not a programmer and welcome any voice of yours , thanks

Environment

anywhere

Activity

Show:
z5k1
November 10, 2017, 9:59 AM

Another way is do not put language to ckeditor , let ckeditor use client browse language.
That's always return correct result.

Just like WCtxHelpSuggestion.java , dont set the language value in ckeditor.config.

z5k1
November 10, 2017, 10:53 AM
Edited

I have implemented 2st solution.
CKeditor always keep the same language with iDempiere UI instead of browser language.

Assignee

Unassigned

Reporter

z5k1

Tested By

None

Components

Affects versions

Priority

Trivial
Configure