mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
languages: Fix RTL language file generation
The 'rtl' flags for Arabic and Hebrew was inadvertantly deleted in7ff3c94e1
(over a year ago, in November 2020!) but it's actually been broken since the introduction of 'updatelang', in2305966d
(July 2020) The fix here is to change the 'RTL' flag from an <options> section in the language file to a comment in the header. It's not as pure in a design sense but it makes for a much cleaner implementation. I may further revamp this by making the 'RTL' flag into an explicit LANG_xxx string Change-Id: I48f394adfadc0aa804fd67690c87cc28f04fccdc
This commit is contained in:
parent
651853f5df
commit
b53d2bc432
3 changed files with 8 additions and 6 deletions
|
@ -14,6 +14,8 @@
|
||||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
# KIND, either express or implied.
|
# KIND, either express or implied.
|
||||||
#
|
#
|
||||||
|
# LANGUAGE_IS_RTL
|
||||||
|
#
|
||||||
# Arabic language file, translated by:
|
# Arabic language file, translated by:
|
||||||
# - Mohamed Tarek
|
# - Mohamed Tarek
|
||||||
# - Raafat Akkad
|
# - Raafat Akkad
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
# KIND, either express or implied.
|
# KIND, either express or implied.
|
||||||
#
|
#
|
||||||
|
# LANGUAGE_IS_RTL
|
||||||
|
#
|
||||||
# Hebrew language file, translated by:
|
# Hebrew language file, translated by:
|
||||||
# - Ariel Saghiv
|
# - Ariel Saghiv
|
||||||
# - Liberman Shachar
|
# - Liberman Shachar
|
||||||
|
|
|
@ -369,6 +369,10 @@ while(<LANG>) {
|
||||||
|
|
||||||
if($_ =~ /^( *\#|[ \t\n\r]*\z)/) {
|
if($_ =~ /^( *\#|[ \t\n\r]*\z)/) {
|
||||||
# comment or empty line - output it if it's part of the header
|
# comment or empty line - output it if it's part of the header
|
||||||
|
if ($_ =~ /LANGUAGE_IS_RTL/) {
|
||||||
|
$langoptions |= $LANGUAGE_FLAG_RTL;
|
||||||
|
}
|
||||||
|
|
||||||
if ($header and $sortfile) {
|
if ($header and $sortfile) {
|
||||||
print($_);
|
print($_);
|
||||||
}
|
}
|
||||||
|
@ -485,12 +489,6 @@ while(<LANG>) {
|
||||||
}
|
}
|
||||||
undef @phrase;
|
undef @phrase;
|
||||||
} # end of </phrase>
|
} # end of </phrase>
|
||||||
elsif($part eq "/options") {
|
|
||||||
# closing the options
|
|
||||||
if ($options{'rtl'}) {
|
|
||||||
$langoptions |= $LANGUAGE_FLAG_RTL;
|
|
||||||
}
|
|
||||||
} # end of </options>
|
|
||||||
|
|
||||||
# starts with a slash, this _ends_ this section
|
# starts with a slash, this _ends_ this section
|
||||||
$m = pop @m; # get back old value, the previous level's tag
|
$m = pop @m; # get back old value, the previous level's tag
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue