0.0.1 • Published 13 years ago
cldr_timezones v0.0.1
Translated timezones according to CLDR
Install
npm install cldr_timezonesUsage
This project supports over 573 languages. We provide a file with a hash that has the translations. You should load it doing
var cldr_timezones = require('cldr_timezones').load('locale')locale is a bcp-47 language tag. For example:
var cldr_timezones = require('cldr_timezones').load('es')
var cldr_timezones = require('cldr_timezones').load('es-MX')
var cldr_timezones = require('cldr_timezones').load('ja')The hash has the timezone indentifier as the key and the translation as the value.
Examples:
cldr_timezones["Europe/Moscow"] # "(GMT+04:00) Moscú"
cldr_timezones["America/Cordoba"] # "(GMT-09:00)モスクワ"There is also support for fallback.
cldr_timezones["Europe/Moscow"] # "(GMT+04:00) Moscú"How to build
You can create a file you can include for a web application using the Makefile.
For example:
make build TZ=./lib/en_US.js TZ+=./lib/es_MX.jswill create a build in ./dist/timezone.js with just those two locales.
Author
Ana Martinez acemacu@gmail.com License: MIT
