世界,您好! 或Habr英文版,v1.0

这是我们2019年博客中的第一篇文章。这对我们所有人都非常重要:我们终于推出了英文版本的Habr! 实际上,它已经在12月中旬准备好了,但是-您知道-在圣诞节之前发布新功能就像在周五下午进行部署一样。 所以我们决定在2019年初开始。



冰山


英文版本的开发就像一扇冰山,上面有“能够以英文创建帖子会很酷” –众多功能需求之一,甚至没有大约的工作范围。

功能要求(俄语)

在将近一年的时间里,此功能请求获得了赞(毕竟仅获得了一个),但是这个主意早于请求就诞生了。 这个想法似乎很有希望,因为您可以一只手指望我们的英语竞争对手(以及实现方式)。 我们经过很长时间的努力,估计,倾听用户和客户的请求,批准“沙盒”中的英语帖子,但难题的一部分仍然相互矛盾。

众所周知,超过90%的冰山都藏在水下。 而且我们的冰山密度更大,因此我们几乎必须整修整个哈勃望远镜。 实际上我们花了2018年的一半时间。 现在在2019年初,我们很高兴发布我们的工作结果。

我们做了什么


当我们宣布Habr即将走向国际时,我们已经制定了具体计划。 这是原始工作范围和近似术语。 但是,在我们开始工作后,我们了解到返工将变得非常艰巨。

哈勃(Habr)相当大-内部和外部。 如果您只需要添加一行文本,您并不会意识到这一点,但是当您翻译整个网站时,很明显它确实是一座冰山。 我们了解“英语中的Habr”不仅是翻译“ Habr”→“ Habr”。

1.翻译结构

我们几乎没有本地化经验,一开始我们没想到Habr会说多种语言。 因此,我们必须在项目体系结构中进行很多更改,以使其在技术上可行。

最初,我们尝试使用经典的gettext快速解决问题,但很快我们意识到它没有足够的功能...

我们将所有翻译分为3个功能块:

  • 界面(语言文件)

    为了实现全面的国际化,我们选择了ICU格式-您可以翻译日期,字尾等。 每个翻译元素都有其自己的ID,为方便起见,将它们按实体分组在一起。 之后,翻译人员收到了多行语言文件。
  • 模板(帮助,文档,指南,电子邮件)

    我们在没有任何外部帮助的情况下分别翻译了大块的“独立”文本。 但是法律文件是不同的领域,带有自己的“黑洞”,因此我们向不明飞行物寻求帮助。

    我们试图平移图像并同时进行修饰。 例如:

    我们以前所拥有的(俄语)

    我们现在拥有的
    (从这里开始 ):

  • 指南(轮毂,徽章,流量)

    这或多或少是简单的任务-在管理面板上带有单独选项卡的经典CRUD

将来,这种方法将允许我们添加(如果需要)新语言。 如果没有太大的案例,也没有太大的案例,您想尝试将Habr译成另一种语言,请随时与我们联系。

一些数字:

界面:约250 KB文本,超过3,000行
模板:超过800 KB的文字
电子邮件:超过400 KB的文字

2.多语言设置

我们必须决定一切应该如何工作。 有一些想法可以创建一个单独的网站,但实际上我们并未认真考虑此选项。

因此,我们选择了一种最灵活的内容分离方式:当用户可以同时选择时-界面语言和供稿语言。

每个用户都可以进入设置并选择语言。 您只能选择英语供稿,也可以仅选择俄语,或同时打开两者。


因此,今天我们宣布Habr的两个新功能:

  • Language of the interface

    The language of all the elements on the website. Currently you can choose from English and Russian. We've attempted to determine locale in a «smart» way (based on Accept-Language header) but you always can override it yourself.
  • Language of the posts

    This feature allows user to see personal feed in selected languages. It also affects on the content of context blocks («Top posts», «Most popular right now», «Top discussions»). By default it's inherited from the interface language setting, but you can change it any time.

If you are not logged in, you can find language selector is in the upper right corner (planet icon), if you are logged in — you’ll find it in the user menu. In the mobile version the scenario is similar — settings menu is in the footer and in the user menu.


For your feed you can choose more than one language but when you create new post you will be able to choose only one.


3. SEO

Everything was done and checked, and it was time for testing. The result was good, but there was something the air… Something that we missed. It was SEO.

When you maintain a website in a single language you usually don’t have to think about search optimization — it just works somehow. But after you add another language you can’t ignore this thing.

Before English was added to Habr search engines had been indexing it quite well. After we made the website multilingual we got need to teach search engines to «see» our website both in English and Russian clearly. We had to make a full check and rework things — change links, create new sitemap, specify canonical-URL, etc.

Like this:


β-testing


Generally speaking we are announcing beta-testing of new functionality. We’d be grateful for any feedback, especially for ideas and bug reports. We need to carefully test new features in different conditions: different platforms, OS and browsers, from different locations, w/ and w/o VPN, etc. Historically our users are the best testers, and we hope you will help us.

Let’s play!


From today you can create publications in English and translate articles from Russian. Also feel free to invite friends who live abroad and speak English. If each of us will send invitation even to one such fellow, be sure we will succeed and our bold attempt to get out of our throughout regulated sandbox will look not so crazy. To make it easier during the day we will grant one invitation to each user with positive karma.

There are a lot of interesting things ahead — strategy development, search for new authors and translators, SMM, analytics, and much more. If you also can offer something please send email to welcome@habr.com — we are always glad to meet new people.

Stay tuned!

Source: https://habr.com/ru/post/zh-CN435764/


All Articles