ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
JsCode.php
Go to the documentation of this file.
1<?php
2
3namespace Gettext\Extractors;
4
7
11class JsCode extends Extractor implements ExtractorInterface
12{
13 public static $functions = array(
14 '__' => '__',
15 'n__' => 'n__',
16 'p__' => 'p__',
17 );
18
22 public static function fromString($string, Translations $translations = null, $file = '')
23 {
24 if ($translations === null) {
25 $translations = new Translations();
26 }
27
28 $functions = new JsFunctionsScanner($string);
29 $functions->saveGettextFunctions(self::$functions, $translations, $file);
30 }
31}
An exception for terminatinating execution or to throw for unit testing.
Class to get gettext strings from javascript files.
Definition: JsCode.php:12
static fromString($string, Translations $translations=null, $file='')
{Parses a string and append the translations found in the Translations instance.Translations}
Definition: JsCode.php:22
Class to manage a collection of translations.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file