onomojo / i18n-timezones

Rails I18n timezone translations
MIT License
67 stars 49 forks source link

missing timezones #40

Open akbari10352 opened 5 years ago

akbari10352 commented 5 years ago

timezone translations are missing for these timezones: Chatham Is , Puerto Rico, Cape Verde Is, St. Petersburg, Solomon Is, Marshall Is, Tokelau Is i checked for de and fr

gstokkink commented 3 years ago

That's because those timezones end with a ., and Rails does not handle those translation keys well. Only solution that works is removing the ending . from all those timezones and map them somehow...

mattclough1 commented 2 years ago

I think I've got a decent workaround for this. Went from:

#{I18n.t(timezone.name, scope: :timezones, default: timezone.name)}

to

#{I18n.t('timezones')[timezone.name.to_sym()] || timezone.name rescue timezone.name}

Or something of that nature. I'm not really a Ruby person, but it works 🤷