Lines Matching refs:locale
14 this.locale = opts.locale || 'en';
29 if (!this.cache[this.locale])
32 if (!this.cache[this.locale][str] && this.updateFiles) {
33 this.cache[this.locale][str] = str;
34 // include the current directory and locale,
39 locale: this.locale,
46 return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
56 if (!this.cache[this.locale])
59 if (this.cache[this.locale][singular]) {
60 const entry = this.cache[this.locale][singular];
64 if (!this.cache[this.locale][singular] && this.updateFiles) {
65 this.cache[this.locale][singular] = {
69 // include the current directory and locale,
74 locale: this.locale,
88 setLocale(locale) {
89 this.locale = locale;
92 return this.locale;
95 if (!this.cache[this.locale])
99 this.cache[this.locale][key] = obj[key];
124 const locale = work.locale;
126 const languageFile = this._resolveLocaleFile(directory, locale);
127 const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
137 const languageFile = this._resolveLocaleFile(this.directory, this.locale);
153 this.cache[this.locale] = localeLookup;
155 _resolveLocaleFile(directory, locale) {
156 let file = shim.resolve(directory, './', locale + '.json');
157 if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
159 const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json');
178 locale: y18n.locale