Skip to content

Localization and Intrenationalization of ZMGC application

Norman Khine edited this page Jun 23, 2013 · 1 revision

Localization (l10n) and Intrenationalization (i18n)

ZMGC uses the i18next javascript library to intrerantionalize and Unicode Common Locale Data Repository - CLDR to localize the application.

Background

Currently all the files associated with l10n and i18n are located /app/config/i18n.coffee, /locales/config.json, /locales and /public/js/locale.js The way this works is that i18n.coffee sets some global configurations in our application and uses config.json to list the current available languages. This will be changed so that when a new langauage folder is added to the /locales folder, this list will automatically built.

Procedure on howto add a new language to the application

Intial setup

In order to help with l10n and i18n you will need to first create a Free Github account once this is done, you will need to Fork the TZM Blade repository

Fork TZM-Blade repository

Once this is done, you will need to follow the Github tutorial of configuring your workstation for this you will need to setup Git - https://help.github.com/articles/set-up-git

In order to be able to securely commit and share your work you will need to configure your SSH keys - details for each operating system can be found here - https://help.github.com/articles/generating-ssh-keys

Please visit https://help.github.com/ for further help.

Install ZMGC in your local machine

Once you have forked the project to your Github account, you will need to then take a snapshot of this to your local directory. Usually I have a specific directory called Sandboxes located in my home directory within which I have a directory called zeitgeists within which I store all the work pertaining to the Zeitgesit Movement, here is a list of this:

☺  tree -L 1 ~/Sandboxes/zeitgeist
/Users/khinester/Sandboxes/zeitgeist
├── Blade
├── French-Joomla-Site
├── chapter.zmgc.net
├── chapters.zmgc.net
├── phoenix
├── templates
├── tzm-blade
├── tzm-cache
├── tzm-chat
├── tzm-dev
├── tzm-network
├── tzm-scripts
├── wiki
├── wireframes
├── zdays
├── zmgc
└── zmgc_app_engine

It is up to you on how you want to store this ;D

Please refer to https://github.com/TZM/tzm-blade#installation for instalation details but remember to change the git clone command to:

☺ git clone git://github.com/YOUR-REPOSITORY-NAME/tzm-blade.git

All this is done trough your Terminal application.

Adding a new language to the ZMGC application

Copy locales/dev folder to locales/countryCode-languageCode folder, please replace languageCode-countryCode with the ones for your language and country, you can get these from languageCode-countryCode

☺ cp -r locales/dev locales/languageCode-countryCode
☺ subl locales/languageCode-countryCode

Now you have the new folder you can open using your favourite text editor and begin to update the value elements.

Commiting your work

When done, save your changes and exit from the text editor and go back to the terminal and commit your work. But before you do this you will need to synchronize any changes that may have neen commited by other members and to do this you will need to first add the ZMGC as a remote repository to follow and is done like:

☺ git remote add zmgc https://github.com/TZM/tzm-blade.git

So now that we have ZMGC available we can pull any changes before committing our changes, like:

☺ git pull zmgc master
☺ git status # this will check the work that you will be commiting
☺ git add .
☺ git commit -am 'Commit Message...'
☺ git push origin master # this will push the work to your own remote repository

For further details please visit https://help.github.com/articles/merging-a-pull-request#pull

Request a merge into ZMGC

Once you have pushed your work you will need to make a Pull request - please visit https://help.github.com/articles/creating-a-pull-request on how to do this.

When this is done, the ZMGC will run tests on your work to ensure nothing is broken, results of which can be viewed from https://github.com/TZM/tzm-blade/pulls and https://travis-ci.org/TZM/tzm-blade

Help to improve this guide

You can help with any of the guides by cloning the ZMGC wiki

Clone this wiki locally