ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
JsonDictionary.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Gettext\Extractors;
4 
6 
11 {
15  public static function fromString($string, Translations $translations = null, $file = '')
16  {
17  if ($translations === null) {
18  $translations = new Translations();
19  }
20 
21  if (($entries = json_decode($string, true))) {
22  foreach ($entries as $original => $translation) {
23  $translations->insert(null, $original)->setTranslation($translation);
24  }
25  }
26 
27  return $translations;
28  }
29 }
static fromString($string, Translations $translations=null, $file='')
{Parses a string and append the translations found in the Translations instance.The file path to inse...
Class to manage a collection of translations.
Class to get gettext strings from plain json.