5353 class =" mb-2 min-w-52 max-w-[20em]"
5454 >
5555 <div
56- v-if =" supportedLocales .length > 1"
56+ v-if =" getSupportedLocalesList() .length > 1"
5757 class =" -ml-2 -mr-2 border-b border-b-light pb-2 pl-2 pr-2"
5858 >
5959 <div class =" ps-2 text-base-bold leading-6 text-secondary" >
6060 Change Language
6161 </div >
6262 <ul >
6363 <li
64- v-for =" locale in supportedLocales "
64+ v-for =" locale in getSupportedLocalesList() "
6565 :key =" locale.key"
6666 :class =" actionLinkStyle"
6767 >
@@ -165,13 +165,6 @@ const {pageUrl: editProfileLink} = useUrl('user/profile');
165165
166166const {getSupportedLocales , getCurrentLocale , getHelpUrl } = useApp ();
167167
168- const supportedLocales = Object .entries (getSupportedLocales () || {}).map (
169- ([key , value ]) => {
170- const {pageUrl } = useUrl (` user/setLocale/${ key} ` );
171- return {key, value, href: pageUrl .value };
172- },
173- );
174-
175168const currentLocale = getCurrentLocale ();
176169const helpUrl = getHelpUrl ();
177170
@@ -196,6 +189,13 @@ const actionLinkStyle = [
196189 ' px-2 py-1 leading-6 text-primary' ,
197190];
198191
192+ function getSupportedLocalesList () {
193+ return Object .entries (getSupportedLocales () || {}).map (([key , value ]) => {
194+ const {pageUrl } = useUrl (` user/setLocale/${ key} ` );
195+ return {key, value, href: pageUrl .value + ' ?source=' + document .URL };
196+ });
197+ }
198+
199199/**
200200 * Open a modal showing the user's tasks
201201 */
0 commit comments