summaryrefslogtreecommitdiff
path: root/src/gettext.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-02-01 17:59:23 -0500
committerkwolekr <kwolekr@minetest.net>2015-02-05 03:24:22 -0500
commit9e2a9b55e185b92074b32d3df336920f33b29e5a (patch)
tree0ec7b908b01ef62db67a27cfcfba413a3adf6748 /src/gettext.cpp
parent84c367bb468441efe428478d3918f07a9b6c2d72 (diff)
downloadminetest-9e2a9b55e185b92074b32d3df336920f33b29e5a.tar.gz
minetest-9e2a9b55e185b92074b32d3df336920f33b29e5a.tar.bz2
minetest-9e2a9b55e185b92074b32d3df336920f33b29e5a.zip
Reduce gettext wide/narrow and string/char* conversions
Diffstat (limited to 'src/gettext.cpp')
-rw-r--r--src/gettext.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/gettext.cpp b/src/gettext.cpp
index 0c0e520ca..688a22570 100644
--- a/src/gettext.cpp
+++ b/src/gettext.cpp
@@ -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;
}
-
-
-