Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different translation result vs Google Trans Website #403

Open
2 of 6 tasks
WJMacro opened this issue May 10, 2024 · 2 comments
Open
2 of 6 tasks

Different translation result vs Google Trans Website #403

WJMacro opened this issue May 10, 2024 · 2 comments

Comments

@WJMacro
Copy link

WJMacro commented May 10, 2024

Googletrans version:

  • 4.0.0rc1
  • 3.1.0a0
  • 3.0.0
  • 2.x

I'm submitting a ...

  • bug report
  • feature request

Given the following code:

text = 'Here is an example of an HTML page with a dark theme:\n```\n<!DOCTYPE html>\n<html>\n<head>\n\t<title>Dark Theme HTML Page</title>\n\t<style>\n\t\t/* Global Styles */\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t\n\t\t/* Dark Theme Styles */\n\t\tbody {\n\t\t\tbackground-color: #2f2f2f; /* Dark gray background */\n\t\t\tcolor: #fff;'
translator = Translator()
translation = translator.translate(text, src='en', dest='zh-CN')
print([translation.text])

Current behavior:

这是具有深色主题的HTML页面的示例:\n````````\n<!doctype html>\n<html>\n<头>\n<title>深色主题html页</title>\n<样式>\n/ *全球样式 */\n* {\n盒子大小:边框框;\n保证金:0;\n填充:0;\n}\n\n/ *黑暗主题样式 */\n身体 {\n背景色:#2F2F2F;/ *深灰色背景 */\n颜色:#fff;

Expected behavior (Google Trans Website):

下面是一个采用深色主题的 HTML 页面示例:\n```\n<!DOCTYPE html>\n<html>\n<head>\n\t<title>深色主题 HTML 页面</title>\n\t<style>\n\t\t/* 全局样式 */\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t\n\t\t\t/* 深色主题样式 */\n\t\tbody {\n\t\t\tbackground-color: #2f2f2f; /* 深灰色背景 */\n\t\t\tcolor: #fff;

@351691555
Copy link

3.1.0a0 is different

@F0xbite
Copy link

F0xbite commented Jul 4, 2024

I am using 4.0.0rc1 and still have the same problem. Different results (worse) than translate.google.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants