10 # raw argument parsing
11 while ($v = shift(@ARGV)) {
16 push(@path, shift(@ARGV));
19 $cache = shift(@ARGV);
36 my $a = Art5
->new( path
=> \
@path, cache
=> $cache);
38 my $c = $a->compile($s);
43 print Dumper
($c), "\n";
54 # updates all language files
56 my @lang = glob("lang_*");
58 if (scalar(@lang) == 0) {
59 print "Error: no lang_* files.\n";
63 # read now all templates in the current directory
64 # searching for translateable strings
67 foreach my $t (glob("*")) {
68 # skip language files themselves
69 if ($t =~ /lang_.*$/) {
78 my @s = ($l =~ /@\"([^\"]+)"/g);
89 my $a = Art5
->new( path
=> ['.']);
91 # now all keys in the templates must be
92 # merged into each language file
95 foreach my $l (@lang) {
96 print "Rebulding $l...\n";
98 # load and execute this template file
105 foreach my $k (sort keys(%h)) {
107 print F
"\"", ($a->{t
}->{$k} || ''), "\"\n\n";
121 Artemus 5 Command Line Interpreter
122 Copyright (C) 2000/2011 Angel Ortega <angel\@triptico.com>
131 -d Do not execute the compiled code, but dump it (using
133 -I {dir} Add {dir} to the template search path.
134 -c {dir} Use {dir} as a folder to store caching information.
135 -l Reads all templates in the current directory, extracts all
136 translateable strings and updates all templates matching
137 'lang_*' with them. To start with a new language, just
138 create an empty language file.