mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-05-19 05:25:37 +00:00
refactor: add missing jsdoc for I18n class methods (#3153)
This commit is contained in:
committed by
GitHub
parent
eab5fc0274
commit
20be43939b
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user