z_trans_server (zotonic_core v1.0.0-rc.14)
Link to this section Summary
Functions
Convert process state when code is changed
Trap unknown calls
Rebuild the translations table. Call the template flush routines afterwards. Trans is a map with all translations per translatable string.
Handling all non call/cast messages
Initiates the server.
Parse all .po files and reload the found translations in the trans server
Take a proplist with dicts and reload the translations table. After reloading the the template server is flushed.
Reload the translations when modules are changed.
Set the table id in the context to the newest table id
Starts the server
Return the name of the ets table holding all translations
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.
Link to this section Functions
Link to this function
code_change(OldVsn, State, Extra)
Link to this function
handle_call(Message, From, State)
Link to this function
handle_cast(Message, State)
Link to this function
handle_info(Info, State)
Link to this function
init(_)
-spec init({Site :: atom(), Name :: atom()}) -> {ok, #state{}}.
Link to this function
load_translations(Context)
-spec load_translations(z:context()) -> ok.
Link to this function
load_translations(Trans, Context)
-spec load_translations(map(), z:context()) -> ok.
Link to this function
observe_module_ready(_, Context)
-spec observe_module_ready(module_ready, z:context()) -> ok.
Link to this function
set_context_table(Context)
Link to this function
start_link(Site)
-spec start_link(Site :: atom()) -> {ok, pid()} | {error, term()}.
Link to this function
start_tests()
-spec start_tests() -> {ok, pid()} | {error, term()}.
Link to this function
table(Site)
-spec table(atom() | z:context()) -> atom().
Link to this function