Thumbnail file hits. Based on a patch from D Bera
[beagle.git] / Tiles / extract-translations.pl
blobe3f3db4c5c23993083aa922cd690fef894aef576
1 #!/usr/bin/perl -w
3 opendir(DIR, ".");
4 @files = grep(/\.html$/,readdir(DIR));
5 closedir(DIR);
7 open (OUTPUT, ">TranslationHack.cs");
9 print OUTPUT "using Mono.Posix;\n\npublic class TranslationHack {\n\tprivate void NotToBecalled () {\n";
11 foreach $file (@files) {
12 open (TEMPLATE, $file);
13 while ($data = <TEMPLATE>) {
14 @matches = ($data =~ m/\@text\%([^@]*)\@/g);
16 for ($i = 0; $i < scalar (@matches); $i++) {
17 print OUTPUT "\t\t/* For translators: From template Tiles/$file */\n";
18 print OUTPUT "\t\tCatalog.GetString (\"$matches[$i]\");\n";
23 print OUTPUT "\t}\n}\n";
24 close (OUTPUT)