Move i18n to vue-i18n and json files
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<section>
|
||||
<h1 class="title">
|
||||
<translate>My identities</translate>
|
||||
{{ $t('My identities') }}
|
||||
</h1>
|
||||
|
||||
<ul class="identities">
|
||||
@@ -24,7 +24,7 @@
|
||||
</ul>
|
||||
|
||||
<router-link :to="{ name: 'CreateIdentity' }" class="button create-identity is-primary" >
|
||||
<translate>Create a new identity</translate>
|
||||
{{ $t('Create a new identity') }}
|
||||
</router-link>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-field label="Find an address">
|
||||
<b-field :label="$t('Find an address')">
|
||||
<b-autocomplete
|
||||
:data="data"
|
||||
v-model="queryText"
|
||||
placeholder="e.g. 10 Rue Jangot"
|
||||
:placeholder="$t('e.g. 10 Rue Jangot')"
|
||||
field="description"
|
||||
:loading="isFetching"
|
||||
@typing="getAsyncData"
|
||||
@@ -18,12 +18,12 @@
|
||||
</p>
|
||||
</template>
|
||||
<template slot="empty">
|
||||
<span v-if="queryText.length < 5">Please type at least 5 caracters</span>
|
||||
<span v-else-if="isFetching">Searching…</span>
|
||||
<span v-if="queryText.length < 5">{{ $t('Please type at least 5 characters') }}</span>
|
||||
<span v-else-if="isFetching">{{ $t('Searching…') }}</span>
|
||||
<div v-else class="is-enabled">
|
||||
<span>No results for « {{ queryText }} »</span>
|
||||
<span>{{ $t('No results for "{queryText}"', { queryText }) }}</span>
|
||||
<p class="control" @click="addressModalActive = true">
|
||||
<button type="button" class="button is-primary">Add</button>
|
||||
<button type="button" class="button is-primary">{{ $t('Add') }}</button>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
@@ -32,37 +32,37 @@
|
||||
<b-modal :active.sync="addressModalActive" :width="640" has-modal-card scroll="keep">
|
||||
<div class="modal-card" style="width: auto">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Login</p>
|
||||
<p class="modal-card-title">{{ $t('Add an address') }}</p>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<form>
|
||||
<b-field :label="$gettext('Name')">
|
||||
<b-field :label="$t('Name')">
|
||||
<b-input aria-required="true" required v-model="selected.description" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="$gettext('Street')">
|
||||
<b-field :label="$t('Street')">
|
||||
<b-input v-model="selected.street" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="$gettext('Postal Code')">
|
||||
<b-field :label="$t('Postal Code')">
|
||||
<b-input v-model="selected.postalCode" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="$gettext('Locality')">
|
||||
<b-field :label="$t('Locality')">
|
||||
<b-input v-model="selected.locality" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="$gettext('Region')">
|
||||
<b-field :label="$t('Region')">
|
||||
<b-input v-model="selected.region" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="$gettext('Country')">
|
||||
<b-field :label="$t('Country')">
|
||||
<b-input v-model="selected.country" />
|
||||
</b-field>
|
||||
</form>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button" type="button" @click="resetPopup()">Clear</button>
|
||||
<button class="button" type="button" @click="resetPopup()">{{ $t('Clear') }}</button>
|
||||
</footer>
|
||||
</div>
|
||||
</b-modal>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<b-field grouped horizontal :label="label">
|
||||
<b-datepicker expanded v-model="date" :placeholder="$gettext('Click to select')" icon="calendar"></b-datepicker>
|
||||
<b-datepicker expanded v-model="date" :placeholder="$t('Click to select')" icon="calendar"></b-datepicker>
|
||||
<b-input expanded type="time" required v-model="time" />
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<!-- <div v-else-if="event.participants.length === 1">-->
|
||||
<!-- <translate-->
|
||||
<!-- :translate-params="{name: event.participants[0].actor.preferredUsername}"-->
|
||||
<!-- >%{name} organizes this event</translate>-->
|
||||
<!-- >{name} organizes this event</translate>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else>-->
|
||||
<!-- <span v-for="participant in event.participants" :key="participant.actor.uuid">-->
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- <span v-if="participant.role === ParticipantRole.CREATOR">(organizer)</span>,-->
|
||||
<!-- <!– <translate-->
|
||||
<!-- :translate-params="{name: participant.actor.preferredUsername}"-->
|
||||
<!-- > %{name} is in,</translate>–>-->
|
||||
<!-- > {name} is in,</translate>–>-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
</router-link>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<template>
|
||||
<span v-if="!endsOn">{{ beginsOn | formatDateTimeString }}</span>
|
||||
<translate
|
||||
v-else-if="isSameDay()"
|
||||
:translate-params="{date: formatDate(beginsOn), startTime: formatTime(beginsOn), endTime: formatTime(endsOn)}"
|
||||
>The %{ date } from %{ startTime } to %{ endTime }</translate>
|
||||
<translate
|
||||
v-else-if="endsOn"
|
||||
:translate-params="{startDate: formatDate(beginsOn), startTime: formatTime(beginsOn), endDate: formatDate(endsOn), endTime: formatTime(endsOn)}"
|
||||
>From the %{ startDate } at %{ startTime } to the %{ endDate } at %{ endTime }</translate>
|
||||
<span v-else-if="isSameDay()">
|
||||
{{ $t('The {date} from {startTime} to {endTime}', {date: formatDate(beginsOn), startTime: formatTime(beginsOn), endTime: formatTime(endsOn)}) }}
|
||||
</span>
|
||||
<span v-else-if="endsOn">
|
||||
{{ $t('From the {startDate} at {startTime} to the {endDate} at {endTime}',
|
||||
{startDate: formatDate(beginsOn), startTime: formatTime(beginsOn), endDate: formatDate(endsOn), endTime: formatTime(endsOn)}) }}
|
||||
</span>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="media-content">
|
||||
<p>Do you want to participate in {{ event.title }}?</p>
|
||||
|
||||
<b-field :label="$gettext('Identity')">
|
||||
<b-field :label="$t('Identity')">
|
||||
<identity-picker v-model="identity"></identity-picker>
|
||||
</b-field>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<b-field label="Enter some tags">
|
||||
<b-field :label="$t('Enter some tags')">
|
||||
<b-taginput
|
||||
v-model="tagsStrings"
|
||||
:data="filteredTags"
|
||||
@@ -7,7 +7,7 @@
|
||||
:allow-new="true"
|
||||
:field="path"
|
||||
icon="label"
|
||||
placeholder="Add a tag"
|
||||
:placeholder="$t('Add a tag')"
|
||||
@typing="getFilteredTags"
|
||||
>
|
||||
</b-taginput>
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
<template>
|
||||
<footer class="footer">
|
||||
<mobilizon-logo :invert="true" class="logo" />
|
||||
<img src="../assets/footer.png" :alt="$gettext('World map')" />
|
||||
<img src="../assets/footer.png" :alt="$t('World map')" />
|
||||
<ul>
|
||||
<li><router-link :to="{ name: 'About'}"><translate>About</translate></router-link></li>
|
||||
<li><router-link :to="{ name: 'Licence'}"><translate>License</translate></router-link></li>
|
||||
<li><router-link :to="{ name: 'Legal'}"><translate>Legal</translate></router-link></li>
|
||||
<li><a href="https://joinmobilizon.org">{{ $t('About') }}</a></li>
|
||||
<li><a href="https://framagit.org/framasoft/mobilizon/blob/master/LICENSE">{{ $t('License') }}</a></li>
|
||||
</ul>
|
||||
<div class="content has-text-centered">
|
||||
<span
|
||||
v-translate="{
|
||||
date: new Date().getFullYear(),
|
||||
}"
|
||||
>© The Mobilizon Contributors %{date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks</span>
|
||||
<span>{{ $t('© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks', { date: new Date().getFullYear()}) }}</span>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
@@ -53,28 +53,28 @@
|
||||
</div>
|
||||
|
||||
<a class="navbar-item">
|
||||
<router-link :to="{ name: 'UpdateIdentity' }" v-translate>My account</router-link>
|
||||
<router-link :to="{ name: 'UpdateIdentity' }">{{ $t('My account') }}</router-link>
|
||||
</a>
|
||||
|
||||
<a class="navbar-item">
|
||||
<router-link :to="{ name: ActorRouteName.CREATE_GROUP }" v-translate>Create group</router-link>
|
||||
<router-link :to="{ name: ActorRouteName.CREATE_GROUP }">{{ $t('Create group') }}</router-link>
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" v-if="currentUser.role === ICurrentUserRole.ADMINISTRATOR">
|
||||
<router-link :to="{ name: AdminRouteName.DASHBOARD }" v-translate>Administration</router-link>
|
||||
<router-link :to="{ name: AdminRouteName.DASHBOARD }">{{ $t('Administration') }}</router-link>
|
||||
</a>
|
||||
|
||||
<a v-translate class="navbar-item" v-on:click="logout()">Log out</a>
|
||||
<a class="navbar-item" v-on:click="logout()">{{ $t('Log out') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="navbar-item" v-else>
|
||||
<div class="buttons">
|
||||
<router-link class="button is-primary" v-if="config && config.registrationsOpen" :to="{ name: 'Register' }">
|
||||
<strong v-translate>Sign up</strong>
|
||||
<strong>{{ $t('Sign up') }}</strong>
|
||||
</router-link>
|
||||
|
||||
<router-link class="button is-primary" :to="{ name: 'Login' }" v-translate>Log in</router-link>
|
||||
<router-link class="button is-primary" :to="{ name: 'Login' }">{{ $t('Log in') }}</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<b-upload @input="onFileChanged">
|
||||
<a class="button is-primary">
|
||||
<b-icon icon="upload"></b-icon>
|
||||
<span>Click to upload</span>
|
||||
<span>{{ $t('Click to upload') }}</span>
|
||||
</a>
|
||||
</b-upload>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class SearchField extends Vue {
|
||||
|
||||
get defaultPlaceHolder(): string {
|
||||
// We can't use "this" inside @Prop's default value.
|
||||
return this.placeholder || this.$gettext('Search');
|
||||
return this.placeholder || this.$t('Search') as string;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user