chore(emqx_dashboard): update hocon desc cache APIs

This commit is contained in:
Zaiming (Stone) Shi 2022-04-21 12:37:52 +02:00
parent 6b0f56d4d6
commit 0945c959bf
1 changed files with 2 additions and 2 deletions

View File

@ -129,13 +129,13 @@ get_i18n() ->
application:get_env(emqx_dashboard, i18n).
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}).
clear_i18n() ->
case application:get_env(emqx_dashboard, i18n) of
{ok, #{cache := Cache}} ->
hocon_schema:delete_cache(Cache),
hocon_schema:delete_desc_cache(Cache),
application:unset_env(emqx_dashboard, i18n);
undefined ->
ok