View Source Glific.Flows.Localization (Glific v5.1.6)

The Localization object which stores all the localizations for all languages for a flow

Link to this section Summary

Functions

Given a language id and an case uuid, return the translation if one exists, else return the original text

Given a language id and an category uuid, return the translation if one exists, else return the original text

Given a language id and an template uuid, return the variable translation if one exists, else return the original variable

Given a language id and an action uuid, return the translation if one exists, else return the original text

Process a json structure from floweditor to the Glific data types

Link to this section Types

@type t() :: %Glific.Flows.Localization{id: term(), localizations: map() | nil}

Link to this section Functions

Link to this function

get_translated_case_arguments(context, flow_case)

View Source
@spec get_translated_case_arguments(
  Glific.Flows.FlowContext.t(),
  Glific.Flows.Case.t()
) :: any()

Given a language id and an case uuid, return the translation if one exists, else return the original text

Link to this function

get_translated_category_name(context, category)

View Source
@spec get_translated_category_name(
  Glific.Flows.FlowContext.t(),
  Glific.Flows.Category.t()
) ::
  String.t() | nil

Given a language id and an category uuid, return the translation if one exists, else return the original text

Link to this function

get_translated_template_vars(context, template)

View Source
@spec get_translated_template_vars(
  Glific.Flows.FlowContext.t(),
  atom() | %{:uuid => binary(), :variables => any(), optional(any()) => any()}
) :: list() | nil

Given a language id and an template uuid, return the variable translation if one exists, else return the original variable

Link to this function

get_translation(context, action, type \\ :text)

View Source
@spec get_translation(Glific.Flows.FlowContext.t(), Glific.Flows.Action.t(), atom()) ::
  String.t() | nil | map()

Given a language id and an action uuid, return the translation if one exists, else return the original text

@spec process(map()) :: t()

Process a json structure from floweditor to the Glific data types