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.
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.
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'}}
- English
- French (in progress)
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.
Licensed under the Mozilla Public License 2.0.