View Source t__ (t__ v0.1.0)
Link to this section Summary
Functions
See also: t__:config_delete/2.
See also: t__:config_delete/2.
Deletes configuration for the specified application with the specified timeout.
See also: t__:config_delete/2.
Returns the current configuration for the calling process.
Returns the current configuration for the specified application.
See also: t__:config_set/3.
See also: t__:config_set/3.
Sets a new configuration for the specified application with the specified timeout.
See also: t__:config_set/3.
Returns the current language for the calling process.
See also: t__:translate/3.
Link to this section Types
-type config() :: #t__config{}.
-type p() :: #t__p{}.
-type repository() :: #t__repository{}.
Link to this section Functions
-spec application() -> t__ | Application when Application :: atom().
-spec config_delete() -> ok | {error, Error} when Error :: term().
See also: t__:config_delete/2.
-spec config_delete(Application) -> ok | {error, Error} when Application :: atom(), Error :: term().
See also: t__:config_delete/2.
-spec config_delete(Application, Timeout) -> ok | {error, Error}
when Application :: atom(), Timeout :: timeout(), Error :: term().
Deletes configuration for the specified application with the specified timeout.
There is a blocking gen_server call behind this! That's why there is a config_delete_cast version of this function for convenience.
Deleting applications config is possible but should not be abused. The system was designed for you to be able to change it at the application start or from an administration panel, from time to time.-spec config_delete_cast(Application) -> ok | {error, Error} when Application :: atom(), Error :: term().
See also: t__:config_delete/2.
-spec config_get() -> Config when Config :: t__:config().
Returns the current configuration for the calling process.
Please notice that the language config record field may not be the same to the calling process application config because language can also be configured at the process level. (The process level language overwrites the application configured language).
If you want to get the config holding application language, call t__:config/1 function.
The function will perform the following steps: - call erlang:get(t__language) to get any calling process specific language that will overwrite the language returned from the next calls - call application:get_env(t__config) - call application:get_env(t__, t__config) - if no t__config environment key was set for both the current application or the t__ application we return t__ default config-spec config_get(Application) -> Config when Application :: atom(), Config :: t__:config().
Returns the current configuration for the specified application.
The function will perform the following steps: - call application:get_env(t__config) - call application:get_env(t__, t__config) - if no t__config environment key was set for both the current application or the t__ application we return t__ default config-spec config_set(Config) -> ok | {error, Error} when Config :: t__:config(), Error :: term().
See also: t__:config_set/3.
-spec config_set(Application, Config) -> ok | {error, Error} when Application :: atom(), Config :: t__:config(), Error :: term().
See also: t__:config_set/3.
-spec config_set(Application, Config, Timeout) -> ok | {error, Error} when Application :: atom(), Config :: t__:config(), Timeout :: timeout(), Error :: term().
Sets a new configuration for the specified application with the specified timeout.
There is a blocking gen_server call behind this! That's why there is a config_set_cast version of this function for convenience. However I don't recommend using that because you will not know if the operation failed.
Changing applications config is possible but should not be abused. The system was designed for you to be able to change it at the application start or from an administration panel, from time to time.-spec config_set_cast(Application, Config) -> ok | {error, Error} when Application :: atom(), Config :: t__:config(), Error :: term().
See also: t__:config_set/3.
-spec language() -> Language when Language :: string().
Returns the current language for the calling process.
When you properly setup the language for the process, the expected time complexity for the current implementation of this macro is O(1) and the worst case time complexity is O(N), where N is the number of items in the process dictionary.
The function will perform the following steps in order to determine the default language: - call erlang:get(t__language) - call application:get_env(t__config) - call application:get_env(t__, t__config) - if no t__config environment key was set for both the current application or the t__ application we return t__ default language.-spec translate(Param) -> Msg when Param :: term(), Msg :: string().
-spec translate(Param, Data) -> Msg when Param :: term(), Data :: undefined | list(), Msg :: string().
See also: t__:translate/3.
-spec translate(Param, Data, Reference) -> Msg
when
Param :: term(),
Data :: undefined | list(),
Reference :: undefined | string(),
Msg :: string().
translate(Application, Repository, Language, Context, Msg, Data, Reference)
View Source-spec translate(Application, Repository, Language, Context, Msg, Data, Reference) -> TranslatedMsg
when
Application :: undefined | atom(),
Repository :: undefined | string() | atom() | binary(),
Language :: undefined | string() | atom() | binary(),
Context :: undefined | string() | atom() | binary(),
Msg :: string() | atom() | binary(),
Data :: undefined | list(),
Reference :: undefined | string(),
TranslatedMsg :: string().