summaryrefslogtreecommitdiff
path: root/ext/js/language/multi-language-transformer.js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-06-03 19:25:51 +0200
committerGitHub <noreply@github.com>2024-06-03 17:25:51 +0000
commit7955fc85ac089d856b44bdea78eccd26ffbd690c (patch)
tree6a7cfc6464612f9f129b25fa59a46f9c7c0e72b5 /ext/js/language/multi-language-transformer.js
parentd2fce502ecb00e3c9202295c93fbb8c554ddbd69 (diff)
display inflection rule descriptions (#1000)24.6.3.0
* load descriptions in deinflector * description functions in deinflectors * show descriptions in title * use toaster * use names without internal * css lint * reformat transform descriptors * fix merge errors * done? * rename method
Diffstat (limited to 'ext/js/language/multi-language-transformer.js')
-rw-r--r--ext/js/language/multi-language-transformer.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/js/language/multi-language-transformer.js b/ext/js/language/multi-language-transformer.js
index 4e85aa65..fec682a3 100644
--- a/ext/js/language/multi-language-transformer.js
+++ b/ext/js/language/multi-language-transformer.js
@@ -74,4 +74,17 @@ export class MultiLanguageTransformer {
if (typeof languageTransformer === 'undefined') { return [LanguageTransformer.createTransformedText(sourceText, 0, [])]; }
return languageTransformer.transform(sourceText);
}
+
+ /**
+ * @param {string} language
+ * @param {string[]} inflectionRules
+ * @returns {import('dictionary').InflectionRuleChain}
+ */
+ getUserFacingInflectionRules(language, inflectionRules) {
+ const languageTransformer = this._languageTransformers.get(language);
+ if (typeof languageTransformer === 'undefined') {
+ return inflectionRules.map((rule) => ({name: rule}));
+ }
+ return languageTransformer.getUserFacingInflectionRules(inflectionRules);
+ }
}