Fix register sentense string

See https://framacolibri.org/t/sinscrire-sur-mobilizon-affiche-au-lieu-du-nom-de-linstance/9838

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-17 10:57:04 +01:00
parent 15fe86b176
commit 5d9a36917d
5 changed files with 26 additions and 7 deletions

View File

@@ -5,7 +5,9 @@
<h1 class="title" v-if="userAlreadyActivated">
{{ $t("Congratulations, your account is now created!") }}
</h1>
<h1 class="title" v-else>{{ $t("Register an account on Mobilizon!") }}</h1>
<h1 class="title" v-else>
{{ $t("Register an account on {instanceName}!", { instanceName: config.name }) }}
</h1>
<p class="content" v-if="userAlreadyActivated">
{{ $t("Now, create your first profile:") }}
</p>
@@ -92,6 +94,8 @@
<script lang="ts">
import { Component, Prop } from "vue-property-decorator";
import { mixins } from "vue-class-component";
import { CONFIG } from "@/graphql/config";
import { IConfig } from "@/types/config.model";
import { IPerson } from "../../types/actor";
import { IDENTITIES, REGISTER_PERSON } from "../../graphql/actor";
import { MOBILIZON_INSTANCE_HOST } from "../../api/_entrypoint";
@@ -99,13 +103,19 @@ import RouteName from "../../router/name";
import { changeIdentity } from "../../utils/auth";
import identityEditionMixin from "../../mixins/identityEdition";
@Component
@Component({
apollo: {
config: CONFIG,
},
})
export default class Register extends mixins(identityEditionMixin) {
@Prop({ type: String, required: true }) email!: string;
@Prop({ type: Boolean, required: false, default: false })
userAlreadyActivated!: boolean;
config!: IConfig;
host?: string = MOBILIZON_INSTANCE_HOST;
errors: Record<string, unknown> = {};

View File

@@ -156,7 +156,9 @@ import AuthProviders from "../../components/User/AuthProviders.vue";
metaInfo() {
return {
// if no subcomponents specify a metaInfo.title, this title will be used
title: this.$t("Register an account on Mobilizon!") as string,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
title: this.title,
// all titles will be injected into this template
titleTemplate: "%s | Mobilizon",
};
@@ -184,6 +186,15 @@ export default class Register extends Vue {
config!: IConfig;
get title(): string {
if (this.config) {
return this.$t("Register an account on {instanceName}!", {
instanceName: this.config.name,
}) as string;
}
return "";
}
async submit(): Promise<void> {
this.sendingForm = true;
this.credentials.locale = this.$i18n.locale;