Looking for a way to switch between Chinese and English on the official website?
company website, pure static text, would like to ask how to quickly achieve a Chinese-English switching function?
some methods have been tried so far, such as
method 1: translate the whole document directly with Microsoft js file , but this method has a drawback. The translated text always has this box
.
method 2: the result of method 1 certainly cannot meet the needs of the company, so another way is to rewrite a copy of the English official website. This is a complete rewrite, which is equivalent to doing it all over again. It feels that the workload is too mechanical
.
so, what do you think is the best way to find a better solution?
usually these several language versions of the page are written in each language. There are many disadvantages in using language translation directly. The current language conversion can not do complete error-free translation
I don't know what your specific needs are, but you can use "i18n" as a keyword to look for it in Github. For example, there are plugins for jQ, and there are some others. You limit Languages to javascript and sort it by stars, and just pick the right one.
sofa has a point, your own website is completely static. It's not a big problem to make a copy of the corrected text. It's just a matter of studying what tools to use to quickly replace the text in the file. It makes sense because the versions of websites in different languages actually involve not only text, but also other resources that you inevitably need to be treated differently according to language. Like pictures. If you have different directories on different websites, just put pictures in different languages. If other controls, time zone, currency and so on are involved, just copy and change their configuration files, otherwise there will be a lot of holes in your static website. This method is simple, rough and effective, and can avoid a lot of problems. Don't worry. If you think about the future, foreign language websites, foreign visits are too slow, will you consider deploying to foreign countries alone in the future? That should be divided into two websites. There is also a key issue, is the official website, to consider the search engine included. So to use js to control, we should consider SEO.
if you are interested in studying this technology, i18n on the second floor is a good direction. This approach was used in my recent vuejs project. You can study and have fun by yourself. The thing of the company is that it is simple, feasible and reliable.
is generally two pages
two pages, pure static two pages are easier to control, otherwise words and Chinese are different, some places of css need to fine-tune
multilingual version to recommend a new page, otherwise the problem will be very big, personal experience, and a lot of words must be professional vocabulary, some can not be used.
replace with expression plus i18n resource. General front-end components are good