forked from len0rd/rockbox
Some fixes for language and voice scripts:
Languages: * Get rid of leading space on LANG_ID3_VBR [ " (VBR)" ] * Fix up sole user to insert the space programmically updatelang: * strip leading and trailing spaces on all phrases except VOICE_PAUSE voice.pl * Debug logging with UTF-8 output * Explicitly delete tab character from voiced strings Change-Id: Ie466793479ce15ce7a9553770583a070530e7afd
This commit is contained in:
parent
0ea02f0268
commit
12b9419006
47 changed files with 110 additions and 106 deletions
|
@ -91,6 +91,7 @@
|
||||||
# GoGear SA9200 gogearsa9200
|
# GoGear SA9200 gogearsa9200
|
||||||
# Samsung
|
# Samsung
|
||||||
# YH820/YH920/YH925 samsungyh*
|
# YH820/YH920/YH925 samsungyh*
|
||||||
|
# First item will be shown when P2STR is passed a NULL pointer
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_ROCKBOX_TITLE
|
id: LANG_ROCKBOX_TITLE
|
||||||
desc: main menu title
|
desc: main menu title
|
||||||
|
@ -105,7 +106,6 @@
|
||||||
*: "Rockbox"
|
*: "Rockbox"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
# First item will be shown when P2STR is passed a NULL pointer
|
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SET_BOOL_YES
|
id: LANG_SET_BOOL_YES
|
||||||
desc: bool true representation
|
desc: bool true representation
|
||||||
|
@ -3524,18 +3524,15 @@
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
battery_types: ""
|
battery_types,xduoox3: ""
|
||||||
xduoox3: ""
|
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
battery_types: ""
|
battery_types,xduoox3: ""
|
||||||
xduoox3: ""
|
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
battery_types: ""
|
battery_types,xduoox3: ""
|
||||||
xduoox3: ""
|
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
|
@ -3544,18 +3541,15 @@
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
battery_types: ""
|
battery_types,xduoox3: ""
|
||||||
xduoox3: ""
|
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
battery_types: ""
|
battery_types,xduoox3: ""
|
||||||
xduoox3: ""
|
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
battery_types: ""
|
battery_types,xduoox3: ""
|
||||||
xduoox3: ""
|
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
|
@ -3688,8 +3682,8 @@
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
gigabeat*,iaudiom5,iaudiox5,ipod*,iriverh10,iriverh10_5gb,mrobe100,sansac200*,sansaclip*,sansaconnect,sansae200*,sansafuze*: "SELECT = Set"
|
|
||||||
aigoerosq,erosqnative,gogearsa9200,samsungyh*: "PLAY = Set"
|
aigoerosq,erosqnative,gogearsa9200,samsungyh*: "PLAY = Set"
|
||||||
|
gigabeat*,iaudiom5,iaudiox5,ipod*,iriverh10,iriverh10_5gb,mrobe100,sansac200*,sansaclip*,sansaconnect,sansae200*,sansafuze*: "SELECT = Set"
|
||||||
iriverh100,iriverh120,iriverh300: "NAVI = Set"
|
iriverh100,iriverh120,iriverh300: "NAVI = Set"
|
||||||
mpiohd300: "ENTER = Set"
|
mpiohd300: "ENTER = Set"
|
||||||
mrobe500: "HEART = Set"
|
mrobe500: "HEART = Set"
|
||||||
|
@ -3698,8 +3692,8 @@
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
gigabeat*,iaudiom5,iaudiox5,ipod*,iriverh10,iriverh10_5gb,mrobe100,sansac200*,sansaclip*,sansaconnect,sansae200*,sansafuze*: "SELECT = Set"
|
|
||||||
aigoerosq,erosqnative,gogearsa9200,samsungyh*: "PLAY = Set"
|
aigoerosq,erosqnative,gogearsa9200,samsungyh*: "PLAY = Set"
|
||||||
|
gigabeat*,iaudiom5,iaudiox5,ipod*,iriverh10,iriverh10_5gb,mrobe100,sansac200*,sansaclip*,sansaconnect,sansae200*,sansafuze*: "SELECT = Set"
|
||||||
iriverh100,iriverh120,iriverh300: "NAVI = Set"
|
iriverh100,iriverh120,iriverh300: "NAVI = Set"
|
||||||
mpiohd300: "ENTER = Set"
|
mpiohd300: "ENTER = Set"
|
||||||
mrobe500: "HEART = Set"
|
mrobe500: "HEART = Set"
|
||||||
|
@ -3717,8 +3711,8 @@
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
gigabeatfx,mrobe500: "POWER = Revert"
|
|
||||||
aigoerosq,erosqnative,gigabeats,sansafuzeplus: "BACK = Revert"
|
aigoerosq,erosqnative,gigabeats,sansafuzeplus: "BACK = Revert"
|
||||||
|
gigabeatfx,mrobe500: "POWER = Revert"
|
||||||
gogearsa9200: "LEFT = Revert"
|
gogearsa9200: "LEFT = Revert"
|
||||||
iaudiom5,iaudiox5: "RECORD = Revert"
|
iaudiom5,iaudiox5: "RECORD = Revert"
|
||||||
ipod*,mpiohd300,sansac200*: "MENU = Revert"
|
ipod*,mpiohd300,sansac200*: "MENU = Revert"
|
||||||
|
@ -3731,8 +3725,8 @@
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
gigabeatfx,mrobe500: "POWER = Revert"
|
|
||||||
aigoerosq,erosqnative,gigabeats,sansafuzeplus: "BACK = Revert"
|
aigoerosq,erosqnative,gigabeats,sansafuzeplus: "BACK = Revert"
|
||||||
|
gigabeatfx,mrobe500: "POWER = Revert"
|
||||||
gogearsa9200: "LEFT = Revert"
|
gogearsa9200: "LEFT = Revert"
|
||||||
iaudiom5,iaudiox5: "RECORD = Revert"
|
iaudiom5,iaudiox5: "RECORD = Revert"
|
||||||
ipod*,mpiohd300,sansac200*: "MENU = Revert"
|
ipod*,mpiohd300,sansac200*: "MENU = Revert"
|
||||||
|
@ -6994,7 +6988,6 @@
|
||||||
*: "Add Current to Shortcuts"
|
*: "Add Current to Shortcuts"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_PITCH
|
id: LANG_PITCH
|
||||||
desc: "pitch" in the pitch screen
|
desc: "pitch" in the pitch screen
|
||||||
|
@ -16998,15 +16991,15 @@
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lineout_poweroff,erosqnative: "Line Out"
|
erosqnative,lineout_poweroff: "Line Out"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lineout_poweroff,erosqnative: "Line Out"
|
erosqnative,lineout_poweroff: "Line Out"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lineout_poweroff,erosqnative: "Line Out"
|
erosqnative,lineout_poweroff: "Line Out"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
|
|
|
@ -666,7 +666,8 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
|
||||||
case LANG_ID3_BITRATE:
|
case LANG_ID3_BITRATE:
|
||||||
if (!id3->bitrate)
|
if (!id3->bitrate)
|
||||||
return NULL;
|
return NULL;
|
||||||
snprintf(buffer, buffer_len, "%d kbps%s", id3->bitrate,
|
snprintf(buffer, buffer_len, "%d kbps%s%s", id3->bitrate,
|
||||||
|
id3->vbr ? " " : "",
|
||||||
id3->vbr ? str(LANG_ID3_VBR) : (const unsigned char*) "");
|
id3->vbr ? str(LANG_ID3_VBR) : (const unsigned char*) "");
|
||||||
val=buffer;
|
val=buffer;
|
||||||
if(say_it)
|
if(say_it)
|
||||||
|
|
|
@ -20,6 +20,7 @@ sub trim {
|
||||||
my ($string) = @_;
|
my ($string) = @_;
|
||||||
$string =~ s/^\s+//;
|
$string =~ s/^\s+//;
|
||||||
$string =~ s/\s+$//;
|
$string =~ s/\s+$//;
|
||||||
|
$string =~ tr/\t//d;
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +62,13 @@ sub parselangfile {
|
||||||
}
|
}
|
||||||
} elsif ($pos ne 'phrase' && $line =~ /^([^:]+): ?\"?([^\"]*)\"?$/) {
|
} elsif ($pos ne 'phrase' && $line =~ /^([^:]+): ?\"?([^\"]*)\"?$/) {
|
||||||
my @targets = split(',', $1);
|
my @targets = split(',', $1);
|
||||||
my $w = $2;
|
my $w;
|
||||||
|
|
||||||
|
if ($id ne 'VOICE_PAUSE') {
|
||||||
|
$w = trim($2);
|
||||||
|
} else {
|
||||||
|
$w = $2;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (@targets) {
|
foreach (@targets) {
|
||||||
my $l = trim($_);
|
my $l = trim($_);
|
||||||
|
|
|
@ -698,6 +698,9 @@ if (defined($v) or defined($ENV{'V'})) {
|
||||||
# add the tools dir to the path temporarily, for calling various tools
|
# add the tools dir to the path temporarily, for calling various tools
|
||||||
$ENV{'PATH'} = dirname($0) . ':' . $ENV{'PATH'};
|
$ENV{'PATH'} = dirname($0) . ':' . $ENV{'PATH'};
|
||||||
|
|
||||||
|
# logging needs to be UTF8
|
||||||
|
binmode(*STDOUT, ':encoding(utf8)');
|
||||||
|
|
||||||
my $tts_object = init_tts($s, $S, $l);
|
my $tts_object = init_tts($s, $S, $l);
|
||||||
|
|
||||||
# Do what we're told
|
# Do what we're told
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue