23 lines
481 B
Elixir
23 lines
481 B
Elixir
defmodule Localizator.Translator.Base do
|
|
@typedoc """
|
|
Plain Text
|
|
"""
|
|
@type text :: String.t()
|
|
|
|
@typedoc """
|
|
Locale
|
|
"""
|
|
@type locale :: String.t()
|
|
@type from :: locale
|
|
@type to :: locale
|
|
|
|
@typedoc """
|
|
Error Message
|
|
"""
|
|
@type message :: String.t()
|
|
|
|
@callback detect(text) :: {:ok, locale} | {:error, message}
|
|
@callback translate(text, to) :: {:ok, text} | {:error, message}
|
|
@callback translate(text, to, from) :: {:ok, text} | {:error, message}
|
|
end
|