added [lang] ezc function for returning a localized string

This commit is contained in:
Tomasz Sowa 2021-10-07 04:41:06 +02:00
parent 1741597d52
commit c3122fb82f
3 changed files with 13 additions and 0 deletions

View File

@ -644,6 +644,7 @@ void Templates::CreateFunctions()
ezc_functions.Insert("winix_locale_tab_name", winix_locale_tab_name); ezc_functions.Insert("winix_locale_tab_name", winix_locale_tab_name);
ezc_functions.Insert("winix_is_htmx_request", winix_is_htmx_request); ezc_functions.Insert("winix_is_htmx_request", winix_is_htmx_request);
ezc_functions.Insert("lang", lang);
/* /*
who who

View File

@ -365,6 +365,7 @@ namespace TemplatesFunctions
void ls_ckeditor_funnum_browse(Info & i); void ls_ckeditor_funnum_browse(Info & i);
/* /*
privileges privileges
*/ */
@ -536,6 +537,8 @@ namespace TemplatesFunctions
void winix_locale_tab_name(Info & i); void winix_locale_tab_name(Info & i);
void winix_is_htmx_request(Info & i); void winix_is_htmx_request(Info & i);
void lang(Info & i); // defined in winix.cpp - MOVE ME to a better place
/* /*
who who
*/ */

View File

@ -381,6 +381,15 @@ void winix_is_htmx_request(Info & i)
} }
void lang(Info & i)
{
i.res = !i.par.empty();
if( i.res )
i.out << locale.Get(i.par);
}
} // namespace } // namespace