Skip to content
vic

padde/calendar_translations

Translations for the Calendar library.

padde/calendar_translations.json
{
"createdAt": "2015-11-07T00:02:58Z",
"defaultBranch": "master",
"description": "Translations for the Calendar library.",
"fullName": "padde/calendar_translations",
"homepage": null,
"language": "Elixir",
"name": "calendar_translations",
"pushedAt": "2018-02-21T21:45:23Z",
"stargazersCount": 11,
"topics": [],
"updatedAt": "2024-11-05T18:09:52Z",
"url": "https://github.com/padde/calendar_translations"
}

Build Status Hex Version

Translations for the Calendar library.

Add :calendar_translations to your list of dependencies in mix.exs:

def deps do
[{:calendar_translations, "~> 0.0.4"}]
end

Make Calendar use CalendarTranslations by adding the following line to your config/config.exs file:

config :calendar, :translation_module, CalendarTranslations.Translations

There are 100+ languages/dialects available. Various Calendar functions take a lang argument, which is an atom.

Here is an example of the Calendar.Strftime.strftime!/2 function where the same formatting string is used with four different langauges:

iex> {2016, 1, 11} |> Calendar.Strftime.strftime!("%A %Y %B %e", :en)
"Monday 2016 January 11"
iex> {2016, 1, 11} |> Calendar.Strftime.strftime!("%A %Y %B %e", :hi)
"सोमवार 2016 जनवरी 11"
iex> {2016, 1, 11} |> Calendar.Strftime.strftime!("%A %Y %B %e", :"pt-BR")
"Segunda-feira 2016 Janeiro 11"
iex> {2016, 1, 11} |> Calendar.Strftime.strftime!("%A %Y %B %e", :da)
"mandag 2016 januar 11"

All contributions are welcome. Please feel free to open a pull request on GitHub.

CalendarTranslations is released under the MIT license. See the LICENSE file.

The translations found in this project were taken from the rails-i18n project.