Skip to content
This repository
Browse code

Localization for custom TinyMCE ssmacron module

  • Loading branch information...
commit 857afc4ee77adf794a58cd2d2da224b9c5e6eedd 1 parent 94b739e
Ingo Schommer authored August 13, 2012
9  thirdparty/tinymce_ssmacron/editor_plugin_src.js
... ...
@@ -1,6 +1,13 @@
1 1
 (function() {
2 2
 	var each = tinymce.each;
3 3
 
  4
+	// TinyMCE will stop loading if it encounters non-existent external script file
  5
+	// when included through tiny_mce_gzip.php. Only load the external lang package if it is available.
  6
+	var availableLangs = ['en', 'mi_NZ'];
  7
+	if(jQuery.inArray(tinymce.settings.language, availableLangs) != -1) {
  8
+		tinymce.PluginManager.requireLangPack("ssmacron");
  9
+	}
  10
+
4 11
 	/**
5 12
 	 * Load via: 
6 13
 	 * HtmlEditorConfig::get('cms')->enablePlugins(array('ssmacron', '../tinymce_ssmacron'))
@@ -33,7 +40,7 @@
33 40
 	
34 41
 			// Register buttons
35 42
 			ed.addButton('ssmacron', {
36  
-				title : 'Insert a Macron',
  43
+				title : t.editor.translate('insertmacron'),
37 44
 				cmd : 'mceInsertMacron',
38 45
 				image : url + '/img/macron.png'
39 46
 			});
1  thirdparty/tinymce_ssmacron/lang/en.js
... ...
@@ -0,0 +1 @@
  1
+tinyMCE.addI18n('en.ssmacron',{'insertmacron': 'Insert a Macron'});
1  thirdparty/tinymce_ssmacron/lang/mi_NZ.js
... ...
@@ -0,0 +1 @@
  1
+tinyMCE.addI18n('mi_NZ.ssmacron',{'insertmacron': 'T\u0101urua he tohut\u014D'});

0 notes on commit 857afc4

Please sign in to comment.
Something went wrong with that request. Please try again.