Giter VIP home page Giter VIP logo

cardinal-i18n's Introduction

cardinal-i18n

This package is part of the Cardinal apps.

This repository contains all of the localized strings for all Cardinal apps. This is a CJS package designed to be used in the main process of Electron so that it can return strings over IPC and HTTP.

Sending Strings Over IPC

In the Electron main process, register the IPC listeners on app init.

const { ipcMain } = require('electron')
const ipc = require('hydra-i18n').ipc
ipc.register(ipcMain)

The module listens on the get-i18n IPC channel and returns all strings.

Sending Strings Over HTTP

In the Electron main process, register the HTTP routes with the server (Fastify, Express, etc) on app init.

const routes = require('hydra-i18n').httpRoutes
routes.register(server)

Once the server is running, strings can be accessed under the /api/i18n route.

# HTTP GET /api/i18n/all

{'en': {'hello': 'Hello'}, 'fr': {'hello': 'Bonjour'}}

Supported languages

  • English
  • French (in progress)

Contributing

To contribute, please submit a pull request. Languages will only be added to the Cardinal UI once all strings for the lanauge have been translated.

License

Licensed under the Mozilla Public License 2.0.

cardinal-i18n's People

Contributors

somebeaver avatar

Watchers

 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.