Commit 597897e7 authored by sympa-authors's avatar sympa-authors
Browse files

Change: now use meta information from the PO headers (language, charset,...

Change: now use meta information from the PO headers (language, charset, encoding). Added a gettext() subroutine in Language to bypass gettext() if _xxx_ meta information are requested


git-svn-id: https://subversion.renater.fr/sympa/trunk@2438 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 3a33ab38
This diff is collapsed.
......@@ -21,7 +21,7 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Deutsch\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
......
......@@ -10,9 +10,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: English\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=us-ascii\n"
"Content-Transfer-Encoding: 8bit\n"
#. (from_count)
......
......@@ -21,7 +21,7 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Espaol\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
......
......@@ -21,9 +21,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Estonian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Type: text/plain; charset=iso-8859-4\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# et.po (PACKAGE VERSION) #-#-#-#-#\n"
"#-#-#-#-# et.po (PACKAGE VERSION) #-#-#-#-#\n"
......
......@@ -16,9 +16,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Finnish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# fi.po (PACKAGE VERSION) #-#-#-#-#\n"
"#-#-#-#-# fi.po (PACKAGE VERSION) #-#-#-#-#\n"
......
......@@ -21,9 +21,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Italiano\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# it.po (PACKAGE VERSION) #-#-#-#-#\n"
"#-#-#-#-# it.po (PACKAGE VERSION) #-#-#-#-#\n"
......
......@@ -21,9 +21,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Nederlands\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# nl.po (PACKAGE VERSION) #-#-#-#-#\n"
"#-#-#-#-# nl.po (PACKAGE VERSION) #-#-#-#-#\n"
......
This diff is collapsed.
......@@ -10,9 +10,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Portugese\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#. (from_count)
......
......@@ -16,9 +16,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Romana\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso_8859-1\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# ro.po (PACKAGE VERSION) #-#-#-#-#\n"
"#-#-#-#-# ro.po (PACKAGE VERSION) #-#-#-#-#\n"
......
......@@ -10,9 +10,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: English\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=us-ascii\n"
"Content-Transfer-Encoding: 8bit\n"
#: wwsympa/tt2/arcsearch.tt2:65
......@@ -252,10 +252,6 @@ msgstr ""
msgid "6 hours"
msgstr ""
#: src/Commands.pm:1752 src/etc/tt2/digest.tt2:10 src/etc/tt2/digest.tt2:36 src/etc/tt2/digest_plain.tt2:6 src/etc/tt2/moderate.tt2:10 src/etc/tt2/urlized_part.tt2:3 src/mail.pm:128 src/mail.pm:229 src/mail.pm:90 src/sympa.pl:1063 src/sympa.pl:1314 src/sympa.pl:779 src/sympa.pl:990 src/tools.pl:131
msgid "7bit"
msgstr ""
#: wwsympa/tt2/help.tt2:22
msgid ": Login / Logout from WWSympa."
msgstr ""
......@@ -4143,10 +4139,6 @@ msgstr ""
msgid "email2@dom2 Name2"
msgstr ""
#: wwsympa/wwsympa.fcgi:6288 wwsympa/wwsympa.fcgi:797
msgid "english"
msgstr ""
#: wwsympa/tt2/arcsearch_form.tt2:44
msgid "entire word"
msgstr ""
......@@ -4705,10 +4697,6 @@ msgstr ""
msgid "unsubscription message"
msgstr ""
#: src/Commands.pm:1751 src/etc/tt2/digest.tt2:9 src/etc/tt2/digest_plain.tt2:5 src/etc/tt2/urlized_part.tt2:1 src/mail.pm:127 src/mail.pm:228 src/mail.pm:77 src/mail.pm:89 src/sympa.pl:1062 src/sympa.pl:1312 src/sympa.pl:778 src/sympa.pl:989 src/tools.pl:130 src/tt2native.pl:27 wwsympa/tt2/main.tt2:6
msgid "us-ascii"
msgstr ""
#: src/List.pm:851 wwsympa/tt2/help_editlist.tt2:132
msgid "value"
msgstr ""
......
......@@ -16,7 +16,7 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Chinese\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......
......@@ -16,9 +16,9 @@ msgstr ""
"POT-Creation-Date: 2002-07-16 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: Chinese (Taiwan)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Type: text/plain; charset=cn-big5\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# tw.po (PACKAGE VERSION) #-#-#-#-#\n"
"#-#-#-#-# zh_TW.po (PACKAGE VERSION) #-#-#-#-#\n"
......
......@@ -29,8 +29,8 @@ use Carp;
use strict;
use Log;
use Version;
use Locale::Messages qw (:locale_h :libintl_h);
use POSIX qw (setlocale);
use Locale::Messages qw (:locale_h :libintl_h);
my %msghash; # Hash organization is like Messages file: File>>Sections>>Messages
my %set_comment; #sets-of-messages comment
......@@ -100,8 +100,8 @@ sub SetLang {
&do_log('err','Failed to setlocale(%s)', $locale);
return undef;
}
textdomain "sympa";
bindtextdomain sympa => '--DIR--/locale';
&Locale::Messages::textdomain("sympa");
&Locale::Messages::bindtextdomain('sympa','--DIR--/locale');
#bind_textdomain_codeset sympa => 'iso-8859-1';
$current_lang = $lang;
......@@ -134,5 +134,35 @@ sub maketext {
return $translation;
}
sub gettext {
## This prevents meta information to be returned if the string to translate is empty
if ($_[0] eq '') {
return '';
## return meta information on the catalogue (language, charset, encoding,...)
}elsif ($_[0] =~ '^_(\w+)_$') {
my $var = $1;
foreach (split /\n/,&Locale::Messages::gettext('')) {
if ($var eq 'language') {
if (/^Language-Team:\s*(.+)$/i) {
return $1;
}
}elsif ($var eq 'charset') {
if (/^Content-Type:\s*.*charset=(\S+)$/i) {
return $1;
}
}elsif ($var eq 'encoding') {
if (/^Content-Transfer-Encoding:\s*(.+)$/i) {
return $1;
}
}
}
return '';
}
&Locale::Messages::gettext(@_);
}
1;
......@@ -796,10 +796,7 @@ if ($wwsconf->{'use_fast_cgi'}) {
my $saved_lang = &Language::GetLang();
foreach my $l (&Language::GetSupportedLanguages()) {
&Language::SetLang($l) || next;
$param->{'languages'}{$l}{'complete'} = gettext("english");
if (($param->{'languages'}{$l}{'complete'} eq 'english')) {
$param->{'languages'}{$l}{'complete'} = $l;
}
$param->{'languages'}{$l}{'complete'} = gettext("_language_");
if ($param->{'locale'} eq $l) {
$param->{'languages'}{$l}{'selected'} = 'SELECTED';
......@@ -6287,7 +6284,7 @@ sub do_edit_list {
my $saved_lang = &Language::GetLang();
foreach my $lang (keys %{$p->{'value'}}) {
&Language::SetLang($lang);
$p->{'value'}{$lang}{'title'} = gettext("english");
$p->{'value'}{$lang}{'title'} = gettext('_language_');
}
&Language::SetLang($saved_lang);
}
......
Supports Markdown
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