Commit ff16e3f1 authored by Fernando Verdugo Arias's avatar Fernando Verdugo Arias
Browse files

Add first locales code

parent e8a6a106
#!/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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment