From 530bc16679855ae230f63673194077b4b8b3f673 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 28 Jul 2020 11:11:30 -0400 Subject: [PATCH] updatelang: Extract langstr ignore list into a separate file so it can be shared Change-Id: I4b77e1fe435e1f02df665f18e69b5c1db0a2e0b5 --- tools/langignorelist.txt | 74 ++++++++++++++++++++++++++++ tools/updatelang | 101 +++++++-------------------------------- 2 files changed, 91 insertions(+), 84 deletions(-) create mode 100644 tools/langignorelist.txt diff --git a/tools/langignorelist.txt b/tools/langignorelist.txt new file mode 100644 index 0000000000..bba069b7e5 --- /dev/null +++ b/tools/langignorelist.txt @@ -0,0 +1,74 @@ +# This file containes LANG_IDs for which it is okay to be +# identical to their English source. +# one LANG_ or VOICE_ per line, no whitespace! +LANG_SERIAL_BITRATE_9600 +LANG_SERIAL_BITRATE_19200 +LANG_SERIAL_BITRATE_38400 +LANG_SERIAL_BITRATE_57600 +LANG_COMPRESSOR_RATIO_10 +LANG_COMPRESSOR_RATIO_2 +LANG_COMPRESSOR_RATIO_6 +LANG_COMPRESSOR_RATIO_4 +LANG_ROCKBOX_TITLE +LANG_EQUALIZER_BAND_Q +LANG_FM_DEFAULT_PRESET_NAME +LANG_COLOR_RGB_LABELS +LANG_BYTE +LANG_KIBIBYTE +LANG_GIBIBYTE +LANG_USB_HID +VOICE_ZERO +VOICE_ONE +VOICE_TWO +VOICE_THREE +VOICE_FOUR +VOICE_FIVE +VOICE_SIX +VOICE_SEVEN +VOICE_EIGHT +VOICE_NINE +VOICE_TEN +VOICE_ELEVEN +VOICE_TWELVE +VOICE_THIRTEEN +VOICE_FOURTEEN +VOICE_FIFTEEN +VOICE_SIXTEEN +VOICE_SEVENTEEN +VOICE_EIGHTEEN +VOICE_NINETEEN +VOICE_TWENTY +VOICE_THIRTY +VOICE_FORTY +VOICE_FIFTY +VOICE_SIXTY +VOICE_SEVENTY +VOICE_EIGHTY +VOICE_NINETY +VOICE_CHAR_A +VOICE_CHAR_B +VOICE_CHAR_C +VOICE_CHAR_D +VOICE_CHAR_E +VOICE_CHAR_F +VOICE_CHAR_G +VOICE_CHAR_H +VOICE_CHAR_I +VOICE_CHAR_J +VOICE_CHAR_K +VOICE_CHAR_L +VOICE_CHAR_M +VOICE_CHAR_N +VOICE_CHAR_O +VOICE_CHAR_P +VOICE_CHAR_Q +VOICE_CHAR_R +VOICE_CHAR_S +VOICE_CHAR_T +VOICE_CHAR_U +VOICE_CHAR_V +VOICE_CHAR_W +VOICE_CHAR_X +VOICE_CHAR_Y +VOICE_CHAR_Z +VOICE_PAUSE diff --git a/tools/updatelang b/tools/updatelang index 7f7de59686..5072ed6a07 100755 --- a/tools/updatelang +++ b/tools/updatelang @@ -111,93 +111,10 @@ sub combinetgts { return %combined; } -my @ignorelist = split("\n", -"LANG_SERIAL_BITRATE_19200 -LANG_SERIAL_BITRATE_9600 -LANG_SERIAL_BITRATE_38400 -LANG_SERIAL_BITRATE_57600 -LANG_COMPRESSOR_RATIO_10 -LANG_COMPRESSOR_RATIO_2 -LANG_COMPRESSOR_RATIO_6 -LANG_COMPRESSOR_RATIO_4 -LANG_ROCKBOX_TITLE -LANG_EQUALIZER_BAND_Q -LANG_FM_DEFAULT_PRESET_NAME -LANG_DISK_NAME_MMC -LANG_COLOR_RGB_LABELS -LANG_BYTE -LANG_KIBIBYTE -LANG_GIBIBYTE -LANG_USB_HID -VOICE_ZERO -VOICE_ONE -VOICE_TWO -VOICE_THREE -VOICE_FOUR -VOICE_FIVE -VOICE_SIX -VOICE_SEVEN -VOICE_EIGHT -VOICE_NINE -VOICE_TEN -VOICE_ELEVEN -VOICE_TWELVE -VOICE_THIRTEEN -VOICE_FOURTEEN -VOICE_FIFTEEN -VOICE_SIXTEEN -VOICE_SEVENTEEN -VOICE_EIGHTEEN -VOICE_NINETEEN -VOICE_TWENTY -VOICE_THIRTY -VOICE_FORTY -VOICE_FIFTY -VOICE_SIXTY -VOICE_SEVENTY -VOICE_EIGHTY -VOICE_NINETY -VOICE_CHAR_A -VOICE_CHAR_B -VOICE_CHAR_C -VOICE_CHAR_D -VOICE_CHAR_E -VOICE_CHAR_F -VOICE_CHAR_G -VOICE_CHAR_H -VOICE_CHAR_I -VOICE_CHAR_J -VOICE_CHAR_K -VOICE_CHAR_L -VOICE_CHAR_M -VOICE_CHAR_N -VOICE_CHAR_O -VOICE_CHAR_P -VOICE_CHAR_Q -VOICE_CHAR_R -VOICE_CHAR_S -VOICE_CHAR_T -VOICE_CHAR_U -VOICE_CHAR_V -VOICE_CHAR_W -VOICE_CHAR_X -VOICE_CHAR_Y -VOICE_CHAR_Z -VOICE_PAUSE"); - -sub not_ignorelist { - my ($key) = @_; - foreach (@ignorelist) { - if ($_ eq $key) { - return 0; - } - } - return 1; -} ################## if($#ARGV != 2) { - print "Usage: updatelang [|-]\n"; + print "Usage: updatelang \n"; exit; } @@ -223,6 +140,22 @@ my $f1 = $tmp[0]; my $f2 = $tmp[0]; undef @tmp; +# Read in ignore list +my $igname = dirname($0) . "/langignorelist.txt"; +open (FH, "<$igname") || die ("Can't open $igname!"); +my @ignorelist = ; +close (FH); +sub not_ignorelist { + my ($key) = @_; + foreach (@ignorelist) { + if ($_ eq $key) { + return 0; + } + } + return 1; +} +undef $igname; + # Do we care about notes? my $printnotes = 1; my $ignoredups = 0;