[tmp] vue i18n error

This commit is contained in:
2021-03-26 18:36:52 +01:00
parent 88996f81d8
commit 7b0bc22a71
5 changed files with 93 additions and 84 deletions

View File

@@ -9,7 +9,7 @@
<p
v-if="state.org_name !== ''"
class="mx-auto leading-relaxed text-base text-center"
>Organization: {{ state.org_name }}</p>
>{{ $t('organization') }}: {{ state.org_name }}</p>
<p v-else class="mx-auto leading-relaxed text-base text-center">Bürgerlauf</p>
<div class="mt-4">
<label for="first_name" class="block font-medium">
@@ -247,6 +247,8 @@ import isEmail from 'validator/es/lib/isEmail';
import isMobilePhone from 'validator/es/lib/isMobilePhone';
import isPostalCode from 'validator/es/lib/isPostalCode';
import { useToast } from "vue-toastification";
import { router } from '../router';
import { i18n } from '../language';
const props = defineProps({
token: String
@@ -274,6 +276,9 @@ const state = reactive({
&& userdetails.value.lastname && (provide_address.value === false || provide_address.value === true && (userdetails.value.address.street.trim() && userdetails.value.address.city.trim() && isPostalCode(userdetails.value.address.zipcode, "DE"))))
})
const toast = useToast();
const $t = this.$t.bind(this)
console.log($t);
// console.log(i18n('you_have_been_registered'));
function login() {
userdetails = userdetails.value;
if (userdetails.phone === "" || isMobilePhone(userdetails.phone)) {
@@ -305,9 +310,10 @@ function login() {
axios.post(url, postdata)
.then(({ data }) => {
const token = btoa(data.token);
location.replace("../profile/" + token)
// location.replace("../profile/" + token)
router.push("../profile/" + token);
//
toast.success("You have been registered!");
toast.success($t('you_have_been_registered'));
})
.catch((error) => {
console.log(error);