首页 > 其他分享 >translate-your-site

translate-your-site

时间:2024-02-05 14:26:20浏览次数:20  
标签:fr locale docs site i18n translate your

sidebar_position: 2

Translate your site

Let's translate docs/intro.md to French.

Configure i18n

Modify docusaurus.config.js to add support for the fr locale:

export default {
  i18n: {
    defaultLocale: 'en',
    locales: ['en', 'fr'],
  },
};

Translate a doc

Copy the docs/intro.md file to the i18n/fr folder:

mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/

cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md

Translate i18n/fr/docusaurus-plugin-content-docs/current/intro.md in French.

Start your localized site

Start your site on the French locale:

npm run start -- --locale fr

Your localized site is accessible at http://localhost:3000/fr/ and the Getting Started page is translated.

:::caution

In development, you can only use one locale at a time.

:::

Add a Locale Dropdown

To navigate seamlessly across languages, add a locale dropdown.

Modify the docusaurus.config.js file:

export default {
  themeConfig: {
    navbar: {
      items: [
        // highlight-start
        {
          type: 'localeDropdown',
        },
        // highlight-end
      ],
    },
  },
};

The locale dropdown now appears in your navbar:

Locale Dropdown

Build your localized site

Build your site for a specific locale:

npm run build -- --locale fr

Or build your site to include all the locales at once:

npm run build

标签:fr,locale,docs,site,i18n,translate,your
From: https://www.cnblogs.com/ameng666/p/18007884

相关文章

  • deploy-your-site
    sidebar_position:5DeployyoursiteDocusaurusisastatic-site-generator(alsocalledJamstack).ItbuildsyoursiteassimplestaticHTML,JavaScriptandCSSfiles.BuildyoursiteBuildyoursiteforproduction:npmrunbuildThestaticfilesarege......
  • App requires Multidex support Multidex support is required for your android app
    flutterandroid报错64k!]ApprequiresMultidexsupportMultidexsupportisrequiredforyourandroidapptobuildsincethenumberofmethodshasexceeded64k.Seehttps://docs.flutter.dev/deployment/android#enabling-multidex-supportformoreinformation......
  • 【每周一读】Optimize your RAG pt.1 - Data ingestion
    今天与其说是阅读笔记更像是摘录与翻译...本来都用了引用块,但格式不太好看就还是改成正文了。以下英文部分全是原文引用。原文......
  • ChatGPT无法登录报错something went wrong. please make sure your device's date and
    这两天Android在登陆ChatGPT的时候,出现错误:somethingwentwrong.pleasemakesureyourdevice'sdateandtimearesetproperly如下图:这个问题就出现的非常蹊跷,于是我在网上搜索了一圈,很多的教程都指向节点网络问题,但是我的Hostease网络确定没有问题,因此这个问题就快无解了,正......
  • ORACLE translate函数
     1.语法  2.用途   (1)translate的返回值,是将expr(源字符串)参数中,所有对应在from_string(源字符串中想要被替换的字符)参数中所出现的字符,均按from_string参数中在to_string(想要源字符串中被替换的对应目标字符)参数中对应的字符替换掉后的值。expre源字符串中有......
  • BurpSuite启动失败--Your JRE appears to be version 20.0.2 from Oracle Corporation
    1.检查java版本,Burpsuite对jdk版本要求,win+Rcmd 如果版本有问题,在环境变量处修改JAVA_HOME和path。修改完后,仍然有问题;2.查看环境变量中path是否有其他优先级较高的设置 尝试下移或者在不影响生产的前提下删除3.查看之前是否安装过其他版本java未卸载干净,在'控制面板'删......
  • CommandNotFoundError: Your shell has not been properly configured to use ‘conda
    问题描述使用condaactivate激活虚拟环境时报错:condaactivatevirtual_env提示内容CommandNotFoundError:Yourshellhasnotbeenproperlyconfiguredtouse'condaactivate'.Toinitializeyourshell,run$condainit<SHELL_NAME>Currentlysupp......
  • vllm 安装踩坑 (The NVIDIA driver on your system is too old)
    我的环境如下:nvidia-smi显示cuda版本是11.7目前最新vllm要求的torch版本是2.1.2,该版本要求的cuda版本是11.8,所以不匹配。执行安装会遇到如下错误RuntimeError:TheNVIDIAdriveronyoursystemistooold(foundversion11070).PleaseupdateyourGPUdrive......
  • 网络攻击技术(二)——Cross-site scripting
    网络攻击技术(二)——Cross-sitescripting 1.1.1摘要     在本系列的第一篇博文中,我向大家介绍了SQLInjection常用的攻击和防范的技术。这个漏洞可以导致一些非常严重的后果,但幸运的是我们可以通过限制用户数据库的权限、使用参数化的SQL语句或使用ORM等技术来防范......
  • SiteGround如何设置WordPress网站自动更新
    SiteGroundAutoupdate功能会自动帮我们更新在他们这里托管的所有WordPress网站,这样做是为了保证网站安全,并且让它们一直保持最新状态。他们会根据我们选择的设置自动更新不同版本的WordPress,包括主要版本和次要版本。在每次自动更新之前,他们都会为我们的网站做一个完整的备份,这样......