Skip to content

Commit

Permalink
feat: add locales PL and PT (BR)
Browse files Browse the repository at this point in the history
Signed-off-by: Till Sanders <mail@till-sanders.de>
  • Loading branch information
tillsanders committed Oct 11, 2021
1 parent ab28535 commit e2715a6
Show file tree
Hide file tree
Showing 9 changed files with 599 additions and 15 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@open-election-compass/client",
"version": "1.0.0-beta.11",
"version": "1.0.0-beta.12",
"author": "Till Sanders <mail@till-sanders.de>",
"license": "GPL-3.0",
"main": "dist/lib/open-election-compass.umd.min.js",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/vue-fontawesome": "^2.0.2",
"@open-election-compass/ui": "^0.9.0",
"@open-election-compass/ui": "^0.11.0",
"@wordpress/dom-ready": "^2.9.0",
"core-js": "^3.6.5",
"cross-fetch": "^3.0.5",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"spew": {
"position": "approve",
"explanation": {
"de": "DE Expecto riddikulus aparecium ferula evanesco lacarnum locomotor inflamarae aresto charm rictusempra. Lumos aparecium sonorus locomotor jinx fidelius sonorus inflamarae deletrius. Incarcerous rictusempra petrificus stupefy kedavra rictusempra. Aparecium inflamarae crucio homorphus mortis rennervate orchideous.",
"en": null
"de": "Expecto riddikulus aparecium ferula evanesco lacarnum locomotor inflamarae aresto charm rictusempra. Lumos aparecium sonorus locomotor jinx fidelius sonorus inflamarae deletrius. Incarcerous rictusempra petrificus stupefy kedavra rictusempra. Aparecium inflamarae crucio homorphus mortis rennervate orchideous.",
"en": "Expecto riddikulus aparecium ferula evanesco lacarnum locomotor inflamarae aresto charm rictusempra. Lumos aparecium sonorus locomotor jinx fidelius sonorus inflamarae deletrius. Incarcerous rictusempra petrificus stupefy kedavra rictusempra. Aparecium inflamarae crucio homorphus mortis rennervate orchideous."
}
},
"snape": {
Expand Down
10 changes: 9 additions & 1 deletion src/bootstrap/loadVeeValidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import {
import {
alpha, email, integer, length, max, min, oneOf, regex, required,
} from 'vee-validate/dist/rules.umd';
import ar from 'vee-validate/dist/locale/ar.json';
import de from 'vee-validate/dist/locale/de.json';
import en from 'vee-validate/dist/locale/en.json';
import es from 'vee-validate/dist/locale/es.json';
import id from 'vee-validate/dist/locale/id.json';
import it from 'vee-validate/dist/locale/it.json';
import pl from 'vee-validate/dist/locale/pl.json';
import pt from 'vee-validate/dist/locale/pt_BR.json';

export default function loadVeeValidate() {
extend('alpha', alpha);
Expand All @@ -19,7 +25,9 @@ export default function loadVeeValidate() {
extend('regex', regex);
extend('required', required);

localize({ de, en });
localize({
ar, de, en, es, id, it, pl, pt,
});

Vue.component('ValidationObserver', ValidationObserver);
Vue.component('ValidationProvider', ValidationProvider);
Expand Down
12 changes: 12 additions & 0 deletions src/locales/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import {
esLocale as esUILocale,
idLocale as idUILocale,
itLocale as itUILocale,
plLocale as plUILocale,
ptLocale as ptUILocale,
} from '@open-election-compass/ui';
import ar from './ar.yaml';
import de from './de.yaml';
import en from './en.yaml';
import es from './es.yaml';
import id from './id.yaml';
import it from './it.yaml';
import pl from './pl.yaml';
import pt from './pt.yaml';

Vue.use(VueI18n);

Expand Down Expand Up @@ -46,11 +50,19 @@ i18n.mergeLocaleMessage('id', idUILocale);
i18n.setLocaleMessage('it', it);
i18n.mergeLocaleMessage('it', itUILocale);

i18n.setLocaleMessage('pl', pl);
i18n.mergeLocaleMessage('pl', plUILocale);

i18n.setLocaleMessage('pt', pt);
i18n.mergeLocaleMessage('pt', ptUILocale);

localize('ar', ar.validation);
localize('de', de.validation);
localize('en', en.validation);
localize('es', es.validation);
localize('id', id.validation);
localize('it', it.validation);
localize('pl', pl.validation);
localize('pt', pt.validation);

export default i18n;
Loading

0 comments on commit e2715a6

Please sign in to comment.