diff options
author | Hanne Moa <hanne.moa@uninett.no> | 2016-09-07 14:32:30 +0200 |
---|---|---|
committer | Hanne Moa <hanne.moa@uninett.no> | 2016-09-07 14:34:11 +0200 |
commit | 0edda0fcfb02db4cb73979ce49d047ede22c35cc (patch) | |
tree | 27bddbc831d1e630dabe63a337b64f49ebcdb573 /lib | |
parent | 892926ff5b99f19e2d6f3c1540a04901da8c2e10 (diff) | |
download | simplesamlphp-0edda0fcfb02db4cb73979ce49d047ede22c35cc.zip simplesamlphp-0edda0fcfb02db4cb73979ce49d047ede22c35cc.tar.gz simplesamlphp-0edda0fcfb02db4cb73979ce49d047ede22c35cc.tar.bz2 |
Add noop() function for marking translations
Diffstat (limited to 'lib')
-rw-r--r-- | lib/SimpleSAML/Locale/Translate.php | 15 | ||||
-rw-r--r-- | lib/SimpleSAML/XHTML/Template.php | 12 |
2 files changed, 26 insertions, 1 deletions
diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php index dba41a8..6ffd011 100644 --- a/lib/SimpleSAML/Locale/Translate.php +++ b/lib/SimpleSAML/Locale/Translate.php @@ -222,6 +222,19 @@ class Translate /** + * Mark a string for translation without translating it. + * + * @param string $tag A tag name to mark for translation. + * + * @return string The tag, unchanged. + */ + public function noop($tag) + { + return $tag; + } + + + /** * Translate a tag into the current language, with a fallback to english. * * This function is used to look up a translation tag in dictionaries, and return the translation into the current @@ -245,7 +258,7 @@ class Translate public function t( $tag, $replacements = array(), - $fallbackdefault = true, + $fallbackdefault = true, // TODO: remove this for 2.0. Assume true $oldreplacements = array(), // TODO: remove this for 2.0 $striptags = false // TODO: remove this for 2.0 ) { diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index b2fa780..af97162 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -567,6 +567,18 @@ class SimpleSAML_XHTML_Template /** + * Wrap Language->noop to mark a tag for translation but actually do it later. + * + * @see \SimpleSAML\Locale\Translate::noop() + * @deprecated This method will be removed in SSP 2.0. Please use \SimpleSAML\Locale\Translate::t() instead. + */ + public function noop($tag) + { + return $this->translator->noop($tag); + } + + + /** * Wrap Language->t to translate tag into the current language, with a fallback to english. * * @see \SimpleSAML\Locale\Translate::t() |