aboutsummaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-05-09 03:10:48 +0200
committerGitHub <noreply@github.com>2024-05-09 01:10:48 +0000
commit57d928bb82130f8f1dcbc85ddd5430721a0dbf04 (patch)
tree1c6c63a267a9eda67c17b16dd38ed89a76d6cc84 /ext/js
parentd6b3745b7fe983e1397a00f4cb0cea53cbc61f22 (diff)
add source and target language dictionary metadata (#891)
* add source and target language dictionary metadata * validate iso * add description and grc
Diffstat (limited to 'ext/js')
-rw-r--r--ext/js/dictionary/dictionary-importer.js4
-rw-r--r--ext/js/pages/settings/dictionary-controller.js6
2 files changed, 7 insertions, 3 deletions
diff --git a/ext/js/dictionary/dictionary-importer.js b/ext/js/dictionary/dictionary-importer.js
index 310b2ec1..f0c92481 100644
--- a/ext/js/dictionary/dictionary-importer.js
+++ b/ext/js/dictionary/dictionary-importer.js
@@ -285,12 +285,14 @@ export class DictionaryImporter {
counts
};
- const {author, url, description, attribution, frequencyMode} = index;
+ const {author, url, description, attribution, frequencyMode, sourceLanguage, targetLanguage} = index;
if (typeof author === 'string') { summary.author = author; }
if (typeof url === 'string') { summary.url = url; }
if (typeof description === 'string') { summary.description = description; }
if (typeof attribution === 'string') { summary.attribution = attribution; }
if (typeof frequencyMode === 'string') { summary.frequencyMode = frequencyMode; }
+ if (typeof sourceLanguage === 'string') { summary.sourceLanguage = sourceLanguage; }
+ if (typeof targetLanguage === 'string') { summary.targetLanguage = targetLanguage; }
return summary;
}
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index a0e0c196..f0450892 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -211,12 +211,14 @@ class DictionaryEntry {
* @returns {boolean}
*/
_setupDetails(detailsTable) {
- /** @type {[label: string, key: 'author'|'url'|'description'|'attribution'][]} */
+ /** @type {[label: string, key: 'author'|'url'|'description'|'attribution'|'sourceLanguage'|'targetLanguage'][]} */
const targets = [
['Author', 'author'],
['URL', 'url'],
['Description', 'description'],
- ['Attribution', 'attribution']
+ ['Attribution', 'attribution'],
+ ['Source Language', 'sourceLanguage'],
+ ['Target Language', 'targetLanguage']
];
const dictionaryInfo = this._dictionaryInfo;