Skip to content

mixu/npm-cldr-timezones

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Translated timezones according to CLDR

Install

npm install cldr_timezones

Usage

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.js

will create a build in ./dist/timezone.js with just those two locales.

Author

Ana Martinez
acemacu@gmail.com
License: MIT

Build Status

About

Translated timezones according to CLDR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%