Skip to content

dymmer-code/countries-i18n

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

countries-i18n

The purpose of this library is to simply provide country translations.

If you're doing anything with country names and translations, there's no need to reinvent the wheel and add your own translations.

Note that this library is a conversion (fork) from this other one from Ruby: i18n-country-translations.

Installation

Add to your mix.exs file:

{:countries_i18n, "~> 0.0.3"}

Troubleshooting

There are libraries like countries which are using yamerl as well. If there are issues, add in your project an override always giving preference to the dependency of countries (because it is going to be run inside of the system and this tool is run only once).

It's important to check what languages are you going to use and remove the rest because it's overwhelming the compile process dramatically.

Usage

This library provide to your project the countries domain. It have to be installed. You only needs to run:

mix countries.i18n.install

This will write in your priv/gettext directory the .pot and .po files copied from the available directory in this library.

Next step is open your view file (if you are using Phoenix Framework) or the file where you want to use it and:

  use Countries.I18n

And then the function country/1 will be available to be used with two-letters country codes:

  country("ES")

Or dynamically:

  country(country_code)

Contributing

Most locale translations already exist but if you find an error or we're missing something, please submit a pull request.

About

This just contains i18n country translations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%