Hello world! Or English-speaking Habr, v1.0

    This is the first post on our blog in 2019, but it is very important for all of us. We are finally launching the English version of Habr! We had almost everything ready by mid-December, but to release before the New Year is how to roll out the release on Friday night. Therefore, we decided to postpone the big sailing to the beginning of 2019.



    Iceberg


    The development of the English version of Habr was like an iceberg, the tip of which was the user’s “ it would be nice to be able to publish posts in English ” - one of the many feature requests without even an approximate estimate of the scale of all the work.


    For almost a year this feature request was collecting likes; as a result, it collected neither more nor less - one, but the idea to do this came up with us long before that. The idea seemed promising, because English-speaking competitors can be counted on the fingers of one hand. We thought for a long time, wondered, listened to the requests of users and clients, skipped articles in the Sandbox in English, but still the final puzzle did not add up to a single whole.

    As you know, about 90% of the iceberg is hidden under water, and our iceberg had an even higher density, and as a result, almost the entire Habr had to be redone. Actually, we spent half of 2018 on this. And now, at the beginning of 2019, we are pleased to present the results of the work.

    What was done


    When we announced the exit of Habr outside Russia, we already had a plan. A rough assessment of the work and the timing of it. But already in the process of work, we realized that the alterations will be more extensive.

    Habr is quite large - both inside and out. When you add a new line of text in some settings section, you don’t notice these scales, but when you translate the entire site, you understand that this is really an iceberg. It became clear that it is not enough just to translate Habr → Habr to make the English-speaking Habr.

    1. Translation structure

    We practically didn’t have any localization experience; when developing Habr, we did not put multilingualism into it. Therefore, a lot had to be changed in the architecture of the project so that support for the new language was, in principle, possible and worked correctly.

    At first, we tried to solve the problem quickly, through the classic gettext, but very soon it became clear that its capabilities were not enough ...

    All the translation work at us was divided into three functional blocks:

    • Interface (language files)

      For the full internationalization of the interface, the ICU format was chosen - with it it became possible to translate dates, endings, etc. Each translation element was assigned a unique ID; for convenience, they were grouped by entity. Then the multiline language file was sent to the translator.
    • Templates (reference section, documents, manuals, letters)

      Large "independent" texts were translated separately, on their own. But the translation of legal documents (and we had a lot of them) is a separate universe with its own black holes, so I had to resort to UFOs.

      We tried to translate even the pictures, simultaneously refreshing them. For instance:

      It was

      Has become
    • Directories (hubs, badges, streams)

      Here, in general, everything is simple - classic CRUD with a separate section in the administration panel.

    In the future, a similar approach will allow (if necessary) to add other languages ​​to the site. If you are brave, dexterous, skilled, you want to try your hand at translating Habré into a new language, please write to us.

    A few numbers:

    Interface: about 250 KB of text, more than 3,000 lines
    Templates: more than 800 KB of text
    Letters: more than 400 KB of text

    2. Multilingual settings

    It was up to you to decide how all this would work. We did not seriously consider the option of creating a separate site, but in the process of working such an idea occasionally visited us.

    Therefore, we went along the path of sharing content and it remains to figure out how to do this. As a result, we settled on the most flexible option: so that each user can choose both the interface language of the site and the language of the content.

    To do this, each user in the settings can specify what and in what language will be. You can leave in the feed only content in Russian, you can only in English, but you can immediately in both.



    So, from today on Habré two settings appeared:

    • Interface

      language The language of all elements of the site. So far, either Russian or English is supported. We tried to make a “smart” auto-detection of the language (based on the accept language header), but you can always override this setting yourself.
    • Publication language

      This setting allows the user to see publications in the selected languages ​​in their stream. The content of contextual blocks depends on it (“Most read”, “Read now”, “What they discuss”). By default, it is inherited from the interface language, but it can also be changed at any time.

    Prior to authorization, the choice of languages ​​is located in the upper right corner (planet icon), after authorization, it moves to the user menu. In the mobile version, the behavior is similar - the settings are in the footer and in the user menu.


    In the feed, you can select either one specific language or several. But when creating a publication, you can choose only one language.


    3. SEO

    They did everything, translated, started testing. I liked it, but I felt some kind of absence-presence. And they remembered that they forgot about the SEO god.

    When your site is in one language, you can often not think about search engine optimization - everything somehow works by itself. But when content in different languages ​​appears on the site, this moment can no longer be ignored.

    Prior to this, Habr was only in Russian and generally indexed quite well. With the advent of multilingualism, it became necessary to teach search engines to correctly “see” both the Russian-language and the English-language versions. To do this, I had to conduct a comprehensive audit and redo some of the things on the site - change the links, change the sitemap, register the correct canonical-url and so on.

    Something like this:



    β testing


    By and large, now we are announcing a beta test of the new functionality, so we will be grateful for any feedback, and especially for ideas and bug reports. It is necessary to carefully and in different conditions test the innovation: on different platforms, on different OS and browsers, from different countries, with / without VPN, etc. Historically, our users are the best testers, and we hope for your help.

    Let's play!


    From today, you can fully begin to post your publications in English and do translations of Russian-language articles. And also invite friends who live in other countries and speak English. If everyone invites at least one such friend, we will surely heal, and our bold attempt to crawl out of the bounds of our regulated sandbox will not look so insane. To make this easier to do, for each user with positive karma, we will accrue one invitation today.

    Ahead is a lot of interesting things - working out a strategy, searching for new authors and translators, SMM, analytics and much more, so if you can offer something, then write to welcome@habr.com - we are always happy to meet new people.

    In touch!

    Also popular now: