$lang = 'en';
}
-// load english defaults
-$string = array();
-foreach (get_langpack_en_locations() as $location) {
- if (!file_exists($location)) {
- continue;
- }
- include($location);
-}
-
-// find parent language
-if ($parent = get_parent_language($lang)) {
- foreach (get_langpack_locations($parent) as $location) {
- if (!file_exists($location)) {
- continue;
- }
- include($location);
- }
-}
-
-// load wanted language
-if ($lang !== 'en') {
- foreach (get_langpack_locations($lang) as $location) {
- if (!file_exists($location)) {
- continue;
- }
- include($location);
- }
-}
+$string = get_string_manager()->load_component_strings('editor_tinymce', $lang);
//process the $strings to match expected tinymce lang array stucture
$result = array();
@header('Pragma: ');
echo $output;
-
-
-/// ======= Functions =================
-
-function get_langpack_en_locations() {
- global $CFG;
-
- $result = array();
- $result[] = "$CFG->dirroot/lib/editor/tinymce/lang/en/editor_tinymce.php";
- $result[] = "$CFG->langlocalroot/en_local/editor_tinymce.php";
-
- return $result;
-}
-
-function get_langpack_locations($lang) {
- global $CFG;
-
- $result = array();
- $result[] = "$CFG->langotherroot/$lang/editor_tinymce.php";
- $result[] = "$CFG->langlocalroot/{$lang}_local/editor_tinymce.php";
-
- return $result;
-}
* @param bool $returnall return all or just enabled
*/
public function get_list_of_languages($returnall = false);
+
+ /**
+ * Load all strings for one component
+ * @param string $component The module the string is associated with
+ * @param string $lang
+ * @return array of all string for given component and lang
+ */
+ public function load_component_strings($component, $lang);
}
* @param string $lang
* @return array of all string for given component and lang
*/
- protected function load_component_strings($component, $lang) {
+ public function load_component_strings($component, $lang) {
global $CFG;
list($plugintype, $pluginname) = normalize_component($component);
$this->installroot = "$CFG->dirroot/install/lang";
}
+ /**
+ * Load all strings for one component
+ * @param string $component The module the string is associated with
+ * @param string $lang
+ * @return array of all string for given component and lang
+ */
+ public function load_component_strings($component, $lang) {
+ return array();
+ }
+
/**
* Get String returns a requested string
*