Specifying language code is now required when getting library translations.

d6
Frode Petterson 2014-10-07 14:46:35 +02:00
parent 2011e856c0
commit 43188bb7e0
1 changed files with 28 additions and 29 deletions

View File

@ -153,14 +153,14 @@ class H5PDevelopment {
* @param int $minorVersion of the library.
* @return string Translation
*/
public function getLanguage($name, $majorVersion, $minorVersion) {
public function getLanguage($name, $majorVersion, $minorVersion, $language) {
$library = H5PDevelopment::libraryToString($name, $majorVersion, $minorVersion);
if (isset($this->libraries[$library]) === FALSE) {
return NULL;
}
return $this->getFileContents($this->libraries[$library]['path'] . '/language/' . $this->language . '.json');
return $this->getFileContents($this->libraries[$library]['path'] . '/language/' . $language . '.json');
}
/**
@ -175,4 +175,3 @@ class H5PDevelopment {
return $name . ' ' . $majorVersion . '.' . $minorVersion;
}
}