Copyright © 2010-2017 Marc Worrell
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
code_change/3 | Convert process state when code is changed. |
handle_call/3 | Trap unknown calls. |
handle_cast/2 | Rebuild the translations table. |
handle_info/2 | Handling all non call/cast messages. |
init/1 | Initiates the server. |
load_translations/1 | Parse all .po files and reload the found translations in the trans server. |
load_translations/2 | Take a proplist with dicts and reload the translations table. |
observe_module_ready/2 | Reload the translations when modules are changed. |
set_context_table/1 | Set the table id in the context to the newest table id. |
start_link/1 | Starts the server. |
start_tests/0 | |
table/1 | Return the name of the ets table holding all translations. |
terminate/2 | This function is called by a gen_server when it is about to terminate. |
code_change(OldVsn, State, Extra) -> any()
Convert process state when code is changed
handle_call(Message, From, State) -> any()
Trap unknown calls
handle_cast(Message, State) -> any()
Rebuild the translations table. Call the template flush routines afterwards. Trans is a map with all translations per translatable string.
handle_info(Info, State) -> any()
Handling all non call/cast messages
init(X1::{Site::atom(), Name::atom()}) -> {ok, #state{}}
Initiates the server.
load_translations(Context::z:context()) -> ok
Parse all .po files and reload the found translations in the trans server
load_translations(Trans::map(), Context::z:context()) -> ok
Take a proplist with dicts and reload the translations table. After reloading the the template server is flushed.
observe_module_ready(X1::module_ready, Context::z:context()) -> ok
Reload the translations when modules are changed.
set_context_table(Context::z:context()) -> z:context()
Set the table id in the context to the newest table id
start_link(Site::atom()) -> {ok, pid()} | {error, term()}
Starts the server
start_tests() -> {ok, pid()} | {error, term()}
table(Site::atom() | z:context()) -> atom()
Return the name of the ets table holding all translations
terminate(Reason, State) -> any()
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.
Generated by EDoc