Skip to content

Commit

Permalink
fix for a case when a variant language concept label was not consider…
Browse files Browse the repository at this point in the history
…ed to be in the right language. Fixes #540

(cherry picked from commit e50019c)
  • Loading branch information
osma committed Aug 16, 2016
1 parent 1deb33e commit 5c81d01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/Concept.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getDeprecated()
}

/**
* Returns a label for the concept in the ui language or if not possible in any language.
* Returns a label for the concept in the content language or if not possible in any language.
* @return string
*/
public function getLabel()
Expand All @@ -127,8 +127,8 @@ public function getLabel()
// 3. label in any language
$label = $this->resource->label();
// if the label lang code is a subset of the ui lang eg. en-GB
if ($label !== null && strpos($label->getLang(), $this->getEnvLang() . '-') === 0) {
return $label->getValue();
if ($label !== null && strpos($label->getLang(), $lang . '-') === 0) {
return EasyRdf_Literal::create($label, $lang);
}

if ($label !== null) {
Expand Down

0 comments on commit 5c81d01

Please sign in to comment.