Skip to content

Instantly share code, notes, and snippets.

@Doliman100
Last active May 2, 2022 12:41
Show Gist options
  • Select an option

  • Save Doliman100/c58903c290cadd0c62ea386113516371 to your computer and use it in GitHub Desktop.

Select an option

Save Doliman100/c58903c290cadd0c62ea386113516371 to your computer and use it in GitHub Desktop.
Switches aliexpress.ru language from Russian to English.
// ==UserScript==
// @version 3.0
// @name AliExpress locale fix
// @namespace https://gist.github.com/Doliman100
// ==/UserScript==
// ==UserScript==
// @name AliExpress locale fix
// @namespace https://gist.github.com/Doliman100
// @version 3.0
// @description Switches aliexpress.ru language from Russian to English.
// @author Doliman100
// @icon https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico
// @updateURL https://gist.githubusercontent.com/raw/c58903c290cadd0c62ea386113516371/script.meta.js
// @downloadURL https://gist.githubusercontent.com/raw/c58903c290cadd0c62ea386113516371/script.user.js
// @match https://aliexpress.ru/*
// @exclude /\/store/
// @grant none
// ==/UserScript==
'use strict';
if (document.querySelector('.TopHeadV2_TopHeadV2__title__dt6yr').textContent === 'Продавайте на AliExpress') {
await fetch('//login.aliexpress.com/setCommonCookie.htm?bLocal=en_US&site=glo', {referrerPolicy: 'strict-origin-when-cross-origin', method: 'GET', mode: 'cors', credentials: 'include'});
window.location.reload();
}
@Korb
Copy link

Korb commented May 20, 2021

Mozilla Firefox 89.0b14 (64-bit), Tampermonkey 4.13.6136 (1 May 2021) — the add-on does not work, there is no redirection to the global Aliexpress website. As before, all links open as Aliexpress.ru.

@Doliman100
Copy link
Author

This script works only on webpages that have an info switcher block. The script waits for loading of a language switching option and as soon as it appears, selects English. After that, it clicks on a save button.

@Korb
Copy link

Korb commented Jun 1, 2021

This script works only on webpages that have an info switcher block.

There is a language switcher on the Aliexpress.ru website. Which does not work either with manual selection or when using this add-on.

2021-06-01_21-35-23

@Doliman100
Copy link
Author

Unfortunately this is the only thing this script do. I was looking for other ways of language switching, but I couldn't find it. You may try to find another script that works better, and share it here. I need it too.

@nidzesi
Copy link

nidzesi commented Jul 31, 2021

Script isn't working anymore. Any update?

@Doliman100
Copy link
Author

Script isn't working anymore. Any update?

Thank you for a report. I will update the script when I find a way to fix this. I want to try changing the cookies directly, but it takes a while to review AliExpress code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment