Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
ff16e3f1
Commit
ff16e3f1
authored
Dec 16, 2016
by
Fernando Verdugo Arias
Browse files
Add first locales code
parent
e8a6a106
Changes
1
Hide whitespace changes
Inline
Side-by-side
rvd_front.pl
View file @
ff16e3f1
#!/usr/bin/env perl
use
warnings
;
use
strict
;
#####
use
locale
'
:not_characters
';
#####
use
Carp
qw(confess)
;
use
Data::
Dumper
;
use
Getopt::
Long
;
use
Hash::
Util
qw(lock_hash)
;
use
Mojolicious::
Lite
;
use
Mojolicious::
Lite
'
Ravada::I18N
';
#####
my
$self
->
plugin
('
I18N
');
plugin
I18N
=>
{
namespace
=>
'
Ravada::I18N
',
support_url_langs
=>
[
qw(en)
]};
package
Ravada::I18N::
en
;
#####
use
YAML
qw(LoadFile)
;
use
lib
'
lib
';
...
...
@@ -17,6 +25,31 @@ use Ravada::Auth;
my
$help
;
my
$FILE_CONFIG
=
"
/etc/ravada.conf
";
#####
#####
#####
# Import locale-handling tool set from POSIX module.
# This example uses: setlocale -- the function call
# LC_CTYPE -- explained below
use
POSIX
qw(locale_h)
;
# query and save the old locale
my
$old_locale
=
setlocale
(
LC_CTYPE
);
setlocale
(
LC_CTYPE
,
"
en_US.ISO8859-1
");
# LC_CTYPE now in locale "English, US, codeset ISO 8859-1"
setlocale
(
LC_CTYPE
,
"");
# LC_CTYPE now reset to default defined by LC_ALL/LC_CTYPE/LANG
# environment variables. See below for documentation.
# restore the old locale
setlocale
(
LC_CTYPE
,
$old_locale
);
#####
#####
#####
GetOptions
(
'
config=s
'
=>
\
$FILE_CONFIG
,
help
=>
\
$help
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment