mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-20 10:14:33 -04:00
i18n CLI improve parsing (#4197)
https://github.com/FreshRSS/FreshRSS/pull/3932#discussion_r800043744
This commit is contained in:
1 parent
9224668285
commit
e28a2e320e
1 file changed
+12
-4
+12
-4
@@ -54,16 +54,24 @@ class I18nFile {
|
||||
$content = str_replace('<?php', '', $content);
|
||||
|
||||
$content = preg_replace([
|
||||
"#',\s*//\s*TODO#i",
|
||||
"#',\s*//\s*DIRTY#i",
|
||||
"#',\s*//\s*IGNORE#i",
|
||||
"#',\s*//\s*TODO.*#i",
|
||||
"#',\s*//\s*DIRTY.*#i",
|
||||
"#',\s*//\s*IGNORE.*#i",
|
||||
], [
|
||||
' -> todo\',',
|
||||
' -> dirty\',',
|
||||
' -> ignore\',',
|
||||
], $content);
|
||||
|
||||
$content = eval($content);
|
||||
try {
|
||||
$content = eval($content);
|
||||
} catch (ParseError $ex) {
|
||||
if (defined('STDERR')) {
|
||||
fwrite(STDERR, "Error while processing: $filename\n");
|
||||
fwrite(STDERR, $ex);
|
||||
}
|
||||
die(1);
|
||||
}
|
||||
|
||||
if (is_array($content)) {
|
||||
return $content;
|
||||
|
||||
Reference in new issue
Block a user