1.1.0 • Published 6 years ago

dev-mobile-mobile-cbx-locales v1.1.0

Weekly downloads
10
License
-
Repository
-
Last release
6 years ago

CBX Mobile App: Internationlization

Conventional Commits

CBX Mobile App can easily be adapted to specific local languages and cultures.

CBX App can be enabled with any new locale support by introducing translations for whole product and needed culture formatting by following a naming convention also known as locale ID.

What is a locale ID?

A locale is a specific geographical, political, or cultural region. The most commonly used locale ID consists of two parts: language code and country code. For example, en-US, en-AU, and zh-CN are all valid locale IDs that have both language codes and country codes.

Supported locales

CBX App separates number and datetime format rule sets as part of mobile-core-modules repo as per rules supported by Angular. All translation files need to follow locale ID naming convention to automate datetime format rules.

Get Started

  1. Clone this repository by using your favorite Git client or by executing git clone https://bitbucket.org/igtbdigital/mobile-cbx-locales.git.
  2. Enter the project directory by running cd client-name-mobile-cbx-locale.
  3. Run npm install to install the project dependencies.

Table of Contents

##Enabling new locale All translations are mantained in src/translations/i18n/ directory. To add new locale support make an entry of new locale following locale-id in package.JSON's extract-keys script ./src/translations/i18n/{en-US,en-UK,de-DE,zh-CN}.json

##Translating new pages By default npm run extract-keys runs extraction command on all published packages with @igtb-digital directory scope inside node-modules directory. Make an entry of published npm package as dependency in package.json and run npm update to enable extraction on newly added translation page.

##Extracting Messages To extract the application messages in src/translations/i18n/, run the npm run extract-keys command. Extraction Image

##Maintaining new messages To add new messages in already translated messaged locale files, run the npm run update followed by npm run extract-keys command, all newly extracted messages would be merged and included in locale json files.

##Translating Messages (In RoadMap) To translate CBX App, extracted messages would be feeded into a translation tool or manual translation utility to maintain the translations.

##Distributing Messages Locale files would be distributed as npm package, publish the locales by running npm run release-lib. The build artifacts are stored in the mobile-cbx-locales/ directory.

Release Image

##Running the Application To run your application with the new locale support, include published npm pacakage as dependency in any other consuming repository.

Code Commits

All code commits needs to follow conventional log and needs to be classied as one of below types. Commits must be one of the following:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

Usage: Post changes are made use npm run commit to mark changes as staged changes and fill the needed information thrown by the command and pick the commit type.

##Release History See the change log for changes and release history details.