Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-cldr-timezones

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-cldr-timezones

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Cached translations of timezones for js

Install

gem install js-cldr-timezones

Usage

This project supports over 573 languages. We provide a file with a hash that has the translations. In the html header translations you should add:

<%= javascript_include_tag "js_cldr/#{locale}_cldr_timezones" %>

locale is a bcp-47 language tag. However the dash is substituted by an underscore to make it. For example:

<%= javascript_include_tag "js_cldr/es_cldr_timezones" %>

<%= javascript_include_tag "js_cldr/ja_cldr_timezones" %>

<%= javascript_include_tag "js_cldr/es_MX_cldr_timezones" %>

This provides access to a hash that has the name in the following format:

"#{locale}_cldr_timezones_hash"

The hash contains a meaninful subset of 124 timezones. It has the timezone indentifier as the key and the translation as the value.

Examples:

es_cldr_timezones_hash["Europe/Moscow"] # "(GMT+04:00) Moscú"

ja_cldr_timezones_hash["America/Cordoba"] # "(GMT-09:00)モスクワ"

There is also support for fallback.

es_MX_cldr_timezones_hash["Europe/Moscow"] # "(GMT+04:00) Moscú"

Development

Translations are already included in the project and you don't need to generate them. However if you want to fork this project and generate your own translations you should simply run:

rake generate_timezones

This project uses ruby-cldr-timezones to generate the javascript for each language.

TODO

  • Support for option :all which will provide the complete set of timezones that are supported by ruby-cldr-timezones

Author

Ana Martinez
acemacu@gmail.com
License: MIT

Build Status Code Climate

FAQs

Package last updated on 05 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc