Skip to content

Commit

Permalink
Use reasonable default values for Windows-specific language macros
Browse files Browse the repository at this point in the history
This will prevent resources from being broken on unknown locales.
  • Loading branch information
iafan committed Feb 21, 2017
1 parent d918108 commit f1f7d86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Serge/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ sub subst_macros_strref {

my $alias = $Serge::Util::LangID::alias{$lang};
$lang = $alias if $alias;
my $h = $Serge::Util::LangID::map{$lang};
my $h = $Serge::Util::LangID::map{$lang} || $Serge::Util::LangID::map{''};
if ($h) {
my $langid = $h->{code};
$$strref =~ s/%LANGID:DEC%/$langid/ge;
Expand Down
1 change: 1 addition & 0 deletions lib/Serge/Util/LangID.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ our %alias = (
our $default_codepage = 1252; # ANSI Latin 1; Western European (Windows)

our %map = (
'' => {code => 0x0800, lang => 'LANG_SYSTEM_DEFAULT', sublang => 'SUBLANG_SYS_DEFAULT', afx => 'AFX_TARG_ENU', cp => $default_codepage}, # reasonable defaults

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

0 comments on commit f1f7d86

Please sign in to comment.