summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Reyero2011-06-09 10:17:50 (GMT)
committer Jose Reyero2011-06-09 10:17:50 (GMT)
commit3ae7268d3c2d0ea850b631951d3cde0e1079cd41 (patch)
tree67ae7e3fc9daa1e4a725d8109786531b7aebbcf4
parent792bcc1c164de4c39bc957d4c2b2c3b9726f6113 (diff)
Added get_item() method to get just one of the translations
-rw-r--r--i18n_translation/i18n_translation.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/i18n_translation/i18n_translation.inc b/i18n_translation/i18n_translation.inc
index 727a802..df3c0b0 100644
--- a/i18n_translation/i18n_translation.inc
+++ b/i18n_translation/i18n_translation.inc
@@ -137,6 +137,17 @@ class i18n_translation_set {
return $this->translations;
}
/**
+ * Get item for language
+ */
+ public function get_item($langcode) {
+ if (($translations = $this->get_translations()) && isset($translations[$langcode])) {
+ return $translations[$langcode];
+ }
+ else {
+ return NULL;
+ }
+ }
+ /**
* Get translations keys, indexed by language
*/
public function get_translations_keys() {