From 6c260bc9c9fab14e504284097902ca80981841c9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 26 Dec 2016 03:12:58 -0500 Subject: [PATCH] Localize TinyMCE Automatically use a language pack for the current locale if one is available --- .../zotero/bindings/styled-textbox.xml | 6 +- resource/tinymce/integration.html | 2 + resource/tinymce/langs/ar.js | 220 ++++++++++++++++++ resource/tinymce/langs/bg_BG.js | 219 +++++++++++++++++ resource/tinymce/langs/ca.js | 219 +++++++++++++++++ resource/tinymce/langs/cs_CZ.js | 219 +++++++++++++++++ resource/tinymce/langs/da.js | 219 +++++++++++++++++ resource/tinymce/langs/de.js | 219 +++++++++++++++++ resource/tinymce/langs/el.js | 219 +++++++++++++++++ resource/tinymce/langs/es.js | 219 +++++++++++++++++ resource/tinymce/langs/et.js | 219 +++++++++++++++++ resource/tinymce/langs/eu.js | 219 +++++++++++++++++ resource/tinymce/langs/fa_IR.js | 220 ++++++++++++++++++ resource/tinymce/langs/fi.js | 219 +++++++++++++++++ resource/tinymce/langs/fr_FR.js | 219 +++++++++++++++++ resource/tinymce/langs/gl.js | 219 +++++++++++++++++ resource/tinymce/langs/he_IL.js | 220 ++++++++++++++++++ resource/tinymce/langs/hr.js | 219 +++++++++++++++++ resource/tinymce/langs/hu_HU.js | 219 +++++++++++++++++ resource/tinymce/langs/id.js | 219 +++++++++++++++++ resource/tinymce/langs/is_IS.js | 219 +++++++++++++++++ resource/tinymce/langs/it.js | 219 +++++++++++++++++ resource/tinymce/langs/ja.js | 219 +++++++++++++++++ resource/tinymce/langs/km_KH.js | 219 +++++++++++++++++ resource/tinymce/langs/ko_KR.js | 219 +++++++++++++++++ resource/tinymce/langs/lt.js | 219 +++++++++++++++++ resource/tinymce/langs/nb_NO.js | 219 +++++++++++++++++ resource/tinymce/langs/nl.js | 219 +++++++++++++++++ resource/tinymce/langs/pl.js | 219 +++++++++++++++++ resource/tinymce/langs/pt_BR.js | 219 +++++++++++++++++ resource/tinymce/langs/pt_PT.js | 219 +++++++++++++++++ resource/tinymce/langs/ro.js | 219 +++++++++++++++++ resource/tinymce/langs/ru.js | 219 +++++++++++++++++ resource/tinymce/langs/sk.js | 219 +++++++++++++++++ resource/tinymce/langs/sl_SI.js | 219 +++++++++++++++++ resource/tinymce/langs/sv_SE.js | 219 +++++++++++++++++ resource/tinymce/langs/th_TH.js | 219 +++++++++++++++++ resource/tinymce/langs/tr_TR.js | 219 +++++++++++++++++ resource/tinymce/langs/uk.js | 219 +++++++++++++++++ resource/tinymce/langs/vi_VN.js | 219 +++++++++++++++++ resource/tinymce/langs/zh_CN.js | 219 +++++++++++++++++ resource/tinymce/langs/zh_TW.js | 219 +++++++++++++++++ resource/tinymce/locale.js | 74 ++++++ resource/tinymce/note.html | 6 +- resource/tinymce/noteview.html | 3 +- 45 files changed, 8849 insertions(+), 5 deletions(-) create mode 100755 resource/tinymce/langs/ar.js create mode 100755 resource/tinymce/langs/bg_BG.js create mode 100755 resource/tinymce/langs/ca.js create mode 100755 resource/tinymce/langs/cs_CZ.js create mode 100755 resource/tinymce/langs/da.js create mode 100755 resource/tinymce/langs/de.js create mode 100755 resource/tinymce/langs/el.js create mode 100755 resource/tinymce/langs/es.js create mode 100755 resource/tinymce/langs/et.js create mode 100755 resource/tinymce/langs/eu.js create mode 100755 resource/tinymce/langs/fa_IR.js create mode 100755 resource/tinymce/langs/fi.js create mode 100755 resource/tinymce/langs/fr_FR.js create mode 100755 resource/tinymce/langs/gl.js create mode 100755 resource/tinymce/langs/he_IL.js create mode 100755 resource/tinymce/langs/hr.js create mode 100755 resource/tinymce/langs/hu_HU.js create mode 100755 resource/tinymce/langs/id.js create mode 100755 resource/tinymce/langs/is_IS.js create mode 100755 resource/tinymce/langs/it.js create mode 100755 resource/tinymce/langs/ja.js create mode 100755 resource/tinymce/langs/km_KH.js create mode 100755 resource/tinymce/langs/ko_KR.js create mode 100755 resource/tinymce/langs/lt.js create mode 100755 resource/tinymce/langs/nb_NO.js create mode 100755 resource/tinymce/langs/nl.js create mode 100755 resource/tinymce/langs/pl.js create mode 100755 resource/tinymce/langs/pt_BR.js create mode 100755 resource/tinymce/langs/pt_PT.js create mode 100755 resource/tinymce/langs/ro.js create mode 100755 resource/tinymce/langs/ru.js create mode 100755 resource/tinymce/langs/sk.js create mode 100755 resource/tinymce/langs/sl_SI.js create mode 100755 resource/tinymce/langs/sv_SE.js create mode 100755 resource/tinymce/langs/th_TH.js create mode 100755 resource/tinymce/langs/tr_TR.js create mode 100755 resource/tinymce/langs/uk.js create mode 100755 resource/tinymce/langs/vi_VN.js create mode 100755 resource/tinymce/langs/zh_CN.js create mode 100755 resource/tinymce/langs/zh_TW.js create mode 100644 resource/tinymce/locale.js diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index 809bdb02e1..67ae09f360 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -610,8 +610,10 @@ getService(Components.interfaces.nsIIOService); var uri = ios.newURI("resource://zotero/tinymce/" + htmlFile + ".html", null, null); - // Pass directionality (LTR/RTL) in URL - uri.spec += "?dir=" + Zotero.dir; + // Pass directionality (LTR/RTL) and locale in URL + uri.spec += "?locale=" + encodeURIComponent(Zotero.locale) + + "&dir=" + Zotero.dir; + Zotero.debug("Loading " + uri.spec); diff --git a/resource/tinymce/integration.html b/resource/tinymce/integration.html index 3984b4e36b..69f59e96ee 100644 --- a/resource/tinymce/integration.html +++ b/resource/tinymce/integration.html @@ -22,6 +22,7 @@ html, body { + + +