projects
/
platal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13bd698
)
get i18n strings from tpls
author
x2000habouzit
<x2000habouzit>
Sun, 19 Sep 2004 18:21:19 +0000
(18:21 +0000)
committer
x2000habouzit
<x2000habouzit>
Sun, 19 Sep 2004 18:21:19 +0000
(18:21 +0000)
scripts/devel/tplgettext.php
[new file with mode: 0755]
patch
|
blob
diff --git a/scripts/devel/tplgettext.php
b/scripts/devel/tplgettext.php
new file mode 100755
(executable)
index 0000000..
73c73a2
--- /dev/null
+++ b/
scripts/devel/tplgettext.php
@@ -0,0
+1,16
@@
+<?php
+ foreach($argv as $file) {
+ $fp = fopen($file,'r');
+ $fc = fread($fp,filesize($file));
+ fclose($fp);
+
+ preg_match_all('!(""".*?""")!s', $fc, $res);
+ if(count($res[1])) {
+ $fp = fopen($file.'.py','w');
+ foreach($res[1] as $l) {
+ fwrite($fp,'_('.stripslashes($l).")\n");
+ }
+ fclose($fp);
+ }
+ }
+?>