https://github.com/change/linguist
Elixir Internationalization library
https://github.com/change/linguist
elixir
Last synced: 2 months ago
JSON representation
Elixir Internationalization library
- Host: GitHub
- URL: https://github.com/change/linguist
- Owner: change
- License: mit
- Created: 2014-06-23T19:23:42.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2026-03-04T15:27:20.000Z (4 months ago)
- Last Synced: 2026-03-13T08:57:39.940Z (3 months ago)
- Topics: elixir
- Language: Elixir
- Homepage: https://hex.pm/packages/linguist
- Size: 227 KB
- Stars: 184
- Watchers: 37
- Forks: 23
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- fucking-awesome-elixir - linguist - Elixir Internationalization library. (Translations and Internationalizations)
- awesome-elixir - linguist - Elixir Internationalization library. (Translations and Internationalizations)
- fucking-awesome-elixir - linguist - Elixir Internationalization library. (Translations and Internationalizations)
README
# Linguist
[](https://github.com/change/linguist/actions/workflows/test.yml)
[](https://hex.pm/packages/linguist)
[](https://hexdocs.pm/linguist)
[](https://hex.pm/packages/linguist)
[](https://github.com/change/linguist/blob/main/LICENSE)
[](https://github.com/change/linguist/commits/main)

> Linguist is a simple Elixir Internationalization library
## Installation
Add `:linguist` to your `mix.exs` dependencies:
```elixir
def deps do
[
{:linguist, "~> 0.5"}
]
end
```
Update your dependencies:
```bash
$ mix deps.get
```
## Usage
```elixir
defmodule I18n do
use Linguist.Vocabulary
locale "en", [
flash: [
notice: [
hello: "hello %{first} %{last}",
bye: "bye now, %{name}!"
]
],
users: [
title: "Users",
profiles: [
title: "Profiles",
]
]
]
locale "fr", Path.join([__DIR__, "fr.exs"])
end
# fr.exs
[
flash: [
notice: [
hello: "salut %{first} %{last}"
]
]
]
iex> I18n.t!("en", "flash.notice.hello", first: "chris", last: "mccord")
"hello chris mccord"
iex> I18n.t!("fr", "flash.notice.hello", first: "chris", last: "mccord")
"salut chris mccord"
iex> I18n.t!("en", "users.title")
"Users"
```
## Configuration
The key to use for pluralization is configurable, and should likely be an atom:
```elixir
config :linguist, pluralization_key: :count
```
will cause the system to pluralize based on the `count` parameter passed to the `t` function.