TieuThanhNhi / Google Language Switcher

Published:

Version: 0.2+88da946

Summary: Lưu và áp dụng tùy chọn ngôn ngữ cho Google Search với nhiều ngôn ngữ phổ biến

Copyright: 2024, TieuThanhNhi (https://openuserjs.org/users/TieuThanhNhi)

License: MIT

This is a script for browser extensions like Tampermonkey, Greasemonkey, etc. It adds a language switcher to Google Search pages.

Description:

Name: Google Language Switcher
Description: Save and apply language preference for Google Search with many popular languages.
Match: Run the script on all Google websites (google.com, google.ad, etc.) for various countries.
Permissions:
GM_setValue: Allows the script to store data (in this case, the selected language) locally.
GM_getValue: Allows the script to retrieve stored data.
How it works:

Storing the language: When a user selects a language from the list, the script stores the language code (e.g., 'en', 'vi', 'ja') using GM_setValue.
Applying the language on page load: Each time the user visits Google Search, the script checks if a language has been previously stored using GM_getValue.
If so, it automatically switches the language of Google Search to the stored language.
Adding the language switcher: The script adds a simple dropdown menu to the top right corner of the Google Search page.
This menu lists many popular languages.
When the user selects a new language, the script updates the stored language and reloads the Google Search page with the new language.
Instructions for use:

Install a browser extension that supports userscripts such as Tampermonkey or Greasemonkey.
Create a new userscript and paste this script code into it.
Save the script.
Visit Google Search.
You will see a new dropdown menu allowing you to switch the language of Google Search.
Note:

This script only applies to the Google search page (google.com/search).
If you clear your browser data or uninstall the extension, the saved language will be lost.

Rating: 0