From 883ea6270b45e2d712a71d8361fb4a4daffb12a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=A4nzer?= Date: Sun, 16 Oct 2011 22:47:02 +0200 Subject: bug 985: move binding to a gettext domain into a separate method and update some more legacy language handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit removed screenshot() as it's never used and language dependent still open: translation in PDFs Signed-off-by: Michael Tänzer --- CommModule/client.pl | 2 +- includes/general.php | 9 +------ includes/lib/l10n.php | 66 +++++++++++++++++++++++++++++--------------------- includes/loggedin.php | 13 +++------- pages/wot/5.php | 2 +- scripts/removedead.php | 5 ++-- www/capnew.php | 4 +-- www/coapnew.php | 4 +-- www/index.php | 19 ++++++--------- www/wot.php | 13 +++------- 10 files changed, 62 insertions(+), 75 deletions(-) diff --git a/CommModule/client.pl b/CommModule/client.pl index 44be6f2..bf92b27 100755 --- a/CommModule/client.pl +++ b/CommModule/client.pl @@ -595,7 +595,7 @@ sub OpenPGPextractExpiryDate ($) # Sets the locale according to the users preferred language sub setUsersLanguage($) { - my $lang="de_DE"; + my $lang="en_US"; print "Searching for the language of the user $_[0]\n"; my @a=$dbh->selectrow_array("select language from users where id='".int($_[0])."'"); $lang = $1 if($a[0]=~m/(\w+_[\w.@]+)/); diff --git a/includes/general.php b/includes/general.php index d608d2d..8687ee6 100644 --- a/includes/general.php +++ b/includes/general.php @@ -72,6 +72,7 @@ } L10n::detect_language(); + L10n::init_gettext(); if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0) { @@ -518,14 +519,6 @@ return(utf8_decode($data)); } - function screenshot($img) - { - if(file_exists("../screenshots/".$_SESSION['_config']['language']."/$img")) - return("/screenshots/".$_SESSION['_config']['language']."/$img"); - else - return("/screenshots/en/$img"); - } - function signmail($to, $subject, $message, $from, $replyto = "") { if($replyto == "") diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php index 58b6859..1a8109b 100644 --- a/includes/lib/l10n.php +++ b/includes/lib/l10n.php @@ -228,7 +228,8 @@ class L10n { /** * Get the set translation * - * @return string a translation code or the empty string if not set + * @return string + * a translation code or the empty string if not set */ public static function get_translation() { if (array_key_exists('language', $_SESSION['_config'])) { @@ -241,8 +242,8 @@ class L10n { /** * Set the translation to use. * - * @param string $translation_code the translation code as specified in - * the keys of {@link translations} + * @param string $translation_code + * the translation code as specified in the keys of {@link $translations} * * @return bool *