This commit is contained in:
2020-06-24 19:09:36 +03:00
parent 94047150a1
commit f8445285f3
3 changed files with 7 additions and 2 deletions

View File

@@ -40,6 +40,11 @@ defmodule Localizator.Translator do
@spec default() :: translator
def default(), do: list() |> List.first()
@spec detect(source, translator) :: {Atom.t(), locale}
def detect(source, translator \\ default()) do
translator.detect(source)
end
@spec translate(source, direction, translator) :: result
def translate(source, direction, translator \\ default()) do
map = Direction.get(direction)