26 'dpgettext' =>
'dp__',
29 'npgettext' =>
'np__',
32 'dnpgettext' =>
'dnp__',
52 if ($translations === null) {
57 if (self::$extractComments !==
false) {
58 $functions->enableCommentsExtraction(self::$extractComments);
60 $functions->saveGettextFunctions(self::$functions, $translations,
$file);
74 if (strpos($value,
'\\') ===
false) {
75 return substr($value, 1, -1);
78 if ($value[0] ===
"'") {
79 return strtr(substr($value, 1, -1),
array(
'\\\\' =>
'\\',
'\\\'' =>
'\''));
82 $value = substr($value, 1, -1);
84 return preg_replace_callback(
'/\\\(n|r|t|v|e|f|\$|"|\\\|x[0-9A-Fa-f]{1,2}|u{[0-9a-f]{1,6}}|[0-7]{1,3})/',
function ($match) {
85 switch ($match[1][0]) {
105 return chr(hexdec(substr($match[0], 1)));
107 return self::unicodeChar(hexdec(substr($match[0], 1)));
109 return chr(octdec($match[0]));
122 return chr(0xC0 + ($dec >> 6))
123 .chr(0x80 + ($dec & 0x3f));
126 if ($dec < 0x010000) {
127 return chr(0xE0 + ($dec >> 12))
128 .chr(0x80 + (($dec >> 6) & 0x3f))
129 .chr(0x80 + ($dec & 0x3f));
132 if ($dec < 0x200000) {
133 return chr(0xF0 + ($dec >> 18))
134 .chr(0x80 + (($dec >> 12) & 0x3f))
135 .chr(0x80 + (($dec >> 6) & 0x3f))
136 .chr(0x80 + ($dec & 0x3f));
Class to manage a collection of translations.
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file