25 lines
815 B
1
defmodule BlogWeb.Gettext do
2
@moduledoc """
3
A module providing Internationalization with a gettext-based API.
4
5
By using [Gettext](https://hexdocs.pm/gettext), your module compiles translations
6
that you can use in your application. To use this Gettext backend module,
7
call `use Gettext` and pass it as an option:
8
9
use Gettext, backend: BlogWeb.Gettext
10
11
# Simple translation
12
gettext("Here is the string to translate")
13
14
# Plural translation
15
ngettext("Here is the string to translate",
16
"Here are the strings to translate",
17
3)
18
19
# Domain-based translation
20
dgettext("errors", "Here is the error message to translate")
21
22
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
23
"""
24
use Gettext.Backend, otp_app: :blog
25
end
26