From 38a40fa09da4586092ff111c1b371890bfbc8e29 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 5 Feb 2007 19:54:10 +0000 Subject: * added check against scalar variables inside of the strings, as this causes the 'posix' translations-Module to fail * minor cleanup git-svn-id: http://svn.openslx.org/svn/openslx/trunk@682 95ad53e4-c205-0410-b2fa-d234c58c8868 --- bin/devel-tools/extractTranslations.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/devel-tools/extractTranslations.pl b/bin/devel-tools/extractTranslations.pl index 0ef7de70..88ac4ede 100755 --- a/bin/devel-tools/extractTranslations.pl +++ b/bin/devel-tools/extractTranslations.pl @@ -98,10 +98,14 @@ sub ExtractTrStrings if (!($tr =~ m[^'([^']+)'\s*(,.+?)*\s*$]os || $tr =~ m[^\"([^"]+)\"\s*(,.+?)*\s*$]os || $tr =~ m{^qq?\[([^\]]+)\]\s*(,.+?)*\s*$}os)) { - die "$File::Find::name: could not parse _tr()-argument: \n" - ."$tr\nPlease correct and retry.\n"; + die "$File::Find::name: could not parse _tr()-argument \n" + ."\t$tr\nPlease correct and retry.\n"; } $tr = $1; + if ($tr =~ m[(\$\w+)]) { + die "$File::Find::name: _tr()-argument\n\t$tr\n" + ."contains variable '$1'.\nPlease correct and retry.\n"; + } $tr =~ s[\n][\\n]g; $tr =~ s[\t][\\t]g; $translatableStrings{$tr} = $tr; @@ -122,13 +126,13 @@ sub UpdateTrModule my $text = ; close(F); if ($text !~ m[%translations\s*=\s*\(\s*(.+)\s*\);]os) { - print "\t*** No translations found (?!?) file will be skipped! ***\n"; + print "\t*** No translations found - file will be skipped! ***\n"; return; } my %translations; # evaluate the hash read from file into %translations: if (!eval "$&") { - print "\t*** translations can't be evaluated (?!?) file will be skipped! ***\n"; + print "\t*** translations can't be evaluated - file will be skipped! ***\n"; return; } my $updatedTranslations = "%translations = (\n"; -- cgit v1.2.3-55-g7522