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

Language translations #89

Closed
wants to merge 2 commits into from
Closed

Language translations #89

wants to merge 2 commits into from

Conversation

zaoqi
Copy link
Contributor

@zaoqi zaoqi commented Feb 9, 2017

根据浏览器的语言来翻译网页

@zaoqi zaoqi mentioned this pull request Feb 9, 2017
@rubenwardy
Copy link
Member

The site needs to work without Javascript (Although it's fine if it just shows in English without JS, imo, although ideally internationalisation should work without it)

@zaoqi
Copy link
Contributor Author

zaoqi commented Feb 10, 2017

Now can work without Javascript

@ShadowNinja
Copy link
Member

The code shouldn't try to download an English translation when that's the default.

This also looks very ad-hoc. Isn't there a standard way of doing this instead of writing our own system?

@zaoqi
Copy link
Contributor Author

zaoqi commented Feb 11, 2017

BASH

touch locale/en-us.txt

@zaoqi
Copy link
Contributor Author

zaoqi commented Feb 12, 2017

jQuery.i18n.properties

<h1>Meet Minetest.</h1> -> <h1 id="meetminetest">Meet Minetest.</h1>
*_en.properties:
meetminetest=Meet Minetest.
*_zh.properties:
meetminetest=遇见Minetest。

This

en-us.txt:

zh-cn.txt:
Meet Minetest.:=遇见Minetest。

@ShadowNinja
Copy link
Member

I'm aware the file can be created, but it shouldn't be necessary. If the user's language is english (the majority of our users) they're going at hove to make another request for nothing, which will slow down the page load and waste bandwidth.

The jQuery thing seems much better. This also looks good: https://github.com/wikimedia/jquery.i18n

@rubenwardy rubenwardy closed this Mar 12, 2018
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

Successfully merging this pull request may close these issues.

3 participants