-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(dependencies): add dependencies from base to test
- Loading branch information
1 parent
62684ff
commit 59b1721
Showing
6 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
node_modules | ||
/dist | ||
storybook-static | ||
|
||
.vscode | ||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* Config file for i18n plugin */ | ||
|
||
import Vue from 'vue'; | ||
import VueI18n from 'vue-i18n'; | ||
|
||
// The default language is spanish. | ||
// If you add another language to your project be sure to: | ||
// STEP 1: import the validations messages from vee-validate. | ||
import esCL from 'vee-validate/dist/locale/es.json'; | ||
|
||
Vue.use(VueI18n); | ||
|
||
function loadLocaleMessages() { | ||
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i); | ||
const messages = {}; | ||
locales.keys().forEach((key) => { | ||
const matched = key.match(/([A-Za-z0-9-_]+)\./i); | ||
if (matched && matched.length > 1) { | ||
const locale = matched[1]; | ||
messages[locale] = locales(key); | ||
} | ||
}); | ||
|
||
// STEP 2: add the validation messages to the i18n plugin. | ||
// Copy the code below for every new language you add. | ||
messages['es-CL'] = { | ||
...messages['es-CL'], | ||
validations: esCL.messages, | ||
}; | ||
|
||
|
||
return messages; | ||
} | ||
|
||
export default new VueI18n({ | ||
locale: 'es-CL', | ||
fallbackLocale: 'es-CL', | ||
messages: loadLocaleMessages(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"progress-message": "Has utilizado el {0}% de tu cupo." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import Vue from 'vue'; | ||
import App from './App.vue'; | ||
import i18n from './i18n'; | ||
import './vee-validate-config'; | ||
import 'bootstrap'; | ||
|
||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
|
||
Vue.config.productionTip = false; | ||
|
||
new Vue({ | ||
i18n, | ||
render: (h) => h(App), | ||
}).$mount('#app'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-disable camelcase */ | ||
/* eslint-disable no-underscore-dangle */ | ||
|
||
/* Config file for VeeValidate */ | ||
/* Import and extend the rules you need to use. */ | ||
|
||
import { | ||
extend, | ||
configure, | ||
} from 'vee-validate'; | ||
import { | ||
required, | ||
email, | ||
numeric, | ||
min_value, | ||
max_value, | ||
} from 'vee-validate/dist/rules'; | ||
|
||
|
||
import i18n from './i18n'; | ||
|
||
configure({ | ||
defaultMessage: (_, values) => i18n.t(`validations.${values._rule_}`, values), | ||
}); | ||
|
||
extend('required', required); | ||
extend('email', email); | ||
extend('numeric', numeric); | ||
extend('min_value', min_value); | ||
extend('max_value', max_value); |