mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Reduce gettext wide/narrow and string/char* conversions
This commit is contained in:
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include <stdlib.h>
|
||||
#include "gettext.h"
|
||||
#include "util/string.h"
|
||||
#include "log.h"
|
||||
|
||||
#if USE_GETTEXT && defined(_MSC_VER)
|
||||
#include <WinNls.h>
|
||||
@@ -116,9 +117,9 @@ const char* MSVC_LocaleLookup(const char* raw_shortname) {
|
||||
|
||||
/******************************************************************************/
|
||||
#ifdef _MSC_VER
|
||||
void init_gettext(const char *path,std::string configured_language,int argc, char** argv) {
|
||||
void init_gettext(const char *path, const std::string &configured_language, int argc, char** argv) {
|
||||
#else
|
||||
void init_gettext(const char *path,std::string configured_language) {
|
||||
void init_gettext(const char *path, const std::string &configured_language) {
|
||||
#endif
|
||||
#if USE_GETTEXT
|
||||
/** first try to set user override environment **/
|
||||
@@ -173,15 +174,15 @@ void init_gettext(const char *path,std::string configured_language) {
|
||||
}
|
||||
|
||||
if (!CreateProcess(appname.c_str(),
|
||||
(char*) ptr_parameters,
|
||||
NULL,
|
||||
NULL,
|
||||
false,
|
||||
DETACHED_PROCESS | CREATE_UNICODE_ENVIRONMENT,
|
||||
NULL,
|
||||
NULL,
|
||||
&startupinfo,
|
||||
&processinfo)) {
|
||||
(char*) ptr_parameters,
|
||||
NULL,
|
||||
NULL,
|
||||
false,
|
||||
DETACHED_PROCESS | CREATE_UNICODE_ENVIRONMENT,
|
||||
NULL,
|
||||
NULL,
|
||||
&startupinfo,
|
||||
&processinfo)) {
|
||||
char buffer[1024];
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
@@ -261,9 +262,6 @@ void init_gettext(const char *path,std::string configured_language) {
|
||||
|
||||
setlocale(LC_NUMERIC,"C");
|
||||
infostream << "Message locale is now set to: "
|
||||
<< setlocale(LC_ALL,0) << std::endl;
|
||||
<< setlocale(LC_ALL, 0) << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user