original_string: public function getJavascriptTranslations()
      {
          $clientSideTranslations = array();
          foreach ($this->getClientSideTranslationKeys() as $id) {
              list($plugin, $key) = explode('_', $id, 2);
              $clientSideTranslations[$id] = $this->getTranslation($id, $this->currentLanguage, $plugin, $key);
          }
  
          $js = 'var translations = ' . json_encode($clientSideTranslations) . ';';
          $js .= "\n" . 'if (typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }' .
              'for(var i in translations) { piwik_translations[i] = translations[i];} ';
          return $js;
      }
code: public function getJavascriptTranslations()
      {
          $clientSideTranslations = array();
          foreach ($this->getClientSideTranslationKeys() as $id) {
              list($plugin, $key) = explode('_', $id, 2);
              $clientSideTranslations[$id] = $this->getTranslation($id, $this->currentLanguage, $plugin, $key);
          }
  
          $js = 'var translations = ' . json_encode($clientSideTranslations) . ';';
          $js .= "\n" . 'if (typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }' .
              'for(var i in translations) { piwik_translations[i] = translations[i];} ';
          return $js;
      }
code_tokens: public function getJavascriptTranslations ( ) { $ clientSideTranslations = array ( ) ; foreach ( $ this -> getClientSideTranslationKeys ( ) as $ id ) { list ( $ plugin , $ key ) = explode ( '_' , $ id , 2 ) ; $ clientSideTranslations [ $ id ] = $ this -> getTranslation ( $ id , $ this -> currentLanguage , $ plugin , $ key ) ; } $ js = 'var translations = ' . json_encode ( $ clientSideTranslations ) . ';' ; $ js .= "\n" . 'if (typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }' . 'for(var i in translations) { piwik_translations[i] = translations[i];} ' ; return $ js ; }
docstring: Generate javascript translations array
docstring_tokens: Generate javascript translations array