https://github.com/goofansu/locale_plug
Elixir plug to detect and set locale
https://github.com/goofansu/locale_plug
elixir locale plug
Last synced: 7 months ago
JSON representation
Elixir plug to detect and set locale
- Host: GitHub
- URL: https://github.com/goofansu/locale_plug
- Owner: goofansu
- License: mit
- Created: 2019-04-08T07:41:24.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T01:04:27.000Z (about 2 years ago)
- Last Synced: 2025-03-17T22:14:42.431Z (11 months ago)
- Topics: elixir, locale, plug
- Language: Elixir
- Homepage: https://hex.pm/packages/locale_plug
- Size: 101 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LocalePlug
Elixir plug to detect and set locale.
[](https://github.com/goofansu/locale_plug/actions?query=workflow%3ACI)
`locale` is detected according to following order:
> params > cookies > "accept-language" in request headers
## Installation
```elixir
def deps do
[
{:locale_plug, "~> 0.2.0"}
]
end
```
## Usage
```elixir
plug LocalePlug, backend: MyApp.Gettext
```