Then in all your requests you'll be able to use the `i18n` macro to translate anything.
It takes a `gettext::Catalog` and a string to translate as argument.
If you called `rocket_i18n::tera`, you'll be able to use two Tera filters to translate your interface.
```rust
# #[macro_use] extern crate rocket_i18n;
The first one, `_`, corresponds to the `gettext` function of gettext. It takes a string as input and translate it. Any argument given to the filter can
be used in the translated string using the Tera syntax.
use rocket_i18n::I18n;
```jinja
<p>{{ "Hello, world" | _ }}</p>
<p>{{ "Your name is {{ name }}" | _(name=user.name) }}
#[get("/")]
fn route(i18n: I18n) -> &str {
i18n!(i18n.catalog, "Hello, world!")
}
```
The second one, `_n`, is equivalent to `ngettext`. It takes the plural form as input, and two required arguments in addition to those you may want to use for interpolation:
- `singular`, the singular form of this string
- `count`, the number of items, to determine how the string should be pluralized
For strings that may have a plural form, just add the plural and the number of element to the
arguments
```jinja
<p>{{ "{{ count }} new messages" | _n(singular="One new message", count=messages.unread_count) }}</p>
```rust
i18n!(i18n.catalog, "One new message", "{0} new messages", 42);
```
### In Rust code
You can also use all the gettext functions in your Rust code.
Any extra argument, after a `;`, will be used for formatting.
```rust
use rocket_i18n;
let user_name = "Alex";
i18n!(i18n.catalog, "Hello {0}!"; user_name);
```
#[get("/")]
fn index() -> String {
gettext("Hello, world!")
}
When using it with plural, `{0}` will be the number of elements, and other arguments will start
at `{1}`.
#[get("/<name>")]
fn hello(name: String) -> String {
format!(gettext("Hello, {}!"), name)
}
```
Because of its design, `rocket_i18n` is only compatible with askama. You can use
the `t` macro in your templates, as long as they have a field called `catalog` to