1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add support for ContentDB package translation (#14410)

This commit is contained in:
rubenwardy 2024-02-25 22:09:52 +00:00 committed by GitHub
parent 4caf0e4cb9
commit f4eba3bfba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 2 deletions

View file

@ -933,6 +933,17 @@ int ModApiMainMenu::l_get_video_drivers(lua_State *L)
return 1;
}
/******************************************************************************/
int ModApiMainMenu::l_get_language(lua_State *L)
{
std::string lang = gettext("LANG_CODE");
if (lang == "LANG_CODE")
lang = "";
lua_pushstring(L, lang.c_str());
return 1;
}
/******************************************************************************/
int ModApiMainMenu::l_gettext(lua_State *L)
{
@ -1151,6 +1162,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
API_FCT(get_mainmenu_path);
API_FCT(show_path_select_dialog);
API_FCT(download_file);
API_FCT(get_language);
API_FCT(gettext);
API_FCT(get_video_drivers);
API_FCT(get_window_info);
@ -1191,5 +1203,6 @@ void ModApiMainMenu::InitializeAsync(lua_State *L, int top)
API_FCT(download_file);
API_FCT(get_min_supp_proto);
API_FCT(get_max_supp_proto);
API_FCT(get_language);
API_FCT(gettext);
}