diff options
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 17 | ||||
-rw-r--r-- | Master/wingoo-demo.pl | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index de2f6255b60..2acaf622950 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -24,6 +24,7 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows TeXLive::TLWinGoo::wg_error; TeXLive::TLWinGoo::admin; + TeXLive::TLWinGoo::reg_country; TeXLive::TLWinGoo::dir_writable($d); TeXLive::TLWinGoo::expand_string($s); TeXLive::TLWinGoo::global_tmpdir; @@ -48,6 +49,7 @@ BEGIN { @EXPORT = qw( &wg_error &admin + ®_country &dir_writable &expand_string &global_tmpdir @@ -145,6 +147,21 @@ sub admin { return $is_admin; } =pod +=item C<reg_country> + +Two-letter country code representing the locale of the current user + +=cut + +sub reg_country { + my $value = $Registry -> {"CUser/Control Panel/International//Locale"}; + my $lm = $Registry -> Open("LMachine/SYSTEM/CurrentControlSet/Control/" . + "Keyboard Layout/DosKeybCodes/", {Access => sys_access_permissions()}); + return $lm -> {$value}; +} + +=pod + =item C<dir_writable> Tests whether its argument is writable by trying to write to diff --git a/Master/wingoo-demo.pl b/Master/wingoo-demo.pl index fec3ecdf48b..c73e3626d64 100644 --- a/Master/wingoo-demo.pl +++ b/Master/wingoo-demo.pl @@ -54,6 +54,10 @@ if (admin()) { print "Not admin\n"; } +# country + +print "Country: " . reg_country() . "\n"; + # global_tmpdir print "Global tempdir: " . global_tmpdir()."\n"; |