Jasig / umobile-app-phonegap

7 stars 11 forks source link

uMobile internationalization using Polyglot.js #49

Open germain-gg opened 9 years ago

germain-gg commented 9 years ago

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 commented 9 years ago

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

germain-gg commented 9 years ago

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 commented 9 years ago

All libraries and dependencies need to be compatible with Apache v2

ChristianMurphy commented 6 years ago

Hey there! :wave:

Thanks for opening a pull request with uMobile app phonegap. :+1: :bowing_man: The uMobile app phonegap is no longer being actively maintained. :no_entry: For alternatives we recommend the uMobile Android App and the uMobile iOS app. :white_check_mark:

Thanks again for contributing to the uMobile app phonegap! :sparkles: