Skip to content

Commit 3e6f5b4

Browse files
authored
Merge pull request #608 from bozana/11339-3_5_0
pkp/pkp-lib#11339 add current URL as source parameter for language ch…
2 parents 4120cdf + 0fa9051 commit 3e6f5b4

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/components/TopNavActions/TopNavActions.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
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
166166
const {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-
175168
const currentLocale = getCurrentLocale();
176169
const 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

Comments
 (0)