aboutsummaryrefslogtreecommitdiffstats
path: root/include/pgettext.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-21 07:09:37 -0700
committerFriendika <info@friendika.com>2011-09-21 07:09:37 -0700
commitc63adcfae061809ce25217207f638b1e6c1d1bee (patch)
tree3e2d02b438c881e4f9764a4a6554bb49fbd9f6eb /include/pgettext.php
parent11ca81adbaa033123ca1aa2c354fb3be6f5225d0 (diff)
downloadvolse-hubzilla-c63adcfae061809ce25217207f638b1e6c1d1bee.tar.gz
volse-hubzilla-c63adcfae061809ce25217207f638b1e6c1d1bee.tar.bz2
volse-hubzilla-c63adcfae061809ce25217207f638b1e6c1d1bee.zip
bug #159 multiple definition of string_plural_form function when changing languages
Diffstat (limited to 'include/pgettext.php')
-rw-r--r--include/pgettext.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/pgettext.php b/include/pgettext.php
index 49f100737..c7fc58698 100644
--- a/include/pgettext.php
+++ b/include/pgettext.php
@@ -90,8 +90,11 @@ if(! function_exists('load_translation_table')) {
function load_translation_table($lang) {
global $a;
- if(file_exists("view/$lang/strings.php"))
+ if(file_exists("view/$lang/strings.php")) {
include("view/$lang/strings.php");
+ }
+ else
+ $a->strings = array();
}}
// translate string if translation exists
@@ -110,12 +113,13 @@ function t($s) {
if(! function_exists('tt')){
function tt($singular, $plural, $count){
-
+ global $lang;
$a = get_app();
if(x($a->strings,$singular)) {
$t = $a->strings[$singular];
- $k = string_plural_select($count);
+ $f = 'string_plural_select_' . str_replace('-','_',$lang);
+ $k = $f($count);
return is_array($t)?$t[$k]:$t;
}