Skip to content

Commit

Permalink
Fix typo in Portugues Brazilian language code
Browse files Browse the repository at this point in the history
  • Loading branch information
sulkaharo committed Nov 23, 2020
1 parent 76ce300 commit cb7c74e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function init(fs) {
, { code: 'nb', file: 'nb_NO', language: 'Norsk (Bokmål)', speechCode: 'no-NO' }
, { code: 'nl', file: 'nl_NL', language: 'Nederlands', speechCode: 'nl-NL' }
, { code: 'pl', file: 'pl_PL', language: 'Polski', speechCode: 'pl-PL' }
, { code: 'pt', file: 'pr_BR', language: 'Português (Brasil)', speechCode: 'pt-BR' }
, { code: 'pt', file: 'pt_BR', language: 'Português (Brasil)', speechCode: 'pt-BR' }
, { code: 'ro', file: 'ro_RO', language: 'Română', speechCode: 'ro-RO' }
, { code: 'ru', file: 'ru_RU', language: 'Русский', speechCode: 'ru-RU' }
, { code: 'sk', file: 'sl_SL', language: 'Slovenčina', speechCode: 'sk-SK' }
Expand Down Expand Up @@ -113,8 +113,10 @@ function init(fs) {
}

// this is a server only call and needs fs by reference as the class is also used in the client
language.loadLocalization = function loadLocalization(fs) {
const l = fs.readFileSync('./translations/' + this.getFilename(this.lang));
language.loadLocalization = function loadLocalization(fs, path) {
let filename = './translations/' + this.getFilename(this.lang);
if (path) filename = path.resolve(__dirname, filename);
const l = fs.readFileSync(filename);
this.offerTranslations(JSON.parse(l));
}

Expand All @@ -128,6 +130,14 @@ function init(fs) {
return language();
};

language.get = function get(lang) {
var r;
language.languages.forEach(function (l) {
if (l.code === lang) r = l;
});
return r;
}

// if run on server and we get a filesystem handle, load english by default
if (fs) {
language.set('en');
Expand Down

0 comments on commit cb7c74e

Please sign in to comment.