title: Adding multilangage to module PrestaShop
body: <p>I create simple module for displaying string in lef column it's works but I want extend it to possibility adding this text in all available language in my shop. Right now i module configuration page I have only input for string, how can I add next to this button with language selection and how save it in to database? </p>
  
  <pre><code>   if (!defined('_PS_VERSION_')) {
  exit;
  }
  
  class Sometext extends Module
  {
  protected $config_form = false;
  
  public function __construct()
  {
      $this-&gt;name = 'sometext';
      $this-&gt;tab = 'front_office_features';
      $this-&gt;version = '1.0.0';
      $this-&gt;author = 'AgnesTom';
      $this-&gt;need_instance = 1;
  
      /**
       * Set $this-&gt;bootstrap to true if your module is compliant with bootstrap (PrestaShop 1.6)
       */
      $this-&gt;bootstrap = true;
  
      parent::__construct();
  
      $this-&gt;displayName = $this-&gt;l('sometext');
      $this-&gt;description = $this-&gt;l('some text in left column');
  }
  
  /**
   * Don't forget to create update methods if needed:
   * http://doc.prestashop.com/display/PS16/Enabling+the+Auto-Update
   */
  public function install()
  {
      Configuration::updateValue('SOMETEXT_TEXT', false);
  
      return parent::install() &amp;&amp;
          $this-&gt;registerHook('header') &amp;&amp;
          $this-&gt;registerHook('backOfficeHeader') &amp;&amp;
          $this-&gt;registerHook('displayLeftColumn');
  }
  
  public function uninstall()
  {
      Configuration::deleteByName('SOMETEXT_TEXT');
  
      return parent::uninstall();
  }
  
  /**
   * Load the configuration form
   */
  public function getContent()
  {
      /**
       * If values have been submitted in the form, process.
       */
      if (((bool)Tools::isSubmit('submitSometextModule')) == true) {
          $this-&gt;postProcess();
      }
  
      $this-&gt;context-&gt;smarty-&gt;assign('module_dir', $this-&gt;_path);
  
      $output = $this-&gt;context-&gt;smarty-&gt;fetch($this-&gt;local_path.'views/templates/admin/configure.tpl');
  
      return $output.$this-&gt;renderForm();
  }
  
  /**
   * Create the form that will be displayed in the configuration of your module.
   */
  protected function renderForm()
  {
      $helper = new HelperForm();
  
      $helper-&gt;show_toolbar = false;
      $helper-&gt;table = $this-&gt;table;
      $helper-&gt;module = $this;
      $helper-&gt;default_form_language = $this-&gt;context-&gt;language-&gt;id;
      $helper-&gt;allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);
  
      $helper-&gt;identifier = $this-&gt;identifier;
      $helper-&gt;submit_action = 'submitSometextModule';
      $helper-&gt;currentIndex = $this-&gt;context-&gt;link-&gt;getAdminLink('AdminModules', false)
          .'&amp;configure='.$this-&gt;name.'&amp;tab_module='.$this-&gt;tab.'&amp;module_name='.$this-&gt;name;
      $helper-&gt;token = Tools::getAdminTokenLite('AdminModules');
  
      $helper-&gt;tpl_vars = array(
          'fields_value' =&gt; $this-&gt;getConfigFormValues(), /* Add values for your inputs */
          'languages' =&gt; $this-&gt;context-&gt;controller-&gt;getLanguages(),
          'id_language' =&gt; $this-&gt;context-&gt;language-&gt;id,
      );
  
      return $helper-&gt;generateForm(array($this-&gt;getConfigForm()));
  }
  
  /**
   * Create the structure of your form.
   */
  protected function getConfigForm()
  {
      return array(
          'form' =&gt; array(
              'legend' =&gt; array(
              'title' =&gt; $this-&gt;l('Settings'),
              'icon' =&gt; 'icon-cogs',
              ),
              'input' =&gt; array(
                  array(
                      'col' =&gt; 3,
                      'type' =&gt; 'text',
                      'prefix' =&gt; '&lt;i class="icon icon-envelope"&gt;&lt;/i&gt;',
                      'desc' =&gt; $this-&gt;l('Enter a text'),
                      'name' =&gt; 'SOMETEXT_TEXT',
                      'label' =&gt; $this-&gt;l('Email'),
                  ),
              ),
              'submit' =&gt; array(
                  'title' =&gt; $this-&gt;l('Save'),
              ),
          ),
      );
  }
  
  /**
   * Set values for the inputs.
   */
  protected function getConfigFormValues()
  {
      return array(
          'SOMETEXT_TEXT' =&gt; Configuration::get('SOMETEXT_TEXT', 'Some text here'),
      );
  }
  
  /**
   * Save form data.
   */
  protected function postProcess()
  {
      $form_values = $this-&gt;getConfigFormValues();
  
      foreach (array_keys($form_values) as $key) {
          Configuration::updateValue($key, Tools::getValue($key));
      }
  }
  
  /**
  * Add the CSS &amp; JavaScript files you want to be loaded in the BO.
  */
  public function hookBackOfficeHeader()
  {
      if (Tools::getValue('module_name') == $this-&gt;name) {
          $this-&gt;context-&gt;controller-&gt;addJS($this-&gt;_path.'views/js/back.js');
          $this-&gt;context-&gt;controller-&gt;addCSS($this-&gt;_path.'views/css/back.css');
      }
  }
  
  /**
   * Add the CSS &amp; JavaScript files you want to be added on the FO.
   */
  public function hookHeader()
  {
      $this-&gt;context-&gt;controller-&gt;addJS($this-&gt;_path.'/views/js/front.js');
      $this-&gt;context-&gt;controller-&gt;addCSS($this-&gt;_path.'/views/css/front.css');
  }
  
  public function hookDisplayLeftColumn()
  {
     $some_string = Configuration::get('SOMETEXT_TEXT');
      if (isset($some_string)) {
      $this-&gt;context-&gt;smarty-&gt;assign('some_string', $some_string);
          return $this-&gt;display(__FILE__, '/views/templates/front/front.tpl');
      }
  }
  </code></pre>
  
  <p>}</p>