I18nParser v0.1.1 I18nParser.Detection View Source

Module for detection locale of the file

Link to this section Summary

Functions

Detects locale

Creates detector

Link to this section Functions

Link to this function detect(detection) View Source
detect(%I18nParser.Detection{file: String.t()}) ::
  {:ok, %{code: String.t(), name: String.t()}}

Detects locale

Examples

iex> detector |> I18nParser.Detection.detect()
{:ok, %{code: "en"}}
Link to this function new(file) View Source
new(String.t()) :: %I18nParser.Detection{file: String.t()}

Creates detector

Parameters

  • file: path to file for locale detection

Examples

iex> detector = "/en.yml" |> I18nParser.Detection.new()
%I18nParser.Detection{file: "/en.yml"}