diff --git a/amd/build/datahandler/translate.min.js b/amd/build/datahandler/translate.min.js
index df2b0f4..2581c8e 100644
--- a/amd/build/datahandler/translate.min.js
+++ b/amd/build/datahandler/translate.min.js
@@ -6,6 +6,6 @@ define("tiny_ai/datahandler/translate",["exports","tiny_ai/datahandler/basedata"
* @copyright 2024, ISB Bayern
* @author Philipp Memmel
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,BasedataHandler=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(BasedataHandler),_base=_interopRequireDefault(_base),_config=_interopRequireDefault(_config);class _default extends _base.default{constructor(uniqid){super(uniqid),_defineProperty(this,"languageNameInCurrentUserLanguage",new Intl.DisplayNames([_config.default.language],{type:"language"})),_defineProperty(this,"targetLanguageCodes",["de","fr","it","es","cs","zh","ru","uk","el","la","tr","ro","pl","bg","ar","sq","bs","sr","hr","ku","fa","ps","sk","hu"]),_defineProperty(this,"targetLanguageOptions",[]),_defineProperty(this,"targetLanguage",null),this.initTargetLanguages()}setTargetLanguage(targetLanguage){this.targetLanguage=targetLanguage}async getPrompt(selectionText){const selectedLanguageEntry=this.targetLanguageOptions.filter((languageEntry=>languageEntry.key===this.targetLanguage))[0];let prompt=await(0,_str.getString)("translate_baseprompt","tiny_ai",selectedLanguageEntry.value);return prompt+=": "+selectionText,prompt}getTemplateContext(){const translateHandler=(0,_utils.getTranslateHandler)(this.uniqid),context={modal_headline:BasedataHandler.getTinyAiString("translate_headline"),showIcon:!0,tool:"translate"},targetLanguageDropdownContext={preference:"targetLanguage"};targetLanguageDropdownContext.dropdown_default=translateHandler.targetLanguageOptions[0].value,targetLanguageDropdownContext.dropdown_default_value=translateHandler.targetLanguageOptions[0].key,targetLanguageDropdownContext.dropdown_description=BasedataHandler.getTinyAiString("targetlanguage");const targetLanguageDropdownOptions=[];return translateHandler.targetLanguageOptions.forEach((languageEntry=>{targetLanguageDropdownOptions.push({optionValue:languageEntry.key,optionLabel:languageEntry.value})})),targetLanguageDropdownContext.dropdown_options=targetLanguageDropdownOptions,Object.assign(context,{modal_dropdowns:[targetLanguageDropdownContext]}),Object.assign(context,BasedataHandler.getShowPromptButtonContext()),Object.assign(context,BasedataHandler.getBackAndGenerateButtonContext()),context}initTargetLanguages(){const firstLanguages=[{key:"en",value:this.languageNameInCurrentUserLanguage.of("en")}];if("en"!==_config.default.language&&this.targetLanguageCodes.includes(_config.default.language)){firstLanguages.push({key:_config.default.language,value:this.languageNameInCurrentUserLanguage.of(_config.default.language)});const index=this.targetLanguageCodes.indexOf(_config.default.language);this.targetLanguageCodes.splice(index,1)}this.targetLanguageCodes.forEach((languageCode=>{this.targetLanguageOptions[languageCode]=this.languageNameInCurrentUserLanguage.of(languageCode)}));const sortedLanguages=Object.entries(this.targetLanguageOptions).sort(((a,b)=>a[1].localeCompare(b[1]))).map((_ref=>{let[key,value]=_ref;return{key:key,value:value}}));this.targetLanguageOptions=[...firstLanguages,...sortedLanguages]}}return _exports.default=_default,_exports.default}));
+ */Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,BasedataHandler=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(BasedataHandler),_base=_interopRequireDefault(_base),_config=_interopRequireDefault(_config);class _default extends _base.default{constructor(uniqid){super(uniqid),_defineProperty(this,"targetLanguageCodes",["de","fr","it","es","cs","zh","ru","uk","el","la","tr","ro","pl","bg","ar","sq","bs","sr","hr","ku","fa","ps","sk","hu"]),_defineProperty(this,"targetLanguageOptions",[]),_defineProperty(this,"targetLanguage",null),this.initTargetLanguages()}setTargetLanguage(targetLanguage){this.targetLanguage=targetLanguage}async getPrompt(selectionText){const selectedLanguageEntry=this.targetLanguageOptions.filter((languageEntry=>languageEntry.key===this.targetLanguage))[0];let prompt=await(0,_str.getString)("translate_baseprompt","tiny_ai",selectedLanguageEntry.value);return prompt+=": "+selectionText,prompt}getTemplateContext(){const translateHandler=(0,_utils.getTranslateHandler)(this.uniqid),context={modal_headline:BasedataHandler.getTinyAiString("translate_headline"),showIcon:!0,tool:"translate"},targetLanguageDropdownContext={preference:"targetLanguage"};targetLanguageDropdownContext.dropdown_default=translateHandler.targetLanguageOptions[0].value,targetLanguageDropdownContext.dropdown_default_value=translateHandler.targetLanguageOptions[0].key,targetLanguageDropdownContext.dropdown_description=BasedataHandler.getTinyAiString("targetlanguage");const targetLanguageDropdownOptions=[];return translateHandler.targetLanguageOptions.forEach((languageEntry=>{targetLanguageDropdownOptions.push({optionValue:languageEntry.key,optionLabel:languageEntry.value})})),targetLanguageDropdownContext.dropdown_options=targetLanguageDropdownOptions,Object.assign(context,{modal_dropdowns:[targetLanguageDropdownContext]}),Object.assign(context,BasedataHandler.getShowPromptButtonContext()),Object.assign(context,BasedataHandler.getBackAndGenerateButtonContext()),context}initTargetLanguages(){const currentUserLanguage=_config.default.language.substring(0,2),languageNameInCurrentUserLanguage=new Intl.DisplayNames([currentUserLanguage],{type:"language"}),firstLanguages=[{key:"en",value:languageNameInCurrentUserLanguage.of("en")}];if("en"!==currentUserLanguage&&this.targetLanguageCodes.includes(currentUserLanguage)){firstLanguages.push({key:currentUserLanguage,value:languageNameInCurrentUserLanguage.of(currentUserLanguage)});const index=this.targetLanguageCodes.indexOf(currentUserLanguage);this.targetLanguageCodes.splice(index,1)}this.targetLanguageCodes.forEach((languageCode=>{this.targetLanguageOptions[languageCode]=languageNameInCurrentUserLanguage.of(languageCode)}));const sortedLanguages=Object.entries(this.targetLanguageOptions).sort(((a,b)=>a[1].localeCompare(b[1]))).map((_ref=>{let[key,value]=_ref;return{key:key,value:value}}));this.targetLanguageOptions=[...firstLanguages,...sortedLanguages]}}return _exports.default=_default,_exports.default}));
//# sourceMappingURL=translate.min.js.map
\ No newline at end of file
diff --git a/amd/build/datahandler/translate.min.js.map b/amd/build/datahandler/translate.min.js.map
index b10f041..72aa3bc 100644
--- a/amd/build/datahandler/translate.min.js.map
+++ b/amd/build/datahandler/translate.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"translate.min.js","sources":["../../src/datahandler/translate.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\nimport * as BasedataHandler from 'tiny_ai/datahandler/basedata';\nimport BaseHandler from 'tiny_ai/datahandler/base';\nimport {getTranslateHandler} from 'tiny_ai/utils';\nimport Config from 'core/config';\nimport {getString} from 'core/str';\n\n/**\n * Tiny AI data manager.\n *\n * @module tiny_ai/datahandler/translate\n * @copyright 2024, ISB Bayern\n * @author Philipp Memmel\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default class extends BaseHandler {\n\n languageNameInCurrentUserLanguage = new Intl.DisplayNames([Config.language], {type: 'language'});\n // English will always be added to the front of the list. All other languages can be defined here.\n // The user's current language will be shown right after English, if it is contained in this list.\n targetLanguageCodes = [\n 'de', 'fr', 'it', 'es', 'cs', 'zh', 'ru', 'uk', 'el', 'la', 'tr', 'ro', 'pl', 'bg', 'ar', 'sq',\n 'bs', 'sr', 'hr', 'ku', 'fa', 'ps', 'sk', 'hu'\n ];\n targetLanguageOptions = [];\n targetLanguage = null;\n\n constructor(uniqid) {\n super(uniqid);\n this.initTargetLanguages();\n }\n\n setTargetLanguage(targetLanguage) {\n this.targetLanguage = targetLanguage;\n }\n\n async getPrompt(selectionText) {\n const selectedLanguageEntry =\n this.targetLanguageOptions.filter(languageEntry => languageEntry.key === this.targetLanguage)[0];\n let prompt = await getString('translate_baseprompt', 'tiny_ai', selectedLanguageEntry.value);\n prompt += ': ' + selectionText;\n return prompt;\n }\n\n getTemplateContext() {\n const translateHandler = getTranslateHandler(this.uniqid);\n const context = {\n modal_headline: BasedataHandler.getTinyAiString('translate_headline'),\n showIcon: true,\n tool: 'translate',\n };\n const targetLanguageDropdownContext = {};\n targetLanguageDropdownContext.preference = 'targetLanguage';\n targetLanguageDropdownContext.dropdown_default = translateHandler.targetLanguageOptions[0].value;\n targetLanguageDropdownContext.dropdown_default_value = translateHandler.targetLanguageOptions[0].key;\n targetLanguageDropdownContext.dropdown_description = BasedataHandler.getTinyAiString('targetlanguage');\n const targetLanguageDropdownOptions = [];\n translateHandler.targetLanguageOptions.forEach(languageEntry => {\n targetLanguageDropdownOptions.push({\n optionValue: languageEntry.key,\n optionLabel: languageEntry.value,\n });\n });\n targetLanguageDropdownContext.dropdown_options = targetLanguageDropdownOptions;\n\n Object.assign(context, {\n modal_dropdowns: [\n targetLanguageDropdownContext,\n ]\n });\n Object.assign(context, BasedataHandler.getShowPromptButtonContext());\n Object.assign(context, BasedataHandler.getBackAndGenerateButtonContext());\n return context;\n }\n\n initTargetLanguages() {\n const firstLanguages = [\n {\n key: 'en',\n value: this.languageNameInCurrentUserLanguage.of('en')\n }\n ];\n if (Config.language !== 'en' && this.targetLanguageCodes.includes(Config.language)) {\n firstLanguages.push(\n {\n key: Config.language,\n value: this.languageNameInCurrentUserLanguage.of(Config.language)\n }\n );\n // Remove current user's language from the list.\n const index = this.targetLanguageCodes.indexOf(Config.language);\n this.targetLanguageCodes.splice(index, 1);\n }\n this.targetLanguageCodes.forEach(languageCode => {\n this.targetLanguageOptions[languageCode] = this.languageNameInCurrentUserLanguage.of(languageCode);\n });\n\n const sortedLanguages = Object\n .entries(this.targetLanguageOptions)\n .sort((a, b) => a[1].localeCompare(b[1]))\n .map(([key, value]) => ({'key': key, 'value': value}));\n this.targetLanguageOptions = [...firstLanguages, ...sortedLanguages];\n }\n}\n"],"names":["BaseHandler","constructor","uniqid","Intl","DisplayNames","Config","language","type","initTargetLanguages","setTargetLanguage","targetLanguage","selectionText","selectedLanguageEntry","this","targetLanguageOptions","filter","languageEntry","key","prompt","value","getTemplateContext","translateHandler","context","modal_headline","BasedataHandler","getTinyAiString","showIcon","tool","targetLanguageDropdownContext","dropdown_default","dropdown_default_value","dropdown_description","targetLanguageDropdownOptions","forEach","push","optionValue","optionLabel","dropdown_options","Object","assign","modal_dropdowns","getShowPromptButtonContext","getBackAndGenerateButtonContext","firstLanguages","languageNameInCurrentUserLanguage","of","targetLanguageCodes","includes","index","indexOf","splice","languageCode","sortedLanguages","entries","sort","a","b","localeCompare","map","_ref"],"mappings":";;;;;;;;s2BA8B6BA,cAYzBC,YAAYC,cACFA,iEAX0B,IAAIC,KAAKC,aAAa,CAACC,gBAAOC,UAAW,CAACC,KAAM,yDAG9D,CAClB,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM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AEtCF,oBAAoBb,SAAQkB,oBACxBrC,sBAAsBqC,cAAgBtC,KAAK+B,kCAAkCC,GAAGM,uBAGnFC,gBAAkBd,OACnBe,QAAQxC,KAAKC,uBACbwC,MAAK,CAACC,EAAGC,IAAMD,EAAE,GAAGE,cAAcD,EAAE,MACpCE,KAAIC,WAAE1C,IAAKE,kBAAY,KAAQF,UAAcE,eAC7CL,sBAAwB,IAAI6B,kBAAmBS"}
\ No newline at end of file
+{"version":3,"file":"translate.min.js","sources":["../../src/datahandler/translate.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\nimport * as BasedataHandler from 'tiny_ai/datahandler/basedata';\nimport BaseHandler from 'tiny_ai/datahandler/base';\nimport {getTranslateHandler} from 'tiny_ai/utils';\nimport Config from 'core/config';\nimport {getString} from 'core/str';\n\n/**\n * Tiny AI data manager.\n *\n * @module tiny_ai/datahandler/translate\n * @copyright 2024, ISB Bayern\n * @author Philipp Memmel\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default class extends BaseHandler {\n\n // English will always be added to the front of the list. All other languages can be defined here.\n // The user's current language will be shown right after English, if it is contained in this list.\n targetLanguageCodes = [\n 'de', 'fr', 'it', 'es', 'cs', 'zh', 'ru', 'uk', 'el', 'la', 'tr', 'ro', 'pl', 'bg', 'ar', 'sq',\n 'bs', 'sr', 'hr', 'ku', 'fa', 'ps', 'sk', 'hu'\n ];\n targetLanguageOptions = [];\n targetLanguage = null;\n\n constructor(uniqid) {\n super(uniqid);\n this.initTargetLanguages();\n }\n\n setTargetLanguage(targetLanguage) {\n this.targetLanguage = targetLanguage;\n }\n\n async getPrompt(selectionText) {\n const selectedLanguageEntry =\n this.targetLanguageOptions.filter(languageEntry => languageEntry.key === this.targetLanguage)[0];\n let prompt = await getString('translate_baseprompt', 'tiny_ai', selectedLanguageEntry.value);\n prompt += ': ' + selectionText;\n return prompt;\n }\n\n getTemplateContext() {\n const translateHandler = getTranslateHandler(this.uniqid);\n const context = {\n modal_headline: BasedataHandler.getTinyAiString('translate_headline'),\n showIcon: true,\n tool: 'translate',\n };\n const targetLanguageDropdownContext = {};\n targetLanguageDropdownContext.preference = 'targetLanguage';\n targetLanguageDropdownContext.dropdown_default = translateHandler.targetLanguageOptions[0].value;\n targetLanguageDropdownContext.dropdown_default_value = translateHandler.targetLanguageOptions[0].key;\n targetLanguageDropdownContext.dropdown_description = BasedataHandler.getTinyAiString('targetlanguage');\n const targetLanguageDropdownOptions = [];\n translateHandler.targetLanguageOptions.forEach(languageEntry => {\n targetLanguageDropdownOptions.push({\n optionValue: languageEntry.key,\n optionLabel: languageEntry.value,\n });\n });\n targetLanguageDropdownContext.dropdown_options = targetLanguageDropdownOptions;\n\n Object.assign(context, {\n modal_dropdowns: [\n targetLanguageDropdownContext,\n ]\n });\n Object.assign(context, BasedataHandler.getShowPromptButtonContext());\n Object.assign(context, BasedataHandler.getBackAndGenerateButtonContext());\n return context;\n }\n\n initTargetLanguages() {\n // Ensure to only have a two-character lang string for the user's current language.\n // In case of extended language packs like for example \"de_du\" the attribute Config.language contains \"de_du\", for example.\n const currentUserLanguage = Config.language.substring(0, 2);\n const languageNameInCurrentUserLanguage = new Intl.DisplayNames([currentUserLanguage], {type: 'language'});\n const firstLanguages = [\n {\n key: 'en',\n value: languageNameInCurrentUserLanguage.of('en')\n }\n ];\n if (currentUserLanguage !== 'en' && this.targetLanguageCodes.includes(currentUserLanguage)) {\n firstLanguages.push(\n {\n key: currentUserLanguage,\n value: languageNameInCurrentUserLanguage.of(currentUserLanguage)\n }\n );\n // Remove current user's language from the list.\n const index = this.targetLanguageCodes.indexOf(currentUserLanguage);\n this.targetLanguageCodes.splice(index, 1);\n }\n this.targetLanguageCodes.forEach(languageCode => {\n this.targetLanguageOptions[languageCode] = languageNameInCurrentUserLanguage.of(languageCode);\n });\n\n const sortedLanguages = Object\n .entries(this.targetLanguageOptions)\n .sort((a, b) => a[1].localeCompare(b[1]))\n .map(([key, value]) => ({'key': key, 'value': value}));\n this.targetLanguageOptions = [...firstLanguages, ...sortedLanguages];\n }\n}\n"],"names":["BaseHandler","constructor","uniqid","initTargetLanguages","setTargetLanguage","targetLanguage","selectionText","selectedLanguageEntry","this","targetLanguageOptions","filter","languageEntry","key","prompt","value","getTemplateContext","translateHandler","context","modal_headline","BasedataHandler","getTinyAiString","showIcon","tool","targetLanguageDropdownContext","dropdown_default","dropdown_default_value","dropdown_description","targetLanguageDropdownOptions","forEach","push","optionValue","optionLabel","dropdown_options","Object","assign","modal_dropdowns","getShowPromptButtonContext","getBackAndGenerateButtonContext","currentUserLanguage","Config","language","substring","languageNameInCurrentUserLanguage","Intl","DisplayNames","type","firstLanguages","of","targetLanguageCodes","includes","index","indexOf","splice","languageCode","sortedLanguages","entries","sort","a","b","localeCompare","map","_ref"],"mappings":";;;;;;;;s2BA8B6BA,cAWzBC,YAAYC,cACFA,mDARY,CAClB,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAC1F,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,oDAEtB,0CACP,WAIRC,sBAGTC,kBAAkBC,qBACTA,eAAiBA,+BAGVC,qBACNC,sBACFC,KAAKC,sBAAsBC,QAAOC,eAAiBA,cAAcC,MAAQJ,KAAKH,iBAAgB,OAC9FQ,aAAe,kBAAU,uBAAwB,UAAWN,sBAAsBO,cACtFD,QAAU,KAAOP,cACVO,OAGXE,2BACUC,kBAAmB,8BAAoBR,KAAKN,QAC5Ce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ahandler/translate.js b/amd/src/datahandler/translate.js
index 1750d08..a47db0c 100644
--- a/amd/src/datahandler/translate.js
+++ b/amd/src/datahandler/translate.js
@@ -30,7 +30,6 @@ import {getString} from 'core/str';
export default class extends BaseHandler {
- languageNameInCurrentUserLanguage = new Intl.DisplayNames([Config.language], {type: 'language'});
// English will always be added to the front of the list. All other languages can be defined here.
// The user's current language will be shown right after English, if it is contained in this list.
targetLanguageCodes = [
@@ -89,25 +88,29 @@ export default class extends BaseHandler {
}
initTargetLanguages() {
+ // Ensure to only have a two-character lang string for the user's current language.
+ // In case of extended language packs like for example "de_du" the attribute Config.language contains "de_du", for example.
+ const currentUserLanguage = Config.language.substring(0, 2);
+ const languageNameInCurrentUserLanguage = new Intl.DisplayNames([currentUserLanguage], {type: 'language'});
const firstLanguages = [
{
key: 'en',
- value: this.languageNameInCurrentUserLanguage.of('en')
+ value: languageNameInCurrentUserLanguage.of('en')
}
];
- if (Config.language !== 'en' && this.targetLanguageCodes.includes(Config.language)) {
+ if (currentUserLanguage !== 'en' && this.targetLanguageCodes.includes(currentUserLanguage)) {
firstLanguages.push(
{
- key: Config.language,
- value: this.languageNameInCurrentUserLanguage.of(Config.language)
+ key: currentUserLanguage,
+ value: languageNameInCurrentUserLanguage.of(currentUserLanguage)
}
);
// Remove current user's language from the list.
- const index = this.targetLanguageCodes.indexOf(Config.language);
+ const index = this.targetLanguageCodes.indexOf(currentUserLanguage);
this.targetLanguageCodes.splice(index, 1);
}
this.targetLanguageCodes.forEach(languageCode => {
- this.targetLanguageOptions[languageCode] = this.languageNameInCurrentUserLanguage.of(languageCode);
+ this.targetLanguageOptions[languageCode] = languageNameInCurrentUserLanguage.of(languageCode);
});
const sortedLanguages = Object