d8385c2cfc
It was discovered that on a Russian Windows, by default only Russian and
German dictionaries would be installed, but no English dictionary. This is
because since e2fac98819
"fdo#53009: For msi
installer, only default-select a subset of dictionaries" only those dictionaries
mentioned in setup_native/source/packinfo/spellchecker_selection.txt were
default-selected, but it apparently was a misunderstanding that
spellcheker_selection.txt for many locales does not list "en" even though an
English dictionary should always be default-installed.
Quoting Andras Timar <atimar@suse.com>: "AFAIK en-US localization with English
dictionaries is always installed in all 3 supported platforms by default. On
Windows default install should always select en-US and English dictionaries. If
it does not do so under certain circumstances, then it is a bug in my opinion.
We removed en-US entry from the spellchecker selection file for this very
reason. It would have only bloated Mac and Linux langpacks."
So this fix simply makes sure that "en" is included in every line of the
generated spellchecker_selection.hxx that is used by
setup_native/source/win32/customactions/sellang/sellang.cxx to determine which
dictionaries to select by default.
Change-Id: I3db68585dc6269a7db2f6cbf6b79796dc09d05e8
69 lines
1.6 KiB
Prolog
69 lines
1.6 KiB
Prolog
#
|
|
# This file is part of the LibreOffice project.
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
|
|
use List::Util qw[max];
|
|
|
|
@ARGV == 0 or die 'Usage: translates from stdin to stdout';
|
|
|
|
my %map = ();
|
|
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 \"$_\"";
|
|
my $lang = $1;
|
|
$lang =~ tr/-/_/;
|
|
my $dicts = $2;
|
|
$dicts =~ tr/-/_/;
|
|
!exists($map{$lang}) or die "duplicate values for $lang";
|
|
if ($dicts eq 'EMPTY') {
|
|
@{$map{$lang}} = ();
|
|
} else {
|
|
@{$map{$lang}} = split(/,/, $dicts);
|
|
}
|
|
push(@{$map{$lang}}, ('en')) unless grep($_ eq 'en', @{$map{$lang}});
|
|
$max = max($max, scalar(@{$map{$lang}}));
|
|
}
|
|
|
|
++$max;
|
|
|
|
print <<EOF;
|
|
// generated by setup_native/source/packinfo/spellchecker_selection.pl
|
|
|
|
#ifndef INCLUDED_SETUP_NATIVE_SOURCE_PACKINFO_SPELLCHECKER_SELECTION_HXX
|
|
#define INCLUDED_SETUP_NATIVE_SOURCE_PACKINFO_SPELLCHECKER_SELECTION_HXX
|
|
|
|
#include "sal/config.h"
|
|
|
|
namespace setup_native {
|
|
|
|
struct LanguageDictionaries {
|
|
char const * language;
|
|
char const * dictionaries[$max];
|
|
};
|
|
|
|
LanguageDictionaries const languageDictionaries[] = {
|
|
EOF
|
|
|
|
foreach $i (sort(keys(%map))) {
|
|
print(" { \"$i\", {");
|
|
foreach $j (sort(@{$map{$i}})) {
|
|
print(" \"$j\",");
|
|
}
|
|
print(" 0 } },\n");
|
|
}
|
|
|
|
print <<EOF;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
EOF
|