summaryrefslogtreecommitdiff
path: root/includes/lib/l10n.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/lib/l10n.php')
-rw-r--r--includes/lib/l10n.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php
index 85b7aff..41d785d 100644
--- a/includes/lib/l10n.php
+++ b/includes/lib/l10n.php
@@ -340,4 +340,21 @@ class L10n {
bindtextdomain($domain, $_SESSION['_config']['filepath'].'/locale');
textdomain($domain);
}
-} \ No newline at end of file
+
+ public static function set_recipient_language($accountid) {
+ //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 (NULL==$row['language'] || $row['language']=='') {
+ self::set_translation('en');
+ } else {
+ self::set_translation($row['language']);
+ }
+ } else {
+ self::set_translation('en');
+ }
+ }
+}