Skip to content

Commit

Permalink
tweak(locale): merging portuguese languages
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Dec 30, 2021
1 parent f7edb28 commit 2f71467
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 299 deletions.
2 changes: 1 addition & 1 deletion locale/pt_BR.json → locale/pt.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$meta": {
"label": "Portuguese (Brazil)",
"label": "Portuguese",
"humanizer_language": "pt"
},
"restarter": {
Expand Down
290 changes: 0 additions & 290 deletions locale/pt_PT.json

This file was deleted.

6 changes: 2 additions & 4 deletions menu/src/utils/getLocale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import lv from "../../../locale/lv.json";
import nl from "../../../locale/nl.json";
import no from "../../../locale/no.json";
import pl from "../../../locale/pl.json";
import pt_BR from "../../../locale/pt_BR.json";
import pt_PT from "../../../locale/pt_PT.json";
import pt from "../../../locale/pt.json";
import ro from "../../../locale/ro.json";
import ru from "../../../locale/ru.json";
import sv from "../../../locale/sv.json";
Expand All @@ -53,8 +52,7 @@ const localeMap = {
nl,
no,
pl,
pt_BR,
pt_PT,
pt,
ro,
ru,
sv,
Expand Down
6 changes: 6 additions & 0 deletions src/components/configVault.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@ module.exports = class ConfigVault {
quiet: toDefault(cfg.fxRunner.quiet, null),
};

//Migrations
//Removing menu beta convar (v4.9)
out.fxRunner.commandLine = out.fxRunner.commandLine?.replace(/\+?setr? txEnableMenuBeta true\s?/gi, '');

//Merging portuguese
if (out.global.language === 'pt_PT' || out.global.language === 'pt_BR'){
out.global.language = 'pt';
}
} catch (error) {
if (GlobalData.verbose) dir(error);
throw new Error(`Malformed configuration file! Make sure your txAdmin is updated!\nOriginal error: ${error.message}`);
Expand Down
3 changes: 1 addition & 2 deletions src/components/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const languages = {
nl: require('../../locale/nl.json'),
no: require('../../locale/no.json'),
pl: require('../../locale/pl.json'),
pt_BR: require('../../locale/pt_BR.json'),
pt_PT: require('../../locale/pt_PT.json'),
pt: require('../../locale/pt.json'),
ro: require('../../locale/ro.json'),
ru: require('../../locale/ru.json'),
sv: require('../../locale/sv.json'),
Expand Down
3 changes: 1 addition & 2 deletions web/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ <h2>Settings</h2>
<option value="nl" {{it.global.language=='nl'|isSelected}}>Dutch</option>
<option value="no" {{it.global.language=='no'|isSelected}}>Norwegian</option>
<option value="pl" {{it.global.language=='pl'|isSelected}}>Polish</option>
<option value="pt_BR" {{it.global.language=='pt_BR'|isSelected}}>Portuguese (Brazil)</option>
<option value="pt_PT" {{it.global.language=='pt_PT'|isSelected}}>Portuguese (Portugal)</option>
<option value="pt" {{it.global.language=='pt'|isSelected}}>Portuguese</option>
<option value="ro" {{it.global.language=='ro'|isSelected}}>Romanian</option>
<option value="ru" {{it.global.language=='ru'|isSelected}}>Russian</option>
<option value="sv" {{it.global.language=='sv'|isSelected}}>Swedish</option>
Expand Down

0 comments on commit 2f71467

Please sign in to comment.