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.
1: <piml> 2: <targetroot>/</targetroot> 3: <files> 4: <file> 5: <target dist="default"></target> 6: <perlscript mode="fg"> 7: 8: print "Checking root bash language"; 9: my $lang = `locale`; 10: if ($lang =~ "LANG=en") { 11: print "... OK\n"; 12: } else { 13: print "\n**** WARNING: You seem to have a non-english root bash. This can cause incorrect error messages.\n". 14: " It is recommended to set your bash language to English.\n"; 15: } 16: 17: my $file = "/etc/sysconfig/i18n"; 18: if (open(my $IN,'<'.$file)) { 19: print "Checking OS language"; 20: if (<$IN> =~ "LANG=\"en") { 21: print "... OK\n"; 22: } else { 23: print "\n**** WARNING: You seem to have a non-english operating system. ". 24: "It is recommended to set the language in /etc/sysconfig/i18n to English.\n"; 25: } 26: } 27: 28: </perlscript> 29: </file> 30: </files> 31: </piml>