Add support for regional languages to TinyMCE language detection

Bug #1265061 reported by Robert Lyon on 2013-12-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Robert Lyon

Bug Description

Taking just the fist 2 letters of the current language to select which language file to use with tinymce will not work correctly for some languages dialects.

eg Chinese, traditional is represented with 'zh_tw' in mahara language packs ( - note the underscore

and is represented as zh-tw.js for the tinymce language pack - note the hyphen.

And is different to the tinymce language pack zh-cn.js

Robert Lyon (robertl-9) wrote :

Have added a patch

To test:

1) Add in some language packs to the site - make sure to add language packs that are both dialect ones, it will have a 5 char code instead of two in left hand column, and non dialect ones.

2) Make sure one of the dialect ones also exists as a dialect lang pack for tinymce (see /js/tinymce/langs/ directory for what is installed) - Currently only zh_TW matches this criteria.

3) Pick the language to test in site options

4) Go to a page that uses tinymce (eg /artefact/internal/index.php) and make sure tinymce is displaying the correct language.
- when you are viewing tinymce with mahara using zh_TW
   -- without the patch it will use the zh.js lang pack
   -- with the patch it will use the zh-tw.js lang pack

Changed in mahara:
status: Confirmed → In Progress

Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 0bff3169c44aa6057132443760966668166a0167
Author: Robert Lyon <email address hidden>
Date: Tue Dec 31 10:08:50 2013 +1300

Detecting language for tinymce more robustly (Bug #1265061)

Allowing for language dialects like zh_TW vs zh_CN vs zh_HK

As we have a tinymce zh-tw.js language pack we should use it when the
mahara language pack is zh_TW.utf8

Change-Id: Ie29a2b1cd89cb092ee646f43d0df011774d289c4
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw) on 2014-01-22
Changed in mahara:
status: In Progress → Fix Committed
Aaron Wells (u-aaronw) on 2014-01-22
summary: - detecting which language to use for tinymce not correct
+ Add support for regional languages to TinyMCE language detection
tags: added: tinymce translations
Robert Lyon (robertl-9) on 2014-04-22
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers