메인 컨텐츠로 이동

도큐사우루스 i18n 기능을 공개합니다

· 4분 읽기 분량
세바스티앵 로버(Sébastien Lorber)
Docusaurus maintainer, This Week In React editor

Today, we officially release Docusaurus 2 i18n (internationalization), as part of 2.0.0-alpha.71.

Docusaurus 2 has now reached full feature parity with Docusaurus 1. 🎉 And soon, after a few additional infrastructure updates and a bit more testing, the first Docusaurus 2 beta will be released.

We went the extra mile, and the new i18n support is even better than in Docusaurus 1.

In this post, we will present you the translation workflow, explain some design decisions and showcase early adopter sites that just went live: Jest, Redwood, and Datagit.

We also dogfood the i18n support on the Docusaurus 2 site itself, and this post is already available in English and French!

사이트 번역하기

You can translate a Docusaurus site in 3 simple steps:

  1. Configure: declare the default locale and alternative locales in docusaurus.config.js
  2. Translate: put the translation files at the correct filesystem location
  3. Deploy: build and deploy your site using a single or multi-domain strategy

The i18n support is very flexible and based on the filesystem.

The i18n tutorial is the best way to get started, and we provide help to use Git or Crowdin.

설계 원칙

도큐사우루스 i18n 시스템의 목표는 아래와 같습니다.

  • Simple: just put the translated files in the correct filesystem location
  • Flexible translation workflows: use Git (monorepo, forks, or submodules), SaaS software, FTP
  • Flexible deployment options: single, multiple domains, or hybrid
  • Modular: allow plugin authors to provide i18n support
  • Low-overhead runtime: documentation is mostly static and does not require a heavy JS library or polyfills
  • Scalable build-times: allow building and deploying localized sites independently
  • Localize assets: an image of your site might contain text that should be translated
  • No coupling: not forced to use any SaaS, yet integrations are possible
  • Easy to use with Crowdin: multiple Docusaurus 1 sites use Crowdin, and should be able to migrate to v2
  • Good SEO defaults: we set useful SEO headers like hreflang for you
  • RTL support: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
  • Default translations: classic theme labels are translated for you in many languages

쇼케이스

We worked with a few volunteers to dogfood the i18n support before releasing it.

Jest: 도큐사우루스 업그레이드

We have made it possible to upgrade a translated Docusaurus 1 site to Docusaurus 2.

Jest, using Docusaurus 1 and Crowdin was one of those sites.

The Docusaurus 2 migration was successful and the new site is now deployed in production (announcement post).

Jest's website front page in Japanese

Redwood: 도큐사우루스 도입

Redwood is a React full-stack Jamstack framework.

They were looking for a solution to create an internationalized learning platform, and became early adopters of Docusaurus 2 i18n for learn.redwoodjs.com, using Crowdin to get it translated to French.

Redwood's doc page in French

Datagit: RTL 지원

The i18n system should work with any language, including Right-to-Left languages.

Datagit.ir is using Farsi, and a simple configuration option is able to flip the Docusaurus theme to add the required Right-to-Left support.

Datagit's website in Persian, a right-to-left language. The sidebar appears on the right of the window and the TOC appears on the left.

글을 마치며

우리는 여러분이 새로운 i18n 기능을 적용해보고 맘에 들기를 바랍니다.

이번 기능 구현은 쉽지 않았습니다. 힘든 여정을 함께 한 모든 분들께 감사드립니다.

  • Alexey for his help to make the i18n support exhaustive and even better than v1
  • Simen for volunteering and supporting the Jest migration
  • Claire for adopting Docusaurus 2 on the new Redwood platform and providing many feedbacks
  • Massoud for reviewing my work on LTR and adopting it on Datagit
  • Crowdin for their support and willingness to improve their translation SaaS
  • 인내심을 가지고 깃헙에 수 많은 유용한 피드백을 남겨준 도큐사우루스 커뮤니티에 감사드립니다.

읽어 주셔서 감사합니다!

🙏 And please, add your brand new i18n sites to our showcase page. We accept any all polished Docusaurus site here, and we are working on a redesign allowing you to filter sites by features.