Skip to content

Commit

Permalink
Merge pull request #3 from ychikazawa/port-to-learn-and-support.micro…
Browse files Browse the repository at this point in the history
…soft.com

Port to learn and support.microsoft.com
  • Loading branch information
ychikazawa authored Sep 27, 2022
2 parents 832b686 + e343e7e commit c323f6e
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 20 deletions.
7 changes: 5 additions & 2 deletions _locales/de/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
5 changes: 4 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/es/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/fr/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/it/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/ja/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/ko/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
7 changes: 5 additions & 2 deletions _locales/zh/messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

}
"extName": {
"message": "MSDocs Easy Switch Lang",
"description": "Easy switch lang button on msdocs"
}
}
6 changes: 4 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "MSDocs Easy Switch Lang",
"version": "1.0.1",
"version": "1.0.2",
"description": "Easy switch lang button on msdocs for Microsoft Edge.",
"default_locale": "en",
"icons": {
Expand All @@ -16,7 +16,9 @@
"tabs"
],
"host_permissions": [
"https://docs.microsoft.com/*"
"https://docs.microsoft.com/*",
"https://learn.microsoft.com/*",
"https://support.microsoft.com/*"
],
"background": {
"service_worker": "scripts/background.js"
Expand Down
4 changes: 3 additions & 1 deletion scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* Switch the language of the page
*/
chrome.action.onClicked.addListener(function(tab) {
if (tab.url.includes("https://docs.microsoft.com/")) {
if (tab.url.includes("https://docs.microsoft.com/")
|| tab.url.includes("https://learn.microsoft.com/")
|| tab.url.includes("https://support.microsoft.com/")) {
var currentLang = tab.url.split("/")[3]; // ja-jp, en-us
var uiLang = chrome.i18n.getUILanguage(); // ja, en-us

Expand Down

0 comments on commit c323f6e

Please sign in to comment.