root/trunk/uploadr/win_installer/strsub.pl

Revision 365, 386 bytes (checked in by calh, 2 years ago)

build windows installer strings/config files from a single template, substituting strings from the locale folder. more ja-jp stuff in the makefile. convert files to utf-16 on the fly (only have utf-8 in trunk).

Line 
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 #
7 # read the catalogue
8 #
9
10 my $dict = {};
11
12 open F, $ARGV[1] or die $!;
13 while (my $line = <F>){
14
15         if ($line =~ m/^([a-z0-9_.]+)=(.*)/i){
16
17                 $dict->{$1} = $2;
18         }
19 }
20 close F;
21
22
23 #
24 # convert the file
25 #
26
27 open F, $ARGV[0] or die $!;
28 while (my $line = <F>){
29
30         $line =~ s/&(\S+);/$dict->{$1}/g;
31
32         print $line;
33 }
34 close F;
Note: See TracBrowser for help on using the browser.