Commit b716d8ed authored by Aaron Wells's avatar Aaron Wells
Browse files

Change theme lang files to follow naming convention of plugin naming files

Bug 1362871
e.g.: theme/primaryschool/lang/en.utf8/theme.primaryschool.php

Change-Id: I267822316494778bd4fc879ccff8dfba97a29c1b
parent ee37a85f
......@@ -468,28 +468,22 @@ function get_string_location($identifier, $section, $variables, $replacefunc='fo
$langdirectory = 'lang/';
}
else {
if (false === strpos($section, 'theme.')) {
$extras = plugin_types(); // more later..
foreach ($extras as $tocheck) {
if (strpos($section, $tocheck . '.') === 0) {
$pluginname = substr($section ,strlen($tocheck) + 1);
if ($tocheck == 'blocktype' &&
strpos($pluginname, '/') !== false) { // it belongs to an artefact plugin
$bits = explode('/', $pluginname);
$langdirectory = 'artefact/' . $bits[0] . '/blocktype/' . $bits[1] . '/lang/';
$section = 'blocktype.' . $bits[1];
}
else {
$langdirectory = $tocheck . '/' . $pluginname . '/lang/';
}
$extras = plugin_types();
$extras[] = 'theme'; // Allow themes to have lang files the same as plugins
foreach ($extras as $tocheck) {
if (strpos($section, $tocheck . '.') === 0) {
$pluginname = substr($section ,strlen($tocheck) + 1);
if ($tocheck == 'blocktype' &&
strpos($pluginname, '/') !== false) { // it belongs to an artefact plugin
$bits = explode('/', $pluginname);
$langdirectory = 'artefact/' . $bits[0] . '/blocktype/' . $bits[1] . '/lang/';
$section = 'blocktype.' . $bits[1];
}
else {
$langdirectory = $tocheck . '/' . $pluginname . '/lang/';
}
}
}
else {
$bits = explode('.', $section);
$langdirectory = 'theme/' . $bits[1] . '/lang/';
$section = $bits[1];
}
}
// First check all the normal locations for the string in the current language
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment