Skip to content

Commit 4625afa

Browse files
committed
Use reasonable default values for Windows-specific language macros
This will prevent resources from being broken on unknown locales.
1 parent d918108 commit 4625afa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/Serge/Util.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ sub subst_macros_strref {
349349

350350
my $alias = $Serge::Util::LangID::alias{$lang};
351351
$lang = $alias if $alias;
352-
my $h = $Serge::Util::LangID::map{$lang};
352+
my $h = $Serge::Util::LangID::map{$lang} || $Serge::Util::LangID::map{''};
353353
if ($h) {
354354
my $langid = $h->{code};
355355
$$strref =~ s/%LANGID:DEC%/$langid/ge;

lib/Serge/Util/LangID.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ our %alias = (
3535
our $default_codepage = 1252; # ANSI Latin 1; Western European (Windows)
3636

3737
our %map = (
38+
'' => {code => 0x0000, lang => 'LANG_NEUTRAL', sublang => 'SUBLANG_NEUTRAL', afx => 'AFX_TARG_ENU', cp => $default_codepage}, # reasonable defaults
3839

3940
'af' => {code => 0x0436, lang => 'LANG_AFRIKAANS', sublang => 'SUBLANG_AFRIKAANS_SOUTH_AFRICA', afx => 'AFX_TARG_AFK'}, # <AFK> <Afrikaans> <Afrikaans>
4041
'sq' => {code => 0x041c, lang => 'LANG_ALBANIAN', sublang => 'SUBLANG_ALBANIAN_ALBANIA', afx => 'AFX_TARG_SQI'}, # <SQI> <Albanian> <Albanian>

0 commit comments

Comments
 (0)