Skip to content

Instantly share code, notes, and snippets.

@pavanjoshi914
Last active March 22, 2021 01:44
Show Gist options
  • Save pavanjoshi914/47df1c6a9803e27ae6d4a43735708184 to your computer and use it in GitHub Desktop.
Save pavanjoshi914/47df1c6a9803e27ae6d4a43735708184 to your computer and use it in GitHub Desktop.
i18n for circuitversedocs

I18n for CircuitVerseDocs

Overview

Currently circuitversedocs is made using Docsifyjs documentation site generator which can be internationalised easily.

structure of i18n

  • use different repositories for each language.
  • use same repository with subfolders for each language.

different sections we have to work on

for default language/en:

all the en version files can be present in,

 /docs 
 for this url: /#/
 /docs/en 
 for this url: /#/en/

for different version of languages

create subfolder eg:/docs/fr and place fr version of site in it.for this url will start with /#/ru/

division of theme into different sections

docsify theme is basically divided into navbar, sidebar, content area

  • navbar: navbar currently not used by cv but can be implemented by creating _navbar.md file to place language switcher in navbar

  • sidebar: we have sidebar content in _sidebar.md

  • content area: container for main content markdown files

i18n for different sections

  • sidebar: as site is static we need _sidebar.md file for each version of language.

     eg: for en sidebar.md contains [Home](/) 
         for ru sidebar.md contains [дома](/ru/)
    

    in such a way we automatically link different version of files with each other and serve right type of markdown files according to language set by user

  • content area: translated version of md files will be stored in respective language folders with appropriate localized sidebar

  • navbar- we need navbar.md file each language folder to hold language switcher. bascially this file will contain dropdown list of languages with link for current active language disabled and text for current active language highlighted

  eg:
- Translations
- [:us: english](/)
- [:cn: 中文](zh-cn/)
- [:de: Deutsch](/de-de/)
- [:es: Spanish](/es/)
-  ** Russian **

if we dont use highlight current active lang then we might need only file at core of repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment