Giter Site home page Giter Site logo

i18n's Introduction

electron-i18n

A home for Electron's translated documentation.

🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹 🇵🇱

Contributing

Do you speak multiple languages? We need your help!

To get started translating, visit crowdin.com/project/electron and log in with your GitHub account.

The following languages are currently being translated, but we can easily add more:

Installation

If you're just here to translate content, see above. ☝️

If you're here to actually use this translated content for some purpose, read on! This project is published to npm as a module containing all the translated docs.

npm install electron-i18n

Usage

The electron-i18n module has no dependencies and exports no functions. It is simply a large JSON object containing all of Electron's API docs and tutorial content, in every language.

Require the module in your code:

const i18n = require('electron-i18n')

i18n is an object with the following keys:

  • electronLatestStableVersion is a string like 1.7.8
  • electronLatestStableTag is a string like v1.7.8
  • electronMasterBranchCommit is a git commit SHA string.
  • docs - see #docs
  • locales - see #locales
  • website - see #website
  • date is a timestamp

Docs

i18n.docs is an object with locale strings as keys:

Object.keys(i18n.docs)
[ 'en-US', 'fr-FR', 'vi-VN', 'ja-JP', 'zh-CN', '...']

Each locale object contains an object with doc HREFs as keys:

> Object.keys(i18n.docs['en-US'])

[
  '/docs/tutorial/about',
  '/docs/api/accelerator',
  '/docs/tutorial/accessibility',
  '/docs/api/app',
  '...'
]

Each doc object contains metadata and an HTML version of itself, ready to be rendered:

i18n.docs['en-US']['/docs/api/app']

{
  locale: 'en-US',
  slug: 'app',
  category: 'api',
  categoryFancy: 'API',
  href: '/docs/api/app',
  title: 'app',
  description: '\nControl your application\'s event lifecycle.\n'
  githubUrl: 'https://github.com/electron/electron/tree/master/docs/api/app.md',
  crowdinFileId: '123',
  isTutorial: false,
  isApiDoc: true,
  isDevTutorial: false,
  isApiStructureDoc: false,
  markdown: '...',
  html: '...'
}

Locales

i18n.locales is an object with locale strings as keys:

Object.keys(i18n.locales)
[ 'en-US', 'fr-FR', 'vi-VN', 'ja-JP', 'zh-CN', '...']

Each locale object contains language names, country info, and translation progress:

i18n.locales['en-US']

{ locale: 'en-US',
  languageCode: 'en',
  languageName: 'English',
  languageNativeName: 'English',
  countryCode: 'US',
  countryName: 'United States',
  stats: {
    translated_progress: 100,
    approved_progress: 100
  }
}

Website

i18n.website contains localized versions of electron/electronjs.org/blob/master/data/locale.yml.

It is an object with locale strings as keys:

Object.keys(i18n.locales)
[ 'en-US', 'fr-FR', 'vi-VN', 'ja-JP', 'zh-CN', '...']
i18n.website['fr-FR']

{
  tagline: 'Développez des applications desktop multi-plateformes avec JavaScript, HTML et CSS',
  nav: '...'
}

License

MIT

i18n's People

Contributors

ckerr avatar codebytere avatar dakeshi avatar demopark avatar duswlsgur avatar electron-bot avatar funkyboy avatar glotbot avatar groundwater avatar kstar0714 avatar pierreneter avatar skoorupa avatar tiagodanin avatar vanessayuenn avatar watilde avatar zeke avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.