Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools/create_nsis_translations.pl
diff options
context:
space:
mode:
authorBruno Coudoin <bruno.coudoin@free.fr>2009-07-19 21:02:48 (GMT)
committer Bruno Coudoin <bruno.coudoin@free.fr>2009-07-19 21:02:48 (GMT)
commit730ba9fff70dbed35b702daed705eced7e71da2d (patch)
treed6ee6e292abe4b6a0d33140898792e843c3493a7 /tools/create_nsis_translations.pl
parentd4b5409384ad66e99f0521ada71ae98b0617b4fa (diff)
Completed the nsis translation tool.
Diffstat (limited to 'tools/create_nsis_translations.pl')
-rwxr-xr-xtools/create_nsis_translations.pl32
1 files changed, 28 insertions, 4 deletions
diff --git a/tools/create_nsis_translations.pl b/tools/create_nsis_translations.pl
index cac80b6..ed43b6d 100755
--- a/tools/create_nsis_translations.pl
+++ b/tools/create_nsis_translations.pl
@@ -85,8 +85,6 @@ foreach my $lang (@localeKeys) {
$muiLanguages .= " !insertmacro MUI_LANGUAGE \"$localeNames{$lang}\"\n";
}
-print $muiLanguages;
-
# The specific GCompris translation for the installer
# replacing:
# @GCOMPRIS_MACRO_INCLUDE_LANGFILE@
@@ -100,12 +98,38 @@ foreach my $lang (@localeKeys) {
"\"\${GCOMPRIS_NSIS_INCLUDE_PATH}\\translations\\$lang.nsh\"\n";
}
-print $gcomprisLanguages;
+# We have all the data, let's replace it
+my $gcomprisInstaller;
+open (MYFILE, 'gcompris-installer.nsi');
+while (<MYFILE>) {
+ if ($_ =~ /\@INSERTMACRO_MUI_LANGUAGE\@/)
+ {
+ print "Processing \@INSERTMACRO_MUI_LANGUAGE\@\n";
+ $gcomprisInstaller .= $muiLanguages;
+ }
+ elsif ($_ =~ /\@GCOMPRIS_MACRO_INCLUDE_LANGFILE\@/)
+ {
+ print "Processing \@GCOMPRIS_MACRO_INCLUDE_LANGFILE\@\n";
+ $gcomprisInstaller .= $gcomprisLanguages;
+ }
+ else
+ {
+ $gcomprisInstaller .= "$_";
+ }
+}
+close (MYFILE);
+
+# Rewrite the file with the replaced data
+open (MYFILE, '>gcompris-installer.nsi');
+print MYFILE "$gcomprisInstaller";
+close (MYFILE);
# Create each nsh translation file
+print "Creating each nsh file\n";
+
foreach my $lang (@localeKeys) {
- open (DESC, ">nsis/tt/$lang.nsh");
+ open (DESC, ">nsis/translations/$lang.nsh");
print DESC ";; Auto generated file by create_nsis_translations.pl\n";
# Extract the string to translate from the nsis_translations file