Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
gs
Browse files Browse the repository at this point in the history
  • Loading branch information
theowenyoung committed Nov 10, 2022
1 parent 8531b50 commit c74d060
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 0.0.19.1

- Support substack.com
- tweetdesk.twitter.com

## 0.0.19

- Support Is Show Dual Language Option
Expand Down
2 changes: 1 addition & 1 deletion src/chrome_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "Immersive Translate",
"description": "Let's experience immersive web translation, with bilingual simultaneous display and translation of only the important content.",
"version": "0.0.19",
"version": "0.0.19.1",
"homepage_url": "https://github.com/immersive-translate/immersive-translate",

"commands": {
Expand Down
16 changes: 13 additions & 3 deletions src/contentScript/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ const inlineElements = [

const translateSelectors = [
{
hostname:"twitter.com",
hostname:["twitter.com","tweetdeck.twitter.com","mobile.twitter.com"],
selectors:[
'[data-testid="tweetText"]'
'[data-testid="tweetText"]',".tweet-text" ,".js-quoted-tweet-text"
]
},
{
Expand Down Expand Up @@ -160,6 +160,16 @@ const translateSelectors = [
hostname:"www.facebook.com",
selectors:["div[data-ad-comet-preview=message] > div > div","div[role=article] > div > div > div > div > div > div > div > div "]

},
{
regex:'\.substack\.com\/',
selectors:[
".post-preview-title",
".post-preview-description"
],
containerSelectors:[
".post"
]
}

]
Expand Down Expand Up @@ -319,7 +329,7 @@ function getNodesThatNeedToTranslate(root,ctx,options){
for(const selector of allBlocksSelectors){
const nodes = root.querySelectorAll(selector);
for(const node of nodes){
if(currentHostname==="twitter.com"){
if(currentHostname==="twitter.com" || currentHostname==="twitterdesk.twitter.com" || currentHostname==="mobile.twitter.com"){
// check language
try{
const lang = node.getAttribute("lang");
Expand Down
5 changes: 5 additions & 0 deletions src/icons/Green_translation_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/icon-128-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/icon-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/icon-32-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/icon-64-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "Immersive Translate",
"description": "Let's experience immersive web translation, with bilingual simultaneous display and translation of only the important content.",
"version": "0.0.19",
"version": "0.0.19.1",
"homepage_url": "https://github.com/immersive-translate/immersive-translate",

"browser_specific_settings": {
Expand Down

0 comments on commit c74d060

Please sign in to comment.