-
Notifications
You must be signed in to change notification settings - Fork 120
增加自动根据浏览器语言显示对应语言的页面 #9
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
查阅了一下你提交的这段代码,除了给body添加一个langZH/langEN的class之外,并没有做任何事情,也无任何实际效果,属于无效代码。
现有代码支持自动根据浏览器语言来显示的功能,并且支持手动切换语言:
ACME-HTML-Web-Browser-Client/ACME-HTML-Web-Browser-Client.html
Lines 2763 to 2767 in 0400941
window.LangCur=/\b(zh|cn)\b/i.test(navigator.language)?"cn":"en";
window.Lang=function(cn,en,txt){
if((cn||en) && (!cn||!en))throw new Error("Lang bad args");
if(txt)return LangCur=="cn"?cn:en;
var html="",ks={cn:cn,en:en};
ACME-HTML-Web-Browser-Client/ACME-HTML-Web-Browser-Client.html
Lines 2977 to 2983 in 0400941
LangClick(LangCur);
initMainUI();
})();
</script>
<!-- PageRawHTML: 后面不许放内容 -->
我刚才用edge重新测试了下,您原本的代码是能够实现自动切换语言,我平时常用火狐,可能是火狐的缓存机制影响了这个功能的实现吧😅,这样的话我的代码确实多余了,我就结题了吧
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在标签中增加一个函数实现根据浏览器的语言设置自动选择中文/英文版本的页面。
Adding the ability to automatically choose the language displayed on the page according to the language setting of the user's browser.