Skip to content

Commit

Permalink
Merge pull request #179 from iLib-js/development
Browse files Browse the repository at this point in the history
Merge to master to make 14.2.0 release
  • Loading branch information
ehoogerbeets authored May 31, 2019
2 parents 445a6c7 + aab4a51 commit f3b86da
Show file tree
Hide file tree
Showing 1,556 changed files with 374,818 additions and 99,632 deletions.
10 changes: 1 addition & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,5 @@
[//]: # (Does the code work as intended?)
[//]: # (What is the impact of this change and *why* was it made?)

### Additional Considerations
[//]: # (How should the change be tested?)
[//]: # (Are there any outstanding questions?)
[//]: # (Were any side-effects caused by the change?)


### Comments

### Links
[//]: # (Related issues, references)
[//]: # (Related issues, references)
19 changes: 10 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ node_js:
- "8"
- "9"
- "10"
- "11"
env:
- CXX=g++-4.8
before_install:
# Qt
- sudo apt-add-repository --yes ppa:beineri/opt-qt551-trusty
- sudo apt-get update -qq
- export TZ=America/Los_Angeles
#- sudo apt-add-repository --yes ppa:beineri/opt-qt551-trusty
#- sudo apt-get update -qq
install:
# Qt
- sudo apt-get -y install qt55[QTPACKAGE]
- sudo apt-get -y install qmlscene qt5-default qtdeclarative5-dev qtbase5-dev
#- sudo apt-get -y install qt55[QTPACKAGE]
#- sudo apt-get -y install qmlscene qt5-default qtdeclarative5-dev qtbase5-dev
- rm -rf node_modules
- npm install
- export PATH=$PWD/node_modules/.bin:$PATH
- export NODE_OPTIONS="--max-old-space-size=3072"
- export TZ=America/Los_Angeles
script:
# [Error] module QtQuick is not installed
- source /opt/qt55/bin/qt55-env.sh
#- source /opt/qt55/bin/qt55-env.sh
# [Error] [exec] QXcbConnection: Could not connect to display
- export QT_QPA_PLATFORM=offscreen
#- export QT_QPA_PLATFORM=offscreen
# [Error] QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
- sudo ln -s /usr/share/fonts /usr/lib/x86_64-linux-gnu/fonts
#- sudo ln -s /usr/share/fonts /usr/lib/x86_64-linux-gnu/fonts

# iLib full build / Run nodeunit tests
- ant clean test
- ant clean test.travis
#- which qmake
#- which qmlscene
#- cd qt/NodeunitTest
Expand Down
91 changes: 77 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ iLib

iLib is an internationalization library written in pure ES5 Javascript. It does not require any other libraries to function,
and can run equally well in various older and newer browsers, on various OS's (including mobile), nodejs, webOS, Qt/QML,
RingoJS, React/Enact, or rhino.
RingoJS, React/Enact, or rhino/nashorn.

More elaborate documentation can be found [here](docs/index.md)

Expand Down Expand Up @@ -44,7 +44,7 @@ letter buckets (AlphabeticIndex)
plus a lot more.

Only need some of that? That's okay, there's a way to make smaller versions of ilib that only include the classes you need
and only the locales you need.
and only the locales you need using webpack.

What Locales Does it Support?
------
Expand All @@ -66,17 +66,17 @@ ILib has been tested in the following environments:
* Chrome 28+
* Firefox 35+
* Opera 12.16+
* Safari
* Safari 6+
* Internet Explorer 8+
* Rhino on JDK 1.7 and 1.8 with Trireme (0.8.5)
* RingoJS 0.11
* Qt 5.4
* Rhino on JDK 1.7+ and 1.8 with Trireme (0.8.5)
* RingoJS 0.11+
* Qt 5.4+

Those environments have been tested on the following platforms where possible:

* Ubuntu 12.04+
* Windows 7 & 8
* Mac OSX
* Mac OSX 10.04+
* Android
* iOS

Expand All @@ -88,7 +88,6 @@ Here is an example of using iLib to format the current date/time for Berlin, Ger
works equally well with ringojs running on rhino in a Java-based app server.

~~~~~
var ilib=require("ilib");
var DateFactory = require("ilib/lib/DateFactory.js");
var DateFmt = require("ilib/lib/DateFmt.js");
Expand All @@ -109,13 +108,77 @@ Result would be:
'07:45 06. Nov. 2014'
~~~~~

Other iLib Support
-------

### Prepackaged iLib

If you would like to run ilib in your webapp, you can use the pre-webpacked versions of
ilib in the [releases](https://github.com/iLib-js/iLib/releases) page on github.

### Webpack

If you already use webpack for your own project, you can use the ilib webpack
[loader](https://github.com/iLib-js/ilib-webpack-loader) and
[plugin](https://github.com/iLib-js/ilib-webpack-plugin) to include ilib code and locale
data into your own webpacked project. The advantage is that
it will only include those ilib classes you are actually using and only the locale data
for the locales you specify. That helps to minimize the file size of your webpack chunks.
See the README documentation in the
[ilib webpack loader](https://github.com/iLib-js/ilib-webpack-loader)
for more details.

### No Webpack

If you do not use webpack for your own project, and yet you still want a minimal version
of ilib, you can use the [ilib scanner](https://github.com/iLib-js/ilib-scanner) to scan
your webapp code and create a webpack config that will build this minimal version for
you. You can just include the resulting js files in your webapp. See the README for
that project for details.

### React

If you are using React in your project and would like to include ilib classes, you can
use the webpack loader and plugin mentioned above to do so.

Additionally, there is a new library of React components called [react-ilib](https://github.com/iLib-js/react-ilib)
that will eventually allow you to use all the ilib formatters as React components, such as an
address formatting component that will output an address in the correct format per locale.
It says "eventually" in the previous sentence because the project is new and there is
a lot left to code.

React-ilib will also include a number of new components
that allow you to do localized input form elements. For example, a localized address
form component will present all of the fields necessary for an address in a number of
different locales, along with the localized field labels and placeholder texts. The
result of a user filling out the form would be an ilib Address instance, ready to use!

### ES6

If you want to use ilib classes directly from ES6 instead of using React components, you
can do that with the [ilib-es6](https://github.com/iLib-js/ilib-es6) project. With this
library, you can use ilib asynchronously with promises instead of node-style callbacks,
and you can import the classes in regular ES6 style. This library also works nicely in
React if you want to call the ilib classes directly instead of using react-ilib
components.

### Localizing Your Strings

If you use ilib in your javascript project, you can use the [loctool](https://github.com/iLib-js/loctool)
to extract the strings into XLIFF files that your translation vendor can translate
directly. When you received the localized XLIFF files back again, you can then run
the loctool again to generate localized assets, such as resource files that ilib's
ResBundle class can use, or copies of HTML files with localized text in them. See the
loctool documentation for more information.

Where to Get it
-------

For node, you can simply install it using npm:
For node, you can simply install it using npm or yarn:

~~~~~
npm install ilib
yarn add ilib
~~~~~

For ringojs, you can install it with the ringo package manager:
Expand All @@ -127,16 +190,16 @@ rp install ilib
ILib is also available on github at https://github.com/iLib-js/iLib
or official iLib builds in tar balls at https://github.com/iLib-js/iLib/releases

If you want to create your own version of ilib with a smaller set of classes than the big list above, you'll have to
get the source and build it yourself. This will require that you install java 1.7 or later, plus ant and nodejs.
You can also build your own version from the sources using webpack. See the previous
section about webpack for links.

Copyright and License
-------

Copyright © 2011-2018, JEDLSoft
Copyright © 2011-2019, JEDLSoft

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Ilib is licensed under the Apache License, Version 2.0 (the "License");
you may not use this library except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2012-2018, JEDLSoft
# Copyright © 2012-2019, JEDLSoft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

version=14.1.2
version=14.2.0
14 changes: 10 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ limitations under the License.
<!-- =================================================================== -->
<!-- Implement the standard targets -->
<!-- =================================================================== -->
<macrodef name="iterate">
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
<subant target="@{target}" >
<subant target="@{target}">
<property name="dist" value="${build.dist}"/>
<fileset dir="." includes="*/build.xml"/>
</subant>
</sequential>
</macrodef>
</macrodef>

<target name="export" description="Export everything that other subprojects will need to build.">
<iterate target="export"/>
Expand Down Expand Up @@ -118,7 +118,13 @@ limitations under the License.
<target name="test" depends="export" description="Run all tests and build all reports">
<iterate target="test"/>
</target>


<target name="test.travis" description="Run all tests and build all reports">
<subant target="export" buildpath="java"/>
<subant target="export" buildpath="js"/>
<iterate target="test"/>
</target>

<target name="doc" description="Extract all the inline documentation.">
<iterate target="doc"/>
</target>
Expand Down
123 changes: 123 additions & 0 deletions docs/DateRangeFormatSpec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Date Range DateFormat Spec

A Date range format is not written in CLDR. These data format style is defined in iLib.


### DateRange Category

Category | Range Gap | Shares data | Detail Description |
--- | --- | --- | --- |
c00 | within 3 days | Year, month, day | Year, month, and date are same, but time is different. |
c01 | within 3 days | Year, month | Year and month are same but date and time are different.
c02 | within 3 days | - | Year is same but month, date, and time are different. (ie. it straddles a month boundary) |
c03 | within 3 days | - | Year, month, date, and time are all different. (ie. it straddles a year boundary)|
c10 | within 730 days (2 years) | Year, Month | Year and month are the same, but date is different. |
c11 | within 730 days (2 years) | Year | Year is the same, but month, date, and time are different. |
c12 | within 730 days (2 years) | - | All fields are different. (i.e. straddles a year boundary) |
c20 | within 3650 days (10 years) | - | All fields are different. (i.e. straddles a year boundary) |
c30 | onger than 10 years | - | All fields are different. (i.e. straddles a year boundary) |


### Format abbreviation

* stand for Year (Start Year, End Year)
* "M" stands for Month. (Start Month, End Month)
* "d" stands for day. (Start day, End day)
* "st" stands for start time. "et" stands for end time.

### Format case 1

##### 1. {date}{time}: dMy order
* ###### example locale: en-GB

Category | Format length | Format Pattern |
--- | --- | --- |
c00 | all | dMy st-et
c01 | all | dMy st – dMy et
c02 | all | dMy st – dMy et
c03 | all | dMy st – dMy et
c10 | all | d – d My
c11 | all | dM – dMy
c12 | all | dMy – dMy
c20 | all | My – My
c30 | all | y – y

##### 2. {date}{time}: Mdy order
* ###### example locale: en-US

Category | Format length | Format Pattern |
--- | --- | --- |
c00 | all | Mdy st – et
c01 | all | Mdy st – Mdy et
c02 | all | Mdy st – Mdy et
c03 | all | Mdy st – Mdy et
c10 | full, long, medium | Md – dy
c10 | short | Mdy –Mdy
c11 | full, long, medium |Md – Mdy
c11 | short | Mdy –Mdy
c12 | all | Mdy – Mdy
c20 | all | My – My
c30 | all | y – y

##### 3. {date}{time}: yMd order
* ###### example locale: ko-KR
Category | Format length | Format Pattern |
--- | --- | --- |
c00 | all | yMd st – et
c01 | all | yMd st – yMd et
c02 | all | yMd st – yMd et
c03 | all | yMd st – yMd et
c10 | all | yMd – d
c11 | full, long |yMd – Md
c11 | medium, short | yMd – yMd
c12 | all | yMd – yMd
c20 | all |yM – yM
c30 | all | y – y

##### 4. {date}{time}: ydM order
* ###### example locale: kk-Cyrl-KZ(medium), lv-LV(full, long, medium), uz-*
Category | Format length | Format Pattern |
--- | --- | --- |
c00 | all | ydM st – et
c01 | all | ydM st – ydM et
c02 | all | ydM st – ydM et
c03 | all | ydM st – ydM et
c10 | all | ydM – dM
c11 | all |ydM – dM
c12 | all | ydM – dM
c20 | all |yM – yM
c30 | all | y – y


##### 5. {time}{date}: dMy order
* ###### example locale: vi-VN

Category | Format length | Format Pattern |
--- | --- | --- |
c00 | all | st – et dMy
c01 | all | st dMy – et dMy
c02 | all | st dMy – et dMy
c03 | all | st dMy – et dMy
c10 | all | d – dMy
c11 | all |dM – dMy
c12 | all |dMy – dMy
c20 | all |My – My
c30 | all |y – y


##### 6. {time}{date}: Mdy order
* ###### example locale: ee-* (ee-EG, ee-TG)

Category | Format length | Format Pattern |
--- | --- | --- |
c00 | all | st – et Mdy
c01 | all | st Mdy – et Mdy
c02 | all | st Mdy – et Mdy
c03 | all | st Mdy – et Mdy
c10 | full, long, medium | Md – dy
c10 | short | Mdy – Mdy
c11 | all |Md – Mdy
c12 | all | Mdy – Mdy
c20 | all | My – My
c30 | all |y – y

Loading

0 comments on commit f3b86da

Please sign in to comment.