summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-09-02 13:56:51 +0200
committerEike Rathke <erack@redhat.com>2013-09-02 13:58:56 +0200
commit81c54e607b1e79f20b35ca6f57ec2da8ed4185dd (patch)
treef7c566ba8eec4dde2b61fcb4a5a0f881d7314db4 /setup_native
parentf408102bd4befffa0a5a07d00cf7a79376566b3c (diff)
prepare to accept partial BCP47 (lll-Ssss-CC-vvvvvvvv)
Change-Id: I3c65cb43696a829f29ab573b7b6e424a39d1a547
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/source/packinfo/spellchecker_selection.pl11
-rw-r--r--setup_native/source/win32/customactions/sellang/sellang.cxx6
2 files changed, 13 insertions, 4 deletions
diff --git a/setup_native/source/packinfo/spellchecker_selection.pl b/setup_native/source/packinfo/spellchecker_selection.pl
index 87f7cc204dcb..31750139743f 100644
--- a/setup_native/source/packinfo/spellchecker_selection.pl
+++ b/setup_native/source/packinfo/spellchecker_selection.pl
@@ -15,9 +15,14 @@ my $max = 0;
while (<>) {
next if /^\s*(#.*)?$/;
- /^ \s* ([a-z]{2}(?:-[A-Z]{2})?) \s* = \s*
- \"(EMPTY|[a-z]{2}(?:-[A-Z]{2})?(?:,[a-z]{2}(?:-[A-Z]{2})?)*)\" \s* $/x
- or die "bad input line \"$_\"";
+ # Accept combinations of lll-Ssss-CC-vvvvvvvv
+ # XXX NOTE: when changing this also adapt
+ # setup_native/source/win32/customactions/sellang/sellang.cxx
+ # struct InstallLocalized{ char lang[sizeof(...)]; }
+ /^ \s* ([a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?(?:-[a-z]{5,8})?) \s* = \s*
+ \"(EMPTY|[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?(?:-[a-z]{5,8})?
+ (?:,[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?(?:-[a-z]{5,8})?)*)\" \s* $/x
+ or die "unexpected input line \"$_\"";
my $lang = $1;
$lang =~ tr/-/_/;
my $dicts = $2;
diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx
index b6f7ec559ea0..06c4c029a4e6 100644
--- a/setup_native/source/win32/customactions/sellang/sellang.cxx
+++ b/setup_native/source/win32/customactions/sellang/sellang.cxx
@@ -202,8 +202,12 @@ present_in_ui_langs(const char *lang)
namespace {
+/* TODO-BCP47: unlimit this, and if possible change from '_' to '-' separator
+ * to ease things. */
+// XXX NOTE: the sizeof needs to follow what is accepted in
+// setup_native/source/packinfo/spellchecker_selection.pl
struct InstallLocalized {
- char lang[sizeof("xx_XX")];
+ char lang[sizeof("lll_Ssss_CC_vvvvvvvv")];
bool install;
};