chore(emqx_dashboard): update hocon desc cache APIs
This commit is contained in:
parent
6b0f56d4d6
commit
0945c959bf
|
|
@ -129,13 +129,13 @@ get_i18n() ->
|
||||||
application:get_env(emqx_dashboard, i18n).
|
application:get_env(emqx_dashboard, i18n).
|
||||||
|
|
||||||
init_i18n(File, Lang) ->
|
init_i18n(File, Lang) ->
|
||||||
Cache = hocon_schema:new_cache(File),
|
Cache = hocon_schema:new_desc_cache(File),
|
||||||
application:set_env(emqx_dashboard, i18n, #{lang => atom_to_binary(Lang), cache => Cache}).
|
application:set_env(emqx_dashboard, i18n, #{lang => atom_to_binary(Lang), cache => Cache}).
|
||||||
|
|
||||||
clear_i18n() ->
|
clear_i18n() ->
|
||||||
case application:get_env(emqx_dashboard, i18n) of
|
case application:get_env(emqx_dashboard, i18n) of
|
||||||
{ok, #{cache := Cache}} ->
|
{ok, #{cache := Cache}} ->
|
||||||
hocon_schema:delete_cache(Cache),
|
hocon_schema:delete_desc_cache(Cache),
|
||||||
application:unset_env(emqx_dashboard, i18n);
|
application:unset_env(emqx_dashboard, i18n);
|
||||||
undefined ->
|
undefined ->
|
||||||
ok
|
ok
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue