From 3d3d27c69ff5d24a90592d10c11e2c3070994827 Mon Sep 17 00:00:00 2001 From: Alexandr Garbuzov Date: Sun, 27 Aug 2023 10:54:07 +0300 Subject: [PATCH] refactor: add missing jsdoc for I18n class methods (#3153) --- src/common/I18n.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/I18n.js b/src/common/I18n.js index 8d80a8510bc5c..a2eccc08ac054 100644 --- a/src/common/I18n.js +++ b/src/common/I18n.js @@ -2,12 +2,25 @@ * I18n translation class. */ class I18n { + /** + * Constructor. + * + * @param {Object} options Options. + * @param {string} options.locale Locale. + * @param {Object} options.translations Translations. + */ constructor({ locale, translations }) { this.locale = locale; this.translations = translations; this.fallbackLocale = "en"; } + /** + * Get translation. + * + * @param {string} str String to translate. + * @returns {string} Translated string. + */ t(str) { const locale = this.locale || this.fallbackLocale;