Skip to content
This repository has been archived by the owner on Nov 3, 2017. It is now read-only.

uMobile internationalization using Polyglot.js #49

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

uMobile internationalization using Polyglot.js #49

wants to merge 10 commits into from

Conversation

germain-gg
Copy link

uMobile didn't bring any i18n features. I found a great tool developed by Airbnb named Polyglot.js

So I decided to integrate it with uMobile app. You can translate a text programmaticaly or in an Handlebars template.

Programmaticaly :

umobile.i18n.t('header.title');
// will output 'uMobile'

In a Handlebars template :
Simple translation

{{t 'header.title'}}
// will output 'uMobile'

With extra parameter, view a real working example

{{t 'hello.name' 'John' 'Doe'}}
// if hello.name = 'Hello my name is %{0} %{1}'
// then it will output 'Hello my name is John Doe

Pluralisation

{{t 'number.car' 2}}
// if number.car = '%{smart_count} car |||| %{smart_count} cars'
// then it will output '2 cars'

@cousquer
Copy link
Member

Germain,
There is a problem of Licence with polyglot.js. It's not Apache...

@germain-gg
Copy link
Author

I can see on this page that page that Polyglot.js is distributed under the terms of BSD license.
I've checked on Wikipedia and it says that this is an open license to distribute software.
Why is this a problem in our case ?
Sorry for my lack of knowledge about licensing...

@mmoayyed
Copy link
Member

All libraries and dependencies need to be compatible with Apache v2

@ChristianMurphy
Copy link
Member

Hey there! 👋

Thanks for opening a pull request with uMobile app phonegap. 👍 🙇‍♂️
The uMobile app phonegap is no longer being actively maintained. ⛔
For alternatives we recommend the uMobile Android App and the uMobile iOS app. ✅

Thanks again for contributing to the uMobile app phonegap! ✨

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants