diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2021-12-15 19:02:54 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-12-15 19:19:44 -0500 |
commit | b53d2bc4329b13069ca10f7cca980b5c94319bf5 (patch) | |
tree | 7101dd2f2ffe9bed2f4c18d8b5d864efb435561e /tools/genlang | |
parent | 651853f5df0935d717336da06c742f34bc8b0bfc (diff) | |
download | rockbox-b53d2bc4329b13069ca10f7cca980b5c94319bf5.tar.gz rockbox-b53d2bc4329b13069ca10f7cca980b5c94319bf5.zip |
languages: Fix RTL language file generation
The 'rtl' flags for Arabic and Hebrew was inadvertantly deleted
in 7ff3c94e1 (over a year ago, in November 2020!) but it's actually been
broken since the introduction of 'updatelang', in 2305966d (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
Diffstat (limited to 'tools/genlang')
-rwxr-xr-x | tools/genlang | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/genlang b/tools/genlang index 893badb57e..4f7386890d 100755 --- a/tools/genlang +++ b/tools/genlang | |||
@@ -369,6 +369,10 @@ while(<LANG>) { | |||
369 | 369 | ||
370 | if($_ =~ /^( *\#|[ \t\n\r]*\z)/) { | 370 | if($_ =~ /^( *\#|[ \t\n\r]*\z)/) { |
371 | # comment or empty line - output it if it's part of the header | 371 | # comment or empty line - output it if it's part of the header |
372 | if ($_ =~ /LANGUAGE_IS_RTL/) { | ||
373 | $langoptions |= $LANGUAGE_FLAG_RTL; | ||
374 | } | ||
375 | |||
372 | if ($header and $sortfile) { | 376 | if ($header and $sortfile) { |
373 | print($_); | 377 | print($_); |
374 | } | 378 | } |
@@ -485,12 +489,6 @@ while(<LANG>) { | |||
485 | } | 489 | } |
486 | undef @phrase; | 490 | undef @phrase; |
487 | } # end of </phrase> | 491 | } # end of </phrase> |
488 | elsif($part eq "/options") { | ||
489 | # closing the options | ||
490 | if ($options{'rtl'}) { | ||
491 | $langoptions |= $LANGUAGE_FLAG_RTL; | ||
492 | } | ||
493 | } # end of </options> | ||
494 | 492 | ||
495 | # starts with a slash, this _ends_ this section | 493 | # starts with a slash, this _ends_ this section |
496 | $m = pop @m; # get back old value, the previous level's tag | 494 | $m = pop @m; # get back old value, the previous level's tag |