简体   繁体   English

本地化:子域、目录或域

[英]Localization: Sub-Domain, Directory or Domain

I'm about to embark of my first multilingual website and I'd like to get the opinion of everyone...我即将开始我的第一个多语言网站,我想得到大家的意见......

The site will be utilizing jQuery, so there's always the option of using a combination of jQuery and the Session to manage locale.该站点将使用 jQuery,因此始终可以选择结合使用 jQuery 和 Session 来管理区域设置。

What method have you found to be the most cost effective and maintainable when it comes to localization for your website?在为您的网站进行本地化时,您发现哪种方法最具成本效益和可维护性?

1) Sub-Domain (en., fr., es.) 1) 子域(en., fr., es.)

2) Directory (domain.com/fr/) 2) 目录 (domain.com/fr/)

3) Domain (domain.au, domain.it) 3) 域(domain.au、domain.it)

4) Session and JavaScript (and any particular plugins) 4) Session 和 JavaScript(以及任何特定插件)

Keep in mind that I am not using the .NET platform so I will not be able to utilize their methods.请记住,我没有使用 .NET 平台,因此我将无法使用他们的方法。 Whatever the best process, whether it's PHP or ColdFusion, it should be the same concept.无论哪种工艺最好,无论是PHP还是ColdFusion,都应该是同一个概念。

This is kind of an opinion rather than a fact Q & A - so here's my opinion, be it right or wrong这是一种观点,而不是事实问答 - 所以这是我的观点,无论是对还是错

I would go with subdomain (en.mysite.com / fr.mysite.com):我会 go 与子域(en.mysite.com / fr.mysite.com):

  1. you control it fairly easily你很容易控制它

  2. search engines will love it (you may get a halo effect from indexing each)搜索引擎会喜欢它(您可能会从每个索引中获得光环效应)

  3. keeps both relative and absolute pathing simple (unlike like directory)保持相对和绝对路径简单(不像目录)

  4. after selection of locale (which i'll detail later), everything should 'just work'选择语言环境后(我稍后会详细介绍),一切都应该“正常工作”

  5. session / javascript are unreliable at best, a nightmare of compliance at worse session / javascript 充其量是不可靠的,更糟糕的是合规性的噩梦

And finally, there are no perceivable benefits (that i can immediately think of) of any of the other methods you're considering that do not also apply to subdomain - however, the others do lack some of the subdomain flexibility (like pathing).最后,您正在考虑的任何其他方法都没有明显的好处(我可以立即想到),这些方法也不适用于子域 - 但是,其他方法确实缺乏一些子域的灵活性(如路径)。

Some people are answering how you are going about chosing the proper locale of a visitor, such as sniffing the browser language.有些人正在回答您将如何选择访问者的正确语言环境,例如嗅探浏览器语言。 That is a different question, there's a number of ways to do that - I suggest to do them all, the trick (and your decision) is how to prioritize them.这是一个不同的问题,有很多方法可以做到这一点 - 我建议全部做,诀窍(和你的决定)是如何优先考虑它们。 ex: browser language vs. ip origin vs. cookie vs. manual selection vs. etc - which takes precedence?例如:浏览器语言与 ip 来源与 cookie 与手动选择与等 - 哪个优先?

have fun, localization can be.....a task.玩得开心,本地化可以是……一项任务。 =) =)

Here are some articles that may help you:以下是一些可能对您有所帮助的文章:

- Top 5 Tips for Multi-Lingual Website Success in 2011 - 2011 年多语言网站成功的 5 大技巧
- Good tips for website localization - 网站本地化的好技巧
- localization - best practices - 本地化 - 最佳实践

The point in the first article is, if you use a country code top level domain (ccTLD) such as.au or.jp, it may be more friendly to the search engine in the local country, but it still depends on your need.第一篇文章的重点是,如果你使用.au或.jp等国家代码顶级域名(ccTLD),可能对当地国家的搜索引擎更友好,但还是要看你的需要。 Do you want to target the alternative language or the whole country .您是要针对替代语言还是整个国家/地区。 Another thing you also need to be aware of is that the cost for maintaining multiple sites such as in ccTLD is higher in comparison to use subdomain instead (www.site/au, www.site/es)..您还需要注意的另一件事是,与使用子域(www.site/au、www.site/es)相比,维护多个站点(例如 ccTLD)的成本更高。

hope that helps.希望有帮助。

We, generally, use localization for detecting client's browser language.我们通常使用本地化来检测客户端的浏览器语言。 If browser's language is "FR", we're gonna populate all french language files from our language folders.如果浏览器的语言是“FR”,我们将从我们的语言文件夹中填充所有法语语言文件。 Using separate to different sub-domains are different stories.使用不同的子域是不同的故事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM