aboutsummaryrefslogtreecommitdiff
path: root/model/Stream.php
diff options
context:
space:
mode:
authorBenjamin Peter2017-12-12 14:07:49 +0100
committerGitHub2017-12-12 14:07:49 +0100
commit3229c9e8af148575d87b4dfbd878ffb300a2ddd2 (patch)
tree52a824f118f99f14d7079d2c05e9f3035350e1ee /model/Stream.php
parent65397e5734b1439df4d68be40ffe994f26e551ec (diff)
parent0b73843d5e0d0ac22a46db28090e707566668ae4 (diff)
Merge pull request #56 from voc/feature/multitranslations
Feature/multitranslations
Diffstat (limited to '')
-rw-r--r--model/Stream.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/model/Stream.php b/model/Stream.php
index daed17f..99abaf1 100644
--- a/model/Stream.php
+++ b/model/Stream.php
@@ -2,11 +2,12 @@
class Stream
{
- public function __construct(Room $room, $selection, $language)
+ public function __construct(Room $room, $selection, $language, $translation_label = null)
{
$this->room = $room;
$this->selection = $selection;
$this->language = $language;
+ $this->translation_label = (empty($translation_label)) ? $language : $translation_label;
}
public function getRoom()
@@ -24,9 +25,16 @@ class Stream
return $this->language;
}
+ public function getTranslationLabel()
+ {
+ return $this->translation_label;
+ }
+
public function isTranslated()
{
- return $this->getLanguage() == 'translated';
+ return !empty($this->getLanguage()) &&
+ $this->getLanguage() !== 'native' &&
+ $this->getLanguage() !== 'stereo';
}
public function getVideoSize()
@@ -98,7 +106,7 @@ class Stream
}
if($this->isTranslated())
- $display .= ' (Translation)';
+ $display .= ' ('. $this->getTranslationLabel() .')';
return $display;
}