11 # raw argument parsing
12 while ($v = shift(@ARGV)) {
17 push(@path, shift(@ARGV));
20 $cache = shift(@ARGV);
37 my $a = Art5
->new( path
=> \
@path, cache
=> $cache);
39 my $c = $a->compile($s);
44 print Dumper
($c), "\n";
55 # updates all language files
57 my @lang = glob("lang_*");
59 if (scalar(@lang) == 0) {
60 print "Error: no lang_* files.\n";
64 # read now all templates in the current directory
65 # searching for translateable strings
68 foreach my $t (glob("*")) {
69 # skip language files themselves
70 if ($t =~ /lang_.*$/) {
79 my @s = ($l =~ /@\"([^\"]+)"/g);
90 my $a = Art5
->new( path
=> ['.']);
92 # now all keys in the templates must be
93 # merged into each language file
96 foreach my $l (@lang) {
97 print "Rebulding $l...\n";
99 # load and execute this template file
100 my $c = $a->code($l);
106 foreach my $k (sort keys(%h)) {
108 print F
"\"", ($a->{t
}->{$k} || ''), "\"\n\n";
122 Artemus 5 Command Line Interpreter
123 Copyright (C) 2000/2011 Angel Ortega <angel\@triptico.com>
132 -d Do not execute the compiled code, but dump it (using
134 -I {dir} Add {dir} to the template search path.
135 -c {dir} Use {dir} as a folder to store caching information.
136 -l Reads all templates in the current directory, extracts all
137 translateable strings and updates all templates matching
138 'lang_*' with them. To start with a new language, just
139 create an empty language file.