mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-07-01 08:18:41 +02:00
gettext for plugin example + tools
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@179 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
29
tools/update_mo.pl
Executable file
29
tools/update_mo.pl
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
if (@ARGV!=0){
|
||||
print "USAGE update_mo.pl\n\n";
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
|
||||
foreach (readdir(DIRHANDLE)){
|
||||
if ($_ ne '..' && $_ ne '.'){
|
||||
|
||||
if(!(-l "$dir/$_")){
|
||||
if (index($_,".po",0)==length($_)-3) {
|
||||
$lang=$_;
|
||||
$lang=~s/\.po//;
|
||||
|
||||
`msgfmt locales/$_ -o locales/$lang.mo`;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
closedir DIRHANDLE;
|
||||
|
||||
#
|
||||
#
|
Reference in New Issue
Block a user