11<!--
2- Copyright (c) 2020 - for information on the respective copyright owner
2+ Copyright (c) 2020-2021 - for information on the respective copyright owner
33 see the NOTICE file and/or the repository at
4- https://github.com/hyperledger-labs/organizational -agent
4+ https://github.com/hyperledger-labs/business-partner -agent
55
66 SPDX-License-Identifier: Apache-2.0
77-->
1717 >
1818 <v-list-item-content >
1919 <v-list-item-title v-if =" ux.navigation.avatar.agent.default" >
20- <v-img v-if =" logo"
21- contain
22- max-height =" 100"
23- max-width =" 228"
24- :src =" logo"
20+ <v-img
21+ v-if =" logo"
22+ contain
23+ max-height =" 100"
24+ max-width =" 228"
25+ :src =" logo"
2526 ></v-img >
26- <v-img v-else
27- contain
28- max-height =" 100"
29- max-width =" 228"
30- src =" @/assets/logo_default.svg"
27+ <v-img
28+ v-else
29+ contain
30+ max-height =" 100"
31+ max-width =" 228"
32+ src =" @/assets/logo_default.svg"
3133 ></v-img >
3234 </v-list-item-title >
3335 <v-list-item-title v-else >
3436 <v-img
35- contain
36- max-height =" 100"
37- max-width =" 228"
38- :src =" ux.navigation.avatar.agent.src"
37+ contain
38+ max-height =" 100"
39+ max-width =" 228"
40+ :src =" ux.navigation.avatar.agent.src"
3941 ></v-img
40- ></v-list-item-title >
41- <v-list-item-subtitle class =" mt-2 text-wrap nav-display-name" >{{ getNavDisplayName }}</v-list-item-subtitle >
42+ ></v-list-item-title >
43+ <v-list-item-subtitle class =" mt-2 text-wrap nav-display-name" >{{
44+ getNavDisplayName
45+ }}</v-list-item-subtitle >
4246 </v-list-item-content >
4347 </v-list-item >
4448 </router-link >
140144 <template v-slot :append >
141145 <v-list dense >
142146 <v-list-item
143- v-if =" ux.navigation.settings.location === 'bottom'"
144- bottom
145- link
146- :to =" { name: 'Settings' }"
147+ v-if =" ux.navigation.settings.location === 'bottom'"
148+ bottom
149+ link
150+ :to =" { name: 'Settings' }"
147151 >
148152 <v-list-item-action >
149153 <v-icon >$vuetify.icons.settings</v-icon >
182186 </v-navigation-drawer >
183187
184188 <v-app-bar color =" primary" app flat dark >
185- <v-badge v-if =" !drawer"
186- overlap
187- bordered
188- :content =" notificationsCount"
189- :value =" notificationsCount"
190- color =" red"
191- offset-x =" 53"
192- offset-y =" 53"
189+ <v-badge
190+ v-if =" !drawer"
191+ overlap
192+ bordered
193+ :content =" notificationsCount"
194+ :value =" notificationsCount"
195+ color =" red"
196+ offset-x =" 53"
197+ offset-y =" 53"
193198 >
194199 <v-app-bar-nav-icon @click.stop =" drawer = !drawer" />
195200 </v-badge >
298303import { EventBus } from " ./main" ;
299304import Taa from " ./components/taa/TransactionAuthorAgreement" ;
300305import BasicMessages from " @/components/messages/BasicMessages" ;
301- import merge from ' deepmerge' ;
306+ import merge from " deepmerge" ;
307+ import i18n from " @/plugins/i18n" ;
302308
303309export default {
304310 components: {
@@ -333,7 +339,7 @@ export default {
333339 agent: {
334340 enabled: true ,
335341 default: true ,
336- ' show-name' : true
342+ " show-name" : true ,
337343 },
338344 },
339345 about: {
@@ -379,10 +385,13 @@ export default {
379385 return this .$store .getters .messagesCount ;
380386 },
381387 notificationsCount () {
382- return this .$store .getters .taskNotificationsCount + this .$store .getters .activityNotificationsCount ;
388+ return (
389+ this .$store .getters .taskNotificationsCount +
390+ this .$store .getters .activityNotificationsCount
391+ );
383392 },
384393 getAgentName () {
385- let bpaName = " Business Partner Agent " ;
394+ let bpaName = this . $t ( " app.bpaDefaultName " ) ;
386395 const nameSettingValue = this .$store .getters .getSettingByKey (" agentName" );
387396 if (nameSettingValue) {
388397 bpaName = nameSettingValue;
@@ -397,7 +406,7 @@ export default {
397406 return " " ;
398407 },
399408 getNavDisplayName () {
400- if (this .ux .navigation .avatar .agent [' show-name' ]) {
409+ if (this .ux .navigation .avatar .agent [" show-name" ]) {
401410 const result = this .getOrganizationName ;
402411 return result ? result : this .getAgentName ;
403412 }
@@ -418,18 +427,34 @@ export default {
418427 this .$vuetify .theme .dark = this .ux .theme .dark
419428 ? this .ux .theme .dark
420429 : false ;
421- this .$vuetify .theme .themes .light = merge (this .$vuetify .theme .themes .light , this .ux .theme .themes .light );
430+ this .$vuetify .theme .themes .light = merge (
431+ this .$vuetify .theme .themes .light ,
432+ this .ux .theme .themes .light
433+ );
422434 }
435+
423436 const uiColor = localStorage .getItem (" uiColor" );
437+
424438 if (uiColor) {
425439 // if the user stored an override of the primary color, load it.
426440 this .$vuetify .theme .themes .light .primary = uiColor;
427441 }
442+
428443 const uiColorIcons = localStorage .getItem (" uiColorIcons" );
444+
429445 if (uiColorIcons) {
430446 // if the user stored an override of the icons color, load it.
431447 this .$vuetify .theme .themes .light .icons = uiColorIcons;
432448 }
449+
450+ const locale =
451+ localStorage .getItem (" locale" ) ||
452+ navigator .language .split (" -" )[0 ] ||
453+ process .env .VUE_APP_I18N_LOCALE ||
454+ " en" ;
455+ i18n .locale = locale;
456+ this .$vuetify .lang .current = locale;
457+
433458 // Load up an alternate favicon
434459 if (this .ux .favicon ) {
435460 const favicon = document .getElementById (" favicon" );
@@ -487,7 +512,7 @@ export default {
487512 }
488513 // now, open or close it
489514 this .chatWindow = ! this .chatWindow ;
490- }
515+ },
491516 },
492517};
493518 </script >
0 commit comments