I use "Moment.js" and it's addition "moment-timezone" in a Web application that supports several languages (english, german, french etc.).
So to improve the user experience I'd like to know if there already exists a localization file (like the one for Moment.js) that can change timezone names from english to the desired language or do I need to write it myself?
For instance: String "Europe/Vienna" would be in that case changed to "Europe/Wien"
A few things:
You can use the Globalize library to get access to CLDR data in JavaScript, however AFAIK they don't currently have support for time zone names. I've requested this here.
Even with an adequate translation of IANA time zone ID to localized time zone names, it can be difficult to use this data to build time zone picker controls. I've done this in .NET with my TimeZoneNames library (demo here), but not in pure JS. I've yet to see a simple solution to this in JavaScript yet. If I ever find one (or create one), I'll come back here and update this answer.
Other alternatives you might consider are to use a map-based time zone picker, such as this one, or this one, and others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With