summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirankumarb07 <kirankumarb@ami.com>2023-02-07 12:51:52 +0300
committerSivaprabu Ganesan <sivaprabug@ami.com>2023-02-13 09:38:36 +0300
commit38e131ada65ea78b0e73eebde488002b3e2369c9 (patch)
treee1d05546ca0830af9ab078d27b077e7c6c9d466a
parentda53c0676831e845ae22d3c9147df32f2cbb9fc7 (diff)
downloadwebui-vue-38e131ada65ea78b0e73eebde488002b3e2369c9.tar.xz
Page heading do not translated on language change
Log in and log out of the application, change the language, and login to the application. The heading and title are in the previous language translation is handled in the router, and the languages are selected after the router has rendered.The page title and heading translation are handled after the language is selected. Change-Id: Iba42fe3a535fe0b402f551c3f43e19d5ff12181d Signed-off-by: Kirankumar Ballapalli <kirankumarb@ami.com>
-rw-r--r--src/components/Global/PageTitle.vue15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/components/Global/PageTitle.vue b/src/components/Global/PageTitle.vue
index 45c75edb..e195d1ac 100644
--- a/src/components/Global/PageTitle.vue
+++ b/src/components/Global/PageTitle.vue
@@ -6,6 +6,7 @@
</template>
<script>
+import i18n from '@/i18n';
export default {
name: 'PageTitle',
props: {
@@ -19,6 +20,20 @@ export default {
title: this.$route.meta.title,
};
},
+ created() {
+ var title = this.$route.name;
+ var i = 1;
+ while (i < this.$route.name.split('-').length) {
+ var index = title.search('-');
+ title = title.replace(
+ '-' + title.charAt(index + 1),
+ title.charAt(index + 1).toUpperCase()
+ );
+ i++;
+ }
+ this.title = i18n.t('appPageTitle.' + title);
+ document.title = this.title;
+ },
};
</script>