27 list(
$name, $line, $args) = $function;
29 if (!isset($functions[
$name])) {
35 switch ($functions[$name]) {
37 if (!isset($args[0])) {
43 if ($original !==
'') {
44 $translation = $translations->
insert(
'', $original);
49 if (!isset($args[1])) {
53 list($original, $plural) = $args;
55 if ($original !==
'') {
56 $translation = $translations->
insert(
'', $original, $plural);
61 if (!isset($args[1])) {
67 if ($original !==
'') {
73 if (!isset($args[1])) {
77 list(
$domain, $original) = $args;
80 $translation = $translations->
insert(
'', $original);
85 if (!isset($args[2])) {
97 if (!isset($args[2])) {
101 list(
$context, $original, $plural) = $args;
103 if ($original !==
'') {
104 $translation = $translations->
insert(
$context, $original, $plural);
109 if (!isset($args[4])) {
116 $translation = $translations->
insert(
$context, $original, $plural);
121 throw new Exception(
'Not valid functions');
124 if (isset($translation)) {
125 $translation->addReference($file, $line);
126 if (isset($function[3])) {
127 foreach ($function[3] as $extractedComment) {
128 $translation->addExtractedComment($extractedComment);
getDomain()
Returns the domain.
insert($context, $original, $plural='')
Creates and insert/merges a new translation.
saveGettextFunctions(array $functions, Translations $translations, $file='')
Search for specific functions and create translations.
getFunctions()
Scan and returns the functions and the arguments.
Class to manage a collection of translations.
if(!array_key_exists('domain', $_REQUEST)) $domain