View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005322 | mantisbt | localization | public | 2005-03-10 07:08 | 2005-04-18 10:40 |
| Reporter | jleuzinger | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 0.19.2 | ||||
| Fixed in Version | 1.0.0a1 | ||||
| Summary | 0005322: Delete attachment shows empty text and button in German-Version | ||||
| Description | The 2 strings are not translated in German-Version. $s_delete_attachment_button = 'Löschen'; | ||||
| Tags | No tags attached. | ||||
| Attached Files | check_strings.pl.txt (1,432 bytes)
#!/usr/bin/perl -w
use Getopt::Std;
my $base_path = "/home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2";
#
# command line options
# -v more verbose output
#
getopts('v');
#
# obtain a list of files to check
#
my @lang_files = sort `find \"$base_path/lang\" -type f -name 'strings_*.txt'`;
my @source_files = sort `find \"$base_path\" -type f -name '*.php'`;
#
# examine all source files to find out which strings should be present
#
print "Reading source files...\n";
my %strings;
foreach my $source_file (@source_files)
{
chomp $source_file;
print " $source_file\n" if defined($opt_v);
my $content = `cat $source_file`;
while ($content =~ /.*lang_get\(\s*\'(.*?)\'\s*\)(.*)/)
{
$strings{$1} = 1;
$content = $2;
}
}
#
# print out a list of strings found
#
if (defined($opt_v))
{
foreach my $key (sort(keys %strings))
{
print " found label $key\n";
}
}
#
# examine all translation files
#
foreach my $lang_file (@lang_files)
{
chomp $lang_file;
print "Checking translation file $lang_file...\n";
my %cstrings = %strings;
open(LANGFILE, $lang_file);
while (my $line = <LANGFILE>)
{
if ($line =~ /\$s_(.*?)\s/)
{
print " found label $1\n" if defined($opt_v);
$cstrings{$1} = 0;
}
}
close(LANGFILE);
foreach my $key (sort(keys %cstrings))
{
if ($cstrings{$key} > 0)
{
print " missing label $key\n";
}
}
}
checklog.txt (5,371 bytes)
Reading source files... Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_chinese_simplified.txt... missing label delete_attachment_button missing label permissions_summary_report Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_chinese_traditional.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_croatian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_czech.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_danish.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_dutch.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_english.txt... Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_estonian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_finnish.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_french.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_german.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_hungarian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_italian.txt... Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_japanese_euc.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_japanese_sjis.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_japanese_utf8.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_korean.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_korean_utf8.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_latvian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_lithuanian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_norwegian.txt... missing label delete_attachment_button missing label permissions_summary_report Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_polish.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_portuguese_brazil.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_portuguese_standard.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_romanian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_russian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_russian_koi8.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_serbian.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_slovak.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_slovene.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_spanish.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_swedish.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_turkish.txt... missing label delete_attachment_button Checking translation file /home/vwegert/Entwicklung/PHP/Mantis/versions/mantis-0.19.2/lang/strings_ukrainian.txt... missing label delete_attachment_button | ||||
|
A general solution to avoid empty texts would be a fallback to the english text if the localized string is not present. |
|
|
btw: these strings are also missing in the dutch text file |
|
|
They are missing in a lot of translation files. I hacked together a small perl script that I attached to this note (had to rename the file to .txt due to upload restrictions) which obtains a list of all string labels used and checks all translation files whether every label is covered. I've attached the output, too - maybe someone can make use of it... |
|
|
Commited to CVS |
|