Skip to content

Commit 56ae578

Browse files
committed
feat: make translation strings dynamic
1 parent 9c02fb9 commit 56ae578

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/login/Loginscreen/providers/FormLogin.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
type="submit"
2929
@click="buttonAction"
3030
>
31-
{{ $t("login.login") }}
31+
{{ $t(`viur.core.modules.user.btn.${getActionNameFromUrl(loginState.formByPass)}`) }}
3232
</sl-button>
3333
</template>
3434

@@ -65,6 +65,11 @@ function calcCurrentUrlOnAction(url, actionName) {
6565
return lastSlashIndex
6666
}
6767
68+
function getActionNameFromUrl(url) {
69+
let splitted = url.split("/")
70+
return splitted[splitted.length - 1]
71+
}
72+
6873
function buttonAction() {
6974
state.showCustomError = false
7075
loginState.loading = true
@@ -82,8 +87,8 @@ function buttonAction() {
8287
} else if (ViFormRef.value.state.actionname.endsWith("_success") && data["next_url"]) {
8388
if (data["next_url"].startsWith("https://")) {
8489
window.location.href = Request.buildUrl(data["next_url"])
85-
} else {
86-
if(data.action === "pwrecover_success") {
90+
} else {
91+
if (data.action === "pwrecover_success") {
8792
location.reload()
8893
return
8994
}

0 commit comments

Comments
 (0)