Return to langcheck.piml CVS log | Up to [LON-CAPA] / doc / loncapafiles |
Added a language check for root bash and OS. Non-english languages can lead to incorrect warnings. Only tested with CentOS but it should work for other distros too.
<piml> <targetroot>/</targetroot> <files> <file> <target dist="default"></target> <perlscript mode="fg"> print "Checking root bash language"; my $lang = `locale`; if ($lang =~ "LANG=en") { print "... OK\n"; } else { print "\n**** WARNING: You seem to have a non-english root bash. This can cause incorrect error messages.\n". " It is recommended to set your bash language to English.\n"; } my $file = "/etc/sysconfig/i18n"; if (open(my $IN,'<'.$file)) { print "Checking OS language"; if (<$IN> =~ "LANG=\"en") { print "... OK\n"; } else { print "\n**** WARNING: You seem to have a non-english operating system. ". "It is recommended to set the language in /etc/sysconfig/i18n to English.\n"; } } </perlscript> </file> </files> </piml>