We would like to have the TinyMCE French language pack and other languages.

I've been told this should work with Drush 5 and the module make_post:

; Download TinyMCE
libraries[tinymce][download][type] = "file" 
libraries[tinymce][download][url] = "http://github.com/downloads/tinymce/tinymce/tinymce_3.4.2.zip" 
libraries[tinymce][directory_name] = "tinymce" 

; TinyMCE French language pack (JS export)
; Needs Drush 5 and its sub-module make_post
libraries[tinymce_fr][download][type] = "post" 
libraries[tinymce_fr][download][url] = "http://www.tinymce.com/i18n/index.php?ctrl=export&act=zip" 
libraries[tinymce_fr][download][data] = "la[]=fr&la_export=js&pr_id=7&submitted=Download" 

; Force filename so Drush Make unzips it
libraries[tinymce_fr][download][filename] = "tinymce_fr.zip" 

; The two following lines are telling drush make to put the archive files in libraries/tinymce/jscripts/tiny_mce
libraries[tinymce_fr][destination] = "libraries/tinymce/jscripts" 
libraries[tinymce_fr][directory_name] = "tiny_mce" 

; Allow drush make to install librairies[tinymce_fr] inside a non empty directory
libraries[tinymce_fr][overwrite] = TRUE

If using Drush 4, replacing the line

libraries[tinymce_fr][download][type] = "post"

by these ones:

libraries[tinymce_fr][download][type] = "file"
libraries[tinymce_fr][download][request_type] = "post"

I tried with Drupal core 6 and 7, with Drush 4 and 5, with and without the module make_post, with type "file" and "post". Nothing works on my side. I receive an HTML file instead of a zip file, or I get one of these error messages:

tinymce downloaded from http://github.com/downloads/tinymce/tinymce/tinymce_3.4.2.zip. [ok]
missing schema [error]
Unable to download tinymce_fr from http://www.tinymce.com/i18n/index.php?ctrl=export&act=zip. [error]

With drush 5 and make_post:

tinymce downloaded from http://github.com/downloads/tinymce/tinymce/tinymce_3.4.2.zip. [ok]
unlink(/tmp/make_tmp_1345232248_502e9d7866d3e): No such file or directory filesystem.inc:121 [warning]

Useful documentation:
http://davidstosik.fr/telecharger-pack-langue-francaise-pour-tinymce-ave...
#1134326: Allow a DrushMakeProject to be installed in a non empty directory (Port to Drush 5)
http://drupal.org/project/make_post
http://www.tinymce.com/wiki.php/Language
http://www.tinymce.com/i18n/index.php?ctrl=lang&act=download&pr_id=1

Is anyone able to make it work ?

Comments

j0nathan’s picture

Title: TinyMCE French language pack » TinyMCE language pack
j0nathan’s picture

Component: Code » New module request
j0nathan’s picture

Component: New module request » Module list
j0nathan’s picture

Version: 7.x-5.x-dev » 8.x-1.x-dev
mvc’s picture

this is very annoying, but i managed to download the language pack using the following command:

wget 'http://www.tinymce.com/i18n3x/index.php?ctrl=export&act=zip&la[]=fr&pr_i...' -O tinymce_language_pack_fr.zip

can you try again without passing parameters by POST?

this should give you a zip file with the following structure:

mvc@dev0:.../tinymce/jscripts/tiny_mce% unzip -l /tmp/tinymce_language_pack_fr.zip 
Archive:  /tmp/tinymce_language_pack_fr.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     7765  2013-03-20 17:35   tinymce_language_pack/langs/fr.js
      129  2013-03-20 17:40   tinymce_language_pack/plugins/advhr/langs/fr_dlg.js
     1508  2013-03-20 17:39   tinymce_language_pack/plugins/advimage/langs/fr_dlg.js
     2120  2013-03-20 17:37   tinymce_language_pack/plugins/advlink/langs/fr_dlg.js
      513  2013-03-20 17:37   tinymce_language_pack/plugins/emotions/langs/fr_dlg.js
     2864  2013-03-20 17:37   tinymce_language_pack/plugins/fullpage/langs/fr_dlg.js
     3302  2013-03-20 17:36   tinymce_language_pack/plugins/media/langs/fr_dlg.js
      276  2013-03-20 17:38   tinymce_language_pack/plugins/paste/langs/fr_dlg.js
      584  2013-03-20 17:38   tinymce_language_pack/plugins/searchreplace/langs/fr_dlg.js
     1723  2013-03-20 17:39   tinymce_language_pack/plugins/style/langs/fr_dlg.js
     2694  2013-03-20 17:38   tinymce_language_pack/plugins/table/langs/fr_dlg.js
      731  2013-03-20 17:39   tinymce_language_pack/plugins/template/langs/fr_dlg.js
     1195  2013-03-20 17:36   tinymce_language_pack/plugins/xhtmlxtras/langs/fr_dlg.js
      349  2013-03-20 17:41   tinymce_language_pack/themes/simple/langs/fr.js
     2782  2013-03-20 17:40   tinymce_language_pack/themes/advanced/langs/fr.js
     2341  2013-03-20 17:40   tinymce_language_pack/themes/advanced/langs/fr_dlg.js
---------                     -------
    30876                     16 files

so, you'll have to somehow move everything out of the tinymce_language_pack/ directory using the makefile.
i've just done this manually for the platform drupal-7-2013.03.25-dev because there is a bug in tinymce that breaks the editor completely when a language file is missing, and the wysiwyg authors say for now you have to download the language packs separately. see also the wysiwyg feature requests to enable better language handling:
#379182: TinyMCE stopped showing in languages other than English
#362318: Limit wysiwyg language selection to available languages

note: the maintainers are moving to an external service for managing translations for tinymce 4.x (currently in beta), so this method will change when 4.0 is released (and when that version is supported by wysiwyg.module: #1968318: Support for TinyMCE 4.x)

j0nathan’s picture

I tried this in the makefile:

libraries[kplatforms_tinymce_fr][directory_name] = tinymce
libraries[kplatforms_tinymce_fr][download][type] = get
libraries[kplatforms_tinymce_fr][download][url] = http://www.tinymce.com/i18n3x/index.php?ctrl=export&act=zip&la[]=fr&pr_id=7&la_export=js
libraries[kplatforms_tinymce_fr][overwrite] = TRUE

And I got "Unable to download":

Executing: mkdir '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__build__/sites/all/libraries/tinymce'
Executing: mkdir '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
Executing: ls '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
Executing: curl -LOD '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__header__' 'https://github.com/downloads/tinymce/tinymce/tinymce_3.4.9_jquery.zip'
Executing: ls '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
Executing: mv '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__/tinymce_3.4.9_jquery.zip' '/tmp/drush_make_tmp_1368700122_5194b4da58c73/tinymce_3.4.9_jquery.zip'
Executing: rm -f '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__header__'
Executing: rm -rf '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
kplatforms_tinymce downloaded from https://github.com/downloads/tinymce/tinymce/tinymce_3.4.9_jquery.zip.   [ok]
Executing: mkdir '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__unzip__'
Executing: unzip '/tmp/drush_make_tmp_1368700122_5194b4da58c73/tinymce_3.4.9_jquery.zip' -d '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__unzip__'
Executing: ls '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__unzip__'
Executing: cp -Rf '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__unzip__/tinymce' '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__build__/sites/all/libraries'
Executing: rm -rf '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__unzip__'
Executing: rm '/tmp/drush_make_tmp_1368700122_5194b4da58c73/tinymce_3.4.9_jquery.zip'
Executing: mkdir '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
Executing: ls '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
Executing: curl -LOD '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__header__' 'http://www.tinymce.com/i18n3x/index.php?ctrl=export&act=zip&la[]=fr&pr_id=7&la_export=js'
Executing: ls '/tmp/drush_make_tmp_1368700122_5194b4da58c73/__download__'
Unable to download kplatforms_tinymce_fr from http://www.tinymce.com/i18n3x/index.php?ctrl=export&act=zip&la[]=fr&pr_id=7&la_export=js.   [error]
Command dispatch complete   [notice]
ERROR: Platform not downloaded successfully.
mvc’s picture

it looks like curl tries to interpret [ and ] in the url as a glob for some reason. this is possibly a bug. anyways, i was able to get this to work on the command line by encoding the url:

curl -LOD 'your_header_file' http://www.tinymce.com/i18n3x/index.php%3Fctrl%3Dexport%26act%3Dzip%26la%5B%5D%3Dfr%26pr_id%3D7%26la_export%3Djs

that works, but dumps the zip file into a file called index.php%3Fctrl%3Dexport%26act%3Dzip%26la%5B%5D%3Dfr%26pr_id%3D7%26la_export%3Djs

if possible, you might want to get drush make to drop the -O option and add -o tinymce_language_pack_fr.zip

j0nathan’s picture

It works with the URL encoded:

libraries[kplatforms_tinymce_fr][directory_name] = tinymce
libraries[kplatforms_tinymce_fr][download][type] = get
libraries[kplatforms_tinymce_fr][download][url] = http://www.tinymce.com/i18n3x/index.php%3Fctrl%3Dexport%26act%3Dzip%26la%5B%5D%3Dfr%26pr_id%3D7%26la_export%3Djs
libraries[kplatforms_tinymce_fr][overwrite] = TRUE
kplatforms_tinymce downloaded from https://github.com/downloads/tinymce/tinymce/tinymce_3.4.9_jquery.zip. [ok]
kplatforms_tinymce_fr downloaded from http://www.tinymce.com/i18n3x/index.php%3Fctrl%3Dexport%26act%3Dzip%26la%5B%5D%3Dfr%26pr_id%3D7%26la_export%3Djs. [ok]
OK: Platform downloaded successfully in '/var/aegir/platforms/drupal-7-2013.05.16-test3'.
j0nathan’s picture

Assigned: Unassigned » j0nathan
Status: Active » Fixed

Thanks mvc.

Committed for Drupal 6 and 7 : http://drupalcode.org/project/kplatforms.git/commit/385e158

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 385e158 on 8.x-1.x, 8.x-2.x, lock by j0nathan:
    Issue #1737092 by mvc : TinyMCE language pack.