Translation tools, and first set of translations (all function names)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@670 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-03-13 21:51:32 +00:00
parent b347f5e04b
commit f30316612e
5 changed files with 2739 additions and 0 deletions

View File

@ -0,0 +1,13 @@
List functions and global variables
nm -Cg --defined-only obj/win32/*.o | grep "^0" | cut -c 12- | sort -u
List variables, parameters, struct members. Requires french.txt to remove duplicates.
perl -ne 'while ($_ =~ /\b(int|char|word|byte|float|double|short|long|Fenetre_Bouton_dropdown|Composantes|S_Mode_video|Fenetre_Bouton_normal|Fenetre_Bouton_palette|Fenetre_Bouton_scroller|Fenetre_Bouton_special|T_Shade|T_Degrade_Tableau|Element_de_liste_de_fileselect|S_ConfigTouche|T_Format|Table_conversion|Table_occurence|cluster|ClusterSet|Degrade|DegradeSet|T_Palette|Bouton_dropdown_choix|T_TABLEAIDE|Section_d_aide|T_Degrade_Tableau|T_Shade|Config_Mode_video|Config_Header|Config_Chunk|Config_Infos_touche|S_Page|S_Liste_de_pages|T_FONTE|statfs|S_Libelle_touche|POLYGON_EDGE)\s+(\*)?(\s)*(\w+)/g) { print "$4\n";}' *.c *.h | sort -u | comm -2 -3 - french.txt
List macros (not starting with _)
perl -ne 'if ($_ =~ /^\s*#define ([^_]\w+)/) { print "$1\n"; }' *.h *.c | sort -u
Translate some source files
./translate.pl *.c *.h

1337
translat/english.txt Normal file

File diff suppressed because it is too large Load Diff

1337
translat/french.txt Normal file

File diff suppressed because it is too large Load Diff

52
translat/translate.pl Normal file
View File

@ -0,0 +1,52 @@
#!/usr/bin/perl
# Translate words in file(s) given on command-line. Saves older as .bak
# The dictionary is read as 2 files, french.txt and english.txt
# Method: regexp search, ^word then ^non-word then ^word then ...
# Each word is translated according to a hash dictionary
# Released to public domain.
unless ( open (FRENCH, "french.txt")) {
die "Impossible to open 'french.txt' file.\n";
}
unless ( open (ENGLISH, "english.txt")) {
die "Impossible to open 'english.txt' file.\n";
}
# Build french->english dictionary (a hash)
while(($french = <FRENCH>) & ($english=<ENGLISH>)){
chop($french);
chop($english);
if ("$french" ne "$english")
{
$dictionary{$french} = $english;
}
}
#foreach $name (@ARGV) {
#print "$name";
$^I = ".bak";
# Read input
while ($line = <>){
chop $line;
while ($line ne "") {
# word
if ($line =~ m/^(\w+)(.*)$/) {
if (defined $dictionary{$1}) {
print $dictionary{$1};
}
else {
print "$1";
}
$line=$2;
}
# non-word
if ($line =~ m/^([^\w]+)(.*)$/) {
print "$1";
$line=$2;
}
}
print "\n";
}
#}

BIN
translat/translations.xls Normal file

Binary file not shown.