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

谷歌翻译对中国大陆停止服务,要使用谷歌翻译需要将 *.googleapis.com 添加到代理名单! #400

Closed
Githubbili opened this issue Sep 29, 2022 · 24 comments

Comments

@Githubbili
Copy link

describe the bug描述问题

全部翻译都失效了

steps to reproduce复现步骤

右键点击【翻译】,侧边栏的翻译显示无网络

environment 使用环境

tell us your environment info,e.g.: 在这里给出你的使用环境,例如:

个人电脑

browser name 浏览器类型 [e.g. chrome, firefox]

**edge 105.0.1343.50

侧边翻译 版本2.3.0**

issue screenshot 问题截图
image

image

@Dr-Gavin
Copy link

我也是这个问题,但是腾讯翻译可以用。其他引擎都不行。

@allen19980114
Copy link

这几天我也是这样

@Yingjie-Deng
Copy link

同样的问题,目前只有必应翻译和腾讯翻译可以用。

@ruficol
Copy link

ruficol commented Sep 29, 2022

+1 我也这样 好烦

@gonboy
Copy link

gonboy commented Sep 30, 2022

最近一直这样子

@wjzzd
Copy link

wjzzd commented Sep 30, 2022

只需要在梯子内将 translate.googleapis.com 设为走代理(PROXY)就可以了

@jianbinlu225
Copy link

我也这样 但是edge就莫名奇妙可以用 很奇怪

@ruficol
Copy link

ruficol commented Sep 30, 2022

只需要在梯子内将 translate.googleapis.com 设为走代理(PROXY)就可以了

请教怎么设置呢 谢谢

@bigknife5th
Copy link

Google发言人通过电子邮件告诉TechCrunch,该公司已经停止了Google翻译在中国大陆的服务,原因是"因为使用率低"。

@MuuXB
Copy link

MuuXB commented Oct 2, 2022

只需要在梯子内将 translate.googleapis.com 设为走代理(PROXY)就可以了

感谢,一直没找到这个url

@nickyc975 nickyc975 changed the title 翻译失效了 谷歌翻译对中国大陆停止服务,要使用谷歌翻译需要将 *.googleapis.com 添加到代理名单! Oct 4, 2022
@nickyc975 nickyc975 added the bug Something isn't working label Oct 4, 2022
@nickyc975 nickyc975 pinned this issue Oct 4, 2022
@yanchenyuvip
Copy link

yanchenyuvip commented Oct 8, 2022

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

@MWKrystal
Copy link

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@SETLOCAL enabledelayedexpansion @echo off

set "source_domain=google.cn" set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a set "old_rule=null" set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do ( set "line=%%i" :: Retrieve the rule If the target domain has been exists in the line. if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i" )

if not "%old_rule%"=="null" ( if not "%old_rule%"=="%new_rule%" ( echo Deleting the rule "%old_rule%" echo Adding the rule "%new_rule%" for /f "tokens=" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do ( set "rule=%%i" set "rule=!rule:]=!" if "%old_rule%"=="!rule!" set "rule=%new_rule%" >>%hosts_file% echo(!rule! ) ) else ( echo The rule already exists, nothing to do. ) ) else ( echo Adding the rule "%new_rule%" echo.>>%hosts_file% echo.>>%hosts_file% echo # Fix Google Translate CN>>%hosts_file% echo %new_rule%>>%hosts_file% )

echo Done. pause

Thanks!

@ice-SY15
Copy link

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

赞,操作后,谷歌网页翻译可以用了,谢谢

@Gaia9527
Copy link

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

谢谢!谷歌翻译终于又可以用了!

@hzbtbp
Copy link

hzbtbp commented Oct 20, 2022

厉害呀!又可以使用了,大神,牛, 牛。好人一生平安!

@yunchengwang21
Copy link

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

thanks!

@YunFeng0817 YunFeng0817 mentioned this issue Oct 26, 2022
@YunFeng0817 YunFeng0817 removed the bug Something isn't working label Oct 26, 2022
@PhoenixZhong
Copy link

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

管理员权限运行后,提示
Adding the rule "220.181.174.34 translate.googleapis.com"
拒绝访问。
拒绝访问。
拒绝访问。
拒绝访问。
Done.

@Windrain7
Copy link

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

管理员权限运行后,提示 Adding the rule "220.181.174.34 translate.googleapis.com" 拒绝访问。 拒绝访问。 拒绝访问。 拒绝访问。 Done.

同样提示

@cool-delete
Copy link

cool-delete commented Nov 19, 2022

Adding the rule

详情看
权限设置

@PandaLinks
Copy link

还是拒绝访问……

@sipoli007
Copy link

设置代理后还是无法进行翻译。

@ShitBro369
Copy link

又g了,那位大佬有别的法子

@puchizpc
Copy link

能否使用镜像网站呢?

@zhiheyao
Copy link

zhiheyao commented Mar 9, 2024

没那么复杂,谷歌翻译api在大陆还可以正常使用,以下文本复制到txt,改txt为bat,管理员身份运行即可;

@setlocal enabledelayedexpansion
@echo off

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"

for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain has been exists in the line.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    if not "%old_rule%"=="%new_rule%" (
        echo Deleting the rule "%old_rule%"
        echo Adding the rule "%new_rule%"
        for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
            set "rule=%%i"
            set "rule=!rule:*]=!"
            if "%old_rule%"=="!rule!" set "rule=%new_rule%"
            >>%hosts_file% echo(!rule!
        )
    ) else (
        echo The rule already exists, nothing to do.
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo.>>%hosts_file%
    echo # Fix Google Translate CN>>%hosts_file%
    echo %new_rule%>>%hosts_file%
)

echo Done.
pause

不行啊,还是只有腾讯翻译能用

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