diff options
author | Benny Baumann <BenBE@geshi.org> | 2013-05-08 00:02:29 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2013-05-08 00:02:29 +0200 |
commit | 06b04cd9e702279c371fd1d3f95fa22e08ffa49e (patch) | |
tree | 280edc9a38c337eaf7734f70b8f593678e0b299e /includes/lib/l10n.php | |
parent | f8fa314f91df00c6f0e5089b02364d2eaf1b8440 (diff) | |
download | cacert-devel-06b04cd9e702279c371fd1d3f95fa22e08ffa49e.tar.gz cacert-devel-06b04cd9e702279c371fd1d3f95fa22e08ffa49e.tar.xz cacert-devel-06b04cd9e702279c371fd1d3f95fa22e08ffa49e.zip |
bug 28: add changes for l10n class
Diffstat (limited to 'includes/lib/l10n.php')
-rw-r--r-- | includes/lib/l10n.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php index 8325f4c..9bb5d52 100644 --- a/includes/lib/l10n.php +++ b/includes/lib/l10n.php @@ -340,13 +340,21 @@ class L10n { bindtextdomain($domain, $_SESSION['_config']['filepath'].'/locale'); textdomain($domain); } -} -function get_recipient_language($accoundid){ -//returns the language of a recipient to make sure that the language is correct -//use together with - $query = "select * from `users` where `id`='".$id."'"; - $res = mysql_query($query); - $row = mysql_fetch_assoc($res); - return $row['language']; + public static function set_recipient_language($accoundid) { + //returns the language of a recipient to make sure that the language is correct + //use together with + $query = "select `language` from `users` where `id`='".intval($accountid)."'"; + $res = mysql_query($query); + if (mysql_num_rows($res)>=0) { + $row = mysql_fetch_assoc($res); + if ($row['language']==Null || $row['language']=='') { + $this->set_translation('en'); + } else { + $this->set_translation($row['language']); + } + } else { + $this->set_translation('en'); + } + } } |