aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-05-21 19:24:24 +1000
committerRedMatrix <info@friendica.com>2014-05-21 19:24:24 +1000
commit3e75f9cbb1c74cb140f07b92627101d774724a80 (patch)
treea80b1d1cd1e46a243e2afe3922c85214a2a9f1de /include
parent77ca117218382b57e2d0590466d9fc38dc016e80 (diff)
parentd15e3776f3ec5476b1614f0488e8e81e0f0ebb70 (diff)
downloadvolse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.tar.gz
volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.tar.bz2
volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.zip
Merge pull request #464 from solstag/master
Bunch of translation work
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php8
-rw-r--r--include/language.php12
2 files changed, 11 insertions, 9 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index cdb09ecf1..19283c317 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -131,12 +131,12 @@ class Item extends BaseObject {
} else {
$like_list_part = '';
}
- $like_button_label = ((x($alike,$item['mid'])) && ($alike[$item['mid']] < 2 ) ? t('Like') : t('Likes'));
+ $like_button_label = tt('Like','Likes',$like_count,'noun');
if (feature_enabled($conv->get_profile_owner(),'dislike')) {
$dislike_count = ((x($dlike,$item['mid'])) ? $dlike[$item['mid']] : '');
$dislike_list = ((x($dlike,$item['mid'])) ? $dlike[$item['mid'] . '-l'] : '');
- $dislike_button_label = ((x($dlike,$item['mid'])) && ($dlike[$item['mid']] < 2) ? t('Dislike') : t('Dislikes'));
+ $dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun');
if (count($dislike_list) > MAX_LIKERS) {
$dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS);
array_push($dislike_list_part, '<a href="#" data-toggle="modal" data-target="#dislikeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
@@ -276,8 +276,8 @@ class Item extends BaseObject {
'like_list' => $like_list,
'like_list_part' => $like_list_part,
'like_button_label' => $like_button_label,
- 'like_modal_title' => t('Likes'),
- 'dislike_modal_title' => t('Dislikes'),
+ 'like_modal_title' => t('Likes','noun'),
+ 'dislike_modal_title' => t('Dislikes','noun'),
'dislike_count' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_count : ''),
'dislike_list' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list : ''),
'dislike_list_part' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list_part : ''),
diff --git a/include/language.php b/include/language.php
index f4c7d1524..780dfadba 100644
--- a/include/language.php
+++ b/include/language.php
@@ -153,19 +153,21 @@ function load_translation_table($lang, $install = false) {
function t($s,$ctx = '') {
global $a;
- if(x($a->strings,$s)) {
- $t = $a->strings[$s];
+ $cs = $ctx?"__ctx:".$ctx."__ ".$s:$s;
+ if(x($a->strings,$cs)) {
+ $t = $a->strings[$cs];
return is_array($t) ? $t[0] : $t;
}
return $s;
}
-function tt($singular, $plural, $count){
+function tt($singular, $plural, $count, $ctx = ''){
$a = get_app();
- if(x($a->strings,$singular)) {
- $t = $a->strings[$singular];
+ $cs = $ctx?"__ctx:".$ctx."__ ".$singular:$singular;
+ if(x($a->strings,$cs)) {
+ $t = $a->strings[$cs];
$f = 'string_plural_select_' . str_replace('-', '_', $a->language);
if(! function_exists($f))
$f = 'string_plural_select_default';