diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-07-19 08:14:09 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-07-19 08:15:31 -0400 |
commit | 130ad0a262e80761f1920e24ff41eb009ad08d7f (patch) | |
tree | c63061bf38ef323729783a8fb5df2d017d1407f8 | |
parent | 5d53c942550496b1c9359f69170e3b95cba9af50 (diff) | |
download | rockbox-130ad0a262.tar.gz rockbox-130ad0a262.zip |
voice: Have allvoices() sort voices by shortname (eg en_us)
Change-Id: Id4c8b28b09732082cb4b35b3e5f4c05874e6f83c
-rw-r--r-- | tools/builds.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/builds.pm b/tools/builds.pm index e6c6d7509e..3e5db46dd1 100644 --- a/tools/builds.pm +++ b/tools/builds.pm @@ -609,7 +609,7 @@ sub simbuilds { 'chinese-simp' => { # Mandarin? 'lang' => 'chinese-simp', 'name' => '简体中文 (Chinese Simplified)', - 'short' => 'zh_CN', + 'short' => 'zh_cn', 'defengine' => 'piper', 'engines' => { 'espeak' => '-vzh', @@ -838,14 +838,14 @@ sub simbuilds { }, ); -sub bylang { - return uc $voices{$a}{lang} cmp uc $voices{$b}{lang}; +sub byshortname { + return uc $voices{$a}{short} cmp uc $voices{$b}{short}; } sub allvoices { my @list; - for my $b (sort bylang keys %voices) { + for my $b (sort byshortname keys %voices) { push @list, $b if (defined($voices{$b}->{enabled}) && $voices{$b}->{enabled}); } @@ -856,7 +856,7 @@ sub voicesforlang($) { my $l = shift @_; my @list; - for my $b (sort bylang keys %voices) { + for my $b (sort byshortname keys %voices) { push @list, $b if ($voices{$b}{lang} eq $b && defined($voices{$b}->{enabled}) && $voices{$b}->{enabled}); } |