Joomla extension to type in 23 Indian languages

By | October 23, 2017

Today I am going to explore various ways to easily type in 23 Indian languages in your favorite CMS Joomla.

Supported Joomla Version

Joomla 3.8.1

Supported Indian Languages

  • Assamese
  • Bengali
  • Bodo
  • Dogri
  • Gujarati
  • Hindi
  • Kannada
  • Kashmiri
  • Konkani
  • Maithili
  • Malayalam
  • Manipuri
  • Marathi (Devnagari/Modi)
  • Meitei
  • Nepali
  • Odia
  • Punjabi
  • Sanskrit
  • Santali (Ol Chiki)
  • Sindhi
  • Sora
  • Tamil
  • Telugu

There are 4 methods you can use depending on your editor choice.

  1. Using TinyMCE editor (Out of the box, No customization)
  2. Using TinyMCE editor (Php code change, Full customization)

Using TinyMCE Editor (Out of the box, No customization)

It is assumed that TinyMCE editor is your default editor. You can check/set it by going to Joomla Administration > System menu > Global Configuration and look for Default Editor.

  1. Download PramukhIME TinyMCE plugin and extract it at WEBROOT\media\editors\tinymce\plugins so that “pramukhime” will become sub-folder of plugins.
  2. Now from Joomla Administration menu, navigate to Extensions > Plugins > Editor – TinyMCE.
  3. Click on “Editor – TinyMCE” to open up plugin settings
  4. For “Set 2”, go all the way down and add “pramukhime” in Custom Plugin and “pramukhime, pramukhimehelp, pramukhimesettings, pramukhimeresetsettings, pramukhimetogglelanguage” in Custom Button. Repeat the same for “Set 1” and “Set 0” as shown in the image.

  5. Click on “Save” or “Save & Close” button at the top.
  6. Now when you try to add new article, it will show you PramukhIME language list and all other buttons in the last toolbar

Using this method, you can quickly add capability for typing in 23 Indian languages however you can neither customize the language list nor utilize customization options available for PramukhIME TinyMCE plugin. The buttons can only be available in the last toolbar. If you really need the customization, follow the steps given in the next section.

Using TinyMCE editor (Php code change, Full customization)

It is assumed that TinyMCE editor is your default editor. You can check/set it by going to Joomla Administration > System menu > Global Configuration and look for Default Editor.

  1. Download PramukhIME TinyMCE plugin and extract it at WEBROOT\media\editors\tinymce\plugins so that “pramukhime” will become sub-folder of plugins.
  2. Add the following code to WEBROOT\layouts\plugins\editors\tinymce\field\tinymcebuilder.php to add a stylesheet at approximately line 56
    JHtml::_(‘stylesheet’, ‘media/editors/tinymce/plugins/pramukhime/css/pramukhindic.css’, array(‘version’ => ‘auto’, ‘relative’ => false));
  3. Add the following code to WEBROOT\plugins\editors\tinymce\tinymce.php to add customization options for PramukhIME at approximately line 672 (technically, we are adding more options for variable $scriptOptions). Modify language list and other options as per your need
    // These options are optional. Use only if needed
     $scriptOptions['pramukhime_options'] = array(
     // Optional. If this value is not provided, it will list all the available languages
     'languages' => array(
     array('text' => 'Pramukh Indic', 'value' => '', 'disabled' => true), // May be used for title
     array('text' => 'Assamese', 'value' => 'pramukhindic:assamese'),
     array('text' => 'Bengali', 'value' => 'pramukhindic:bengali'),
     array('text' => 'Bodo', 'value' => 'pramukhindic:bodo'),
     array('text' => 'Dogri', 'value' => 'pramukhindic:dogri'),
     array('text' => 'Gujarati', 'value' => 'pramukhindic:gujarati'),
     array('text' => 'Hindi', 'value' => 'pramukhindic:hindi'),
     array('text' => 'Kannada', 'value' => 'pramukhindic:kannada'),
     array('text' => 'Kashmiri', 'value' => 'pramukhindic:kashmiri'),
     array('text' => 'Konkani', 'value' => 'pramukhindic:konkani'),
     array('text' => 'Maithili', 'value' => 'pramukhindic:maithili'),
     array('text' => 'Malayalam', 'value' => 'pramukhindic:malayalam'),
     array('text' => 'Manipuri', 'value' => 'pramukhindic:manipuri'),
     array('text' => 'Marathi', 'value' => 'pramukhindic:marathi'),
     array('text' => 'Marathi (Modi)', 'value' => 'pramukhindic:marathimodi'),
     array('text' => 'Meitei', 'value' => 'pramukhindic:meitei'),
     array('text' => 'Nepali', 'value' => 'pramukhindic:nepali'),
     array('text' => 'Odia', 'value' => 'pramukhindic:odia'),
     array('text' => 'Punjabi', 'value' => 'pramukhindic:punjabi'),
     array('text' => 'Sanskrit', 'value' => 'pramukhindic:sanskrit'),
     array('text' => 'Santali (Ol Chiki)', 'value' => 'pramukhindic:santali'),
     array('text' => 'Sindhi', 'value' => 'pramukhindic:sindhi'),
     array('text' => 'Sora', 'value' => 'pramukhindic:sora'),
     array('text' => 'Tamil', 'value' => 'pramukhindic:tamil'),
     array('text' => 'Telugu', 'value' => 'pramukhindic:telugu'),
     array('text' => '-', 'value' => ''), // This will turn into menu separator
     array('text' => 'English', 'value' => 'pramukhime:english') // Note: the value contains pramukhime and NOT pramukhindic
     ),
     // Uncomment the following value to select Sanskrit as the default language
     'selected_value' => 'pramukhindic:sanskrit', // Not required. Default value is 'pramukhime:english'
     // Use the toggle key as a keyboard shortcut to quickly switch between current and last selected language. 
     'toggle_key' => array( // Not required. Default value is {key:120, ctrl: false, alt: false, title: 'F9'}. Customizes a toggle key which is a shortcut key responsible for switching
     // between currently and last selected languages.
     'key' => 119, // Required. F8 key's keycode
     'ctrl' => false, // Not required. If true, user must press "Ctrl" key + key to switch
     'alt' => false, // Not required. If true, user must press "Alt" key + key to switch
     'title' => 'F8' // Required. This title will be appended to the title of "English" language.
     ),
     );
    
  4. In the same file, look for function definition for “getKnownButtons” and go approximately at line 1155 and insert the following code after “insertdatetime” and before the “return $buttons” statement.
    'pramukhime' => array('label' => 'PramukhIME Language List', 'text' => 'PramukhIME', 'plugin' => 'pramukhime'),
     'pramukhimehelp' => array('label' => 'PramukhIME Help', 'plugin' => 'pramukhime'),
     'pramukhimesettings' => array('label' => 'PramukhIME Settings', 'plugin' => 'pramukhime'),
     'pramukhimeresetsettings' => array('label' => 'PramukhIME Reset Settings', 'plugin' => 'pramukhime'),
     'pramukhimetogglelanguage' => array('label' => 'PramukhIME Toggle Language', 'plugin' => 'pramukhime'),
  5. Now from Joomla Administration menu, navigate to Extensions > Plugins > Editor – TinyMCE.
  6. Click on “Editor – TinyMCE” to open up plugin settings and you will see the PramukhIME buttons available for drag and drop to “Set 2”, “Set 1” and “Set 0”.
  7. Click on “Save” or “Save & Close” button at the top.
  8. Now when you try to add new article, it will show you PramukhIME language list and all other buttons exactly where you put it
Vishal Monpara is a full stack Solution Developer/Architect with 12 years of experience primarily using Microsoft stack. He is currently working in Retail industry and moving 1’s and 0’s from geographically dispersed hard disks to geographically dispersed user’s mind leveraging geographically dispersed team members.

Leave a Reply

Your email address will not be published. Required fields are marked *