diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/genlang | 68 |
1 files changed, 20 insertions, 48 deletions
diff --git a/tools/genlang b/tools/genlang index a5f62bf3ca..e943492067 100755 --- a/tools/genlang +++ b/tools/genlang | |||
@@ -794,7 +794,7 @@ elsif($binary || $binvoice) { | |||
794 | # loop over the target phrases | 794 | # loop over the target phrases |
795 | # This loops over the strings in the translated language file order | 795 | # This loops over the strings in the translated language file order |
796 | my @ids = ((0 .. ($idcount[$_]-1))); | 796 | my @ids = ((0 .. ($idcount[$_]-1))); |
797 | push @ids, (0x8000 .. ($voiceid[$_]-1)); | 797 | push @ids, (0x8001 .. ($voiceid[$_]-1)); |
798 | for $n (@ids) { | 798 | for $n (@ids) { |
799 | my $name=$idnum[$_][$n]; # get the ID | 799 | my $name=$idnum[$_][$n]; # get the ID |
800 | my $dest = $dest{$name}; # get the destination phrase | 800 | my $dest = $dest{$name}; # get the destination phrase |
@@ -829,66 +829,38 @@ elsif($voiceout) { | |||
829 | 829 | ||
830 | my @engl; | 830 | my @engl; |
831 | 831 | ||
832 | # This loops over the strings in the translated language file order | 832 | for (keys %users) { |
833 | my @ids = ((0 .. ($idcount[$users{"core"}]-1))); | 833 | # loop over the target phrases |
834 | push @ids, (0x8000 .. ($voiceid[$users{"core"}]-1)); | 834 | # This loops over the strings in the translated language file order |
835 | 835 | my @ids = ((0 .. ($idcount[$_]-1))); | |
836 | #for my $id (@ids) { | 836 | push @ids, (0x8001 .. ($voiceid[$_]-1)); |
837 | # print "$id\n"; | 837 | for $n (@ids) { |
838 | #} | 838 | my $name=$idnum[$_][$n]; # get the ID |
839 | 839 | my $dest = $dest{$name}; # get the destination phrase | |
840 | for $i (@ids) { | 840 | my $voice = $voice{$name}; # get the destination voice string |
841 | my $name=$idnum[$users{"core"}][$i]; # get the ID | ||
842 | my $dest = $voice{$name}; # get the destination voice string | ||
843 | |||
844 | if($dest) { | ||
845 | $dest =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes | ||
846 | |||
847 | # Now, make sure we get the number from the english sort order: | ||
848 | $idnum = $idmap[$users{"core"}]{$name}; | ||
849 | |||
850 | if(length($idnum)) { | ||
851 | $engl[$idnum] = $i; | ||
852 | 841 | ||
853 | #print "Input index $i output index $idnum\n"; | 842 | if($voice) { |
854 | } | 843 | $voice =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes |
855 | else { | 844 | # Now, make sure we get the number from the english sort order: |
856 | # not used, mark it so | 845 | $idnum = $idmap[$_]{$name}; |
857 | $engl[$i] = -1 | 846 | $engl[$idnum] = "#$idnum ($n)\nid: $name\nvoice: \"$voice\"\n"; |
858 | } | 847 | } |
859 | |||
860 | } | 848 | } |
861 | } | 849 | } |
862 | for my $i (@ids) { | 850 | # Print the list in the the English sort order |
863 | 851 | for (@engl) { | |
864 | my $o = $engl[$i]; | 852 | print $_; |
865 | |||
866 | if(($o < 0) || !length($o)) { | ||
867 | if($i < 0x8000) { | ||
868 | print "#$i\nid: NOT_USED_$i\nvoice: \"\"\n"; | ||
869 | } | ||
870 | else { | ||
871 | print "#$i\nid: VOICE_NOT_USED_$i\nvoice: \"\"\n"; | ||
872 | } | ||
873 | next; | ||
874 | } | ||
875 | |||
876 | my $name=$idnum[$users{"core"}][$o]; # get the ID | ||
877 | my $dest = $voice{$name}; # get the destination voice string | ||
878 | |||
879 | print "#$i ($o)\nid: $name\nvoice: $dest\n"; | ||
880 | } | 853 | } |
881 | |||
882 | } | 854 | } |
883 | 855 | ||
884 | 856 | ||
885 | if($verbose) { | 857 | if($verbose) { |
886 | my $num_str = 0; | 858 | my $num_str = 0; |
887 | 859 | ||
888 | for (keys %users) { | 860 | for (keys %users) { |
889 | $num_str += $idcount[$_]; | 861 | $num_str += $idcount[$_]; |
890 | } | 862 | } |
891 | 863 | ||
892 | printf("%d ID strings scanned\n", $num_str); | 864 | printf("%d ID strings scanned\n", $num_str); |
893 | 865 | ||
894 | print "* head *\n"; | 866 | print "* head *\n"; |