add optional context to translations

This commit is contained in:
friendica
2014-05-20 20:22:38 -07:00
parent fc0967b84b
commit 71f5908e21
4 changed files with 120 additions and 106 deletions

View File

@@ -145,10 +145,12 @@ function load_translation_table($lang, $install = false) {
/**
* @brief translate string if translation exists.
*
* @param s string that should get translated
* @param $s string that should get translated
* @param $ctx optional context to appear in po file
* @return translated string if exsists, otherwise s
*
*/
function t($s) {
function t($s,$ctx = '') {
global $a;
if(x($a->strings,$s)) {