Code Monkey home page Code Monkey logo

Comments (29)

cesaryuan avatar cesaryuan commented on September 24, 2024 1

Hi, I find the solution for it.

  1. Download the script on PC
  2. Using VSCode change the script encoding to GB18030
  3. Upload it to some server to get direct link (https://temp.getquicker.net/18359/45e8fc6a9c2749ab861bd6fd81360fec/immersive-translate%20%282%29.user.js)
  4. Open the link in Chrome.

Now the script works fine!

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Did you install ChromeXt from GitHub Actions (not the releases)?
The related bug should have been fixed.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

Did you install ChromeXt from GitHub Actions (not the releases)? The related bug should have been fixed.

Yes, I installed from actions Inform users when page is sandboxed · JingMatrix/ChromeXt@ab6fb47. But it doesn't show up 😂

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Okay, please tell me the steps to reproduce it (starting from installation, on which pages and so on). It is working in my phone.

If you have logs from Xposed, post it here.

Before you reproduce it, ensure restart the browser.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024
  1. open https://immersivetranslate.com/ to install script
  2. open any page
  3. button not show
output.mp4

Xposed logs:

LSPosed_2023-08-17T22_14_18.737322.zip

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Thanks for you video.
But I still cannot not reproduce it.

Can you check from the eruda Info panel whether this userscript is shown there?
If there are errors, eruda console might show something.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

Can you check from the eruda Info panel whether this userscript is shown there?

Unfortunately, there is nothing in console panel. 😂

image

That's so weird, because that kiss-translator's floating button can show up.

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Maybe confusing, I meant eruda Info panel, not eruda Console panel.

By the way, things will be easier if you know how to inspect pages (it is taught in the introducing video).

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

Maybe confusing, I meant eruda Info panel, not eruda Console panel.

By the way, things will be easier if you know how to inspect pages (it is taught in the introducing video).

Uncaught SyntaxError: Invalid regular expression: /[\u3041-\u3096\u309D-\u309F]|\uD82C[\uDC01-\uDD1F\uDD32\uDD50-\uDD52]|\uD83C\uDE00|[\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00\uDD20-\uDD22\uDD55\uDD64-\uDD67]|[銗€-涠典竴-榫痌/g,jav:/[\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF]/g: Range out of order in character class (at https://immersive-translate.owenyoung.com/:Immersive Translate:4100:3545)

image

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Okay, I know the problem now.
Your internet blocks a js lib (which is used to fix text encoding) for the code editor.

The solution for you is:
Download the script from github release https://github.com/immersive-translate/immersive-translate/releases/tag/v0.8.0 and install it.

Becasuse the official website of immersive-translate has the problem of utf-8 encoding. (I am apparently not happy with the website).

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Make sure the Chinese characters in this page are shown correctly before you install it:

screenshot_2023-08-17T18:03:49

This issue is a duplicate of #54 (comment)

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

Make sure the Chinese characters in this page are shown correctly before you install it:安装前请确保该页面的汉字显示正确:

screenshot_2023-08-17T18:03:49

This issue is a duplicate of #54 (comment)这个问题是#54(评论)的重复

Thank you for your reply, I tried to download the script from Release, and found that there is still a problem. I checked the file with VSCode and found that the file is UTF-8 encoded. Do I need to change to another encoding?

image

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

I see, it is not the problem of your internet. It is that your system has different encoding.

The best url for you should be (dont't download it, install it in the page): https://raw.githubusercontent.com/immersive-translate/immersive-translate/main/dist/userscript/immersive-translate.user.js

I wish to support your encoding, tell me your encoding by running console.log(document.characterSet) in your console.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

running console.log(document.characterSet) in your console.

  1. Run in "https://temp.getquicker.net/18359/fcd3ccb864704a6793909ced7e4fbd5b/immersive-translate%20%282%29.user.js", gb18030
  2. Run in Github page, UTF-8

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

It is that your system has different encoding.

My system is Chinese Language 😂

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

I see, some Chinese phones has gb18030 as default encoding.
I might support to convert it in the future, if I find a js library to do the job. (It is quite tricky).

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

I see, some Chinese phones has gb18030 as default encoding. I might support to convert it in the future, if I find a js library to do the job. (It is quite tricky)

Maybe we can request the .user.js in java level?

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

If we do it with java, surely, it will give the correct encoding when you install it.
But somehow, I want to make it possible to edit the script in the page, which requires to do it with JS.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

If we do it with java, surely, it will give the correct encoding when you install it. But somehow, I want to make it possible to edit the script in the page, which requires to do it with JS.

It is indeed a lot of trouble, but the conversion encoding scheme may not be completely converted back. Or an api can be provided, https://example.com/convert-encoding?jsurl={original url}, redirect the url of the user script

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

An API endpoint will be very handy!

By the way, could you please copy and paste the wrongly decoded Chinese characters here? (I don't have a device to deconde wrongly).
So that I can test them with my JS codes.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

https://temp.getquicker.net/18359/868f34733d1540869e8073106a4049f4/immersive-translate.user.js

By the way, you can use vscode to reopen the utf-8 file with gb18030 encoding to get the wrongly decoded Chinese characters.

image

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

Now gb18030 encoding can be fixed.
Please try and tell me if it is working.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

Now gb18030 encoding can be fixed. Please try and tell me if it is working.

Thanks for your work. But unfortunately, it is still not working. As I can say, it is because that the converted text is wrong.

  • Origin utf-8 encoding text var test = /[㐀-䶵一-龯]/g test file
  • Converted text var test = /[㐢�-䶵一-龯]/g

image

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

I fixed the encoding algorithm.
It turns out this script happens to work now. Just a few characters in the metadata field not shown correctly.

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

I found that there is a much easier solution: Change you browser language to Engligh and restart it.

English encodings are usually preserved (windows-1252) under UTF-8, unlike Chinese GBK encodings.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

I found that there is a much easier solution: Change you browser language to Engligh and restart it.

Alse tried, not work haha 😂

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

You need to ensure that your browser UI is in English, otherwise it won't takes effects.

from chromext.

cesaryuan avatar cesaryuan commented on September 24, 2024

You need to ensure that your browser UI is in English, otherwise it won't takes effects.

Yeah, I did change the browser UI to English but still not work haha. Maybe need to change whole android system not only the browser. Anyway, even if this is possible, it is still inconvenient for some people who are used to the Chinese system. 😄

from chromext.

JingMatrix avatar JingMatrix commented on September 24, 2024

I found that Chrome did the correct encoding for most cases, and it behavior is a bit reasonable.
So there should be a function to check if the page has the correct encoding.
Now this is done, set commit 8da766b

from chromext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.