/trunk/dev/translation/generate_proof_files.phps |
---|
94,7 → 94,11 |
# --- |
function get_js_L_strings($cont) { |
/** |
* @param string $cont |
* @return array |
*/ |
function get_js_L_strings(string $cont): array { |
// Works with JavaScript and PHP |
$cont = preg_replace('@/\\*.+\\*/@ismU', '', $cont); |
$cont = str_replace('\\"', chr(1), $cont); |
109,7 → 113,11 |
return $m[2]; |
} |
function get_php_L_strings($cont) { |
/** |
* @param string $cont |
* @return array |
*/ |
function get_php_L_strings(string $cont): array { |
// Works only with PHP |
$out = array(); |
$tokens = token_get_all($cont); |
/trunk/dev/translation/message_regenerate.phps |
---|
158,7 → 158,11 |
# --- |
function get_js_L_strings($cont) { |
/** |
* @param string $cont |
* @return string[] |
*/ |
function get_js_L_strings(string $cont): array { |
// Works with JavaScript and PHP |
$cont = preg_replace('@/\\*.+\\*/@ismU', '', $cont); |
$cont = str_replace('\\"', chr(1), $cont); |
173,7 → 177,11 |
return $m[3]; |
} |
function get_php_L_strings($cont) { |
/** |
* @param string $cont |
* @return string[] |
*/ |
function get_php_L_strings(string $cont): array { |
// Works only with PHP |
$out = array(); |
$tokens = token_get_all($cont); |
192,7 → 200,11 |
return $out; |
} |
function test_missing_placeholder($test) { |
/** |
* @param string $test |
* @return void |
*/ |
function test_missing_placeholder(string $test) { |
$max = -1; |
for ($i=99; $i>=1; $i--) { |
if (strpos($test, '%'.$i) !== false) { |
217,7 → 229,11 |
# --- |
function phpRemoveComments($fileStr) { |
/** |
* @param string $fileStr |
* @return string |
*/ |
function phpRemoveComments(string $fileStr): string { |
// https://stackoverflow.com/questions/503871/best-way-to-automatically-remove-comments-from-php-code |
/trunk/dev/translation/show_nontranslated_code.phps |
---|
125,13 → 125,8 |
} |
$x = str_replace('(', chr(4), $x); |
$x = str_replace(')', chr(5), $x); |
/* |
if (strpos($x,"\n") !== false) echo 'DEBUG: <pre>'.htmlentities($x)."</pre>\n\n\n\n\n"; |
*/ |
return $x; |
return str_replace(')', chr(5), $x); |
}, $cont); |
$cont = preg_replace('@_L\\((\'|")(.*)\\1@smU', '_L(...', $cont); |
208,7 → 203,11 |
# --- |
function phpRemoveComments($fileStr) { |
/** |
* @param string $fileStr |
* @return string |
*/ |
function phpRemoveComments(string $fileStr): string { |
// https://stackoverflow.com/questions/503871/best-way-to-automatically-remove-comments-from-php-code |