summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcin Zawadzki <zaba.marcin@gmail.com>2013-01-05 23:03:26 +0100
committerMarcin Zawadzki <zaba.marcin@gmail.com>2013-01-05 23:03:26 +0100
commitff5c89085415a370911793d5764dfb694fc43b7d (patch)
tree77d5a07b74fc683b1e6afb45e80c39dc23a45ce7 /src
parentfff9d235e49f5957e6d84b4774ca42c1a6cbcd35 (diff)
downloadcolobot-ff5c89085415a370911793d5764dfb694fc43b7d.tar.gz
colobot-ff5c89085415a370911793d5764dfb694fc43b7d.tar.bz2
colobot-ff5c89085415a370911793d5764dfb694fc43b7d.zip
Small fix in detecting language. Fixes needed to compile code using clang
Diffstat (limited to 'src')
-rw-r--r--src/CBot/tests/CBot_console/CMakeLists.txt1
-rw-r--r--src/app/app.cpp13
-rw-r--r--src/common/test/CMakeLists.txt1
-rw-r--r--src/graphics/engine/test/CMakeLists.txt1
-rw-r--r--src/graphics/opengl/test/CMakeLists.txt1
-rw-r--r--src/math/test/CMakeLists.txt1
-rw-r--r--src/ui/test/CMakeLists.txt1
7 files changed, 11 insertions, 8 deletions
diff --git a/src/CBot/tests/CBot_console/CMakeLists.txt b/src/CBot/tests/CBot_console/CMakeLists.txt
index 9f0f244..f76dedf 100644
--- a/src/CBot/tests/CBot_console/CMakeLists.txt
+++ b/src/CBot/tests/CBot_console/CMakeLists.txt
@@ -8,7 +8,6 @@ if(NOT CMAKE_BUILD_TYPE)
endif(NOT CMAKE_BUILD_TYPE)
# Global compile flags
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
diff --git a/src/app/app.cpp b/src/app/app.cpp
index c936ac1..6930920 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -1472,7 +1472,16 @@ void CApplication::SetLanguage(Language language)
if (locale.empty())
{
char *envLang = getenv("LANGUAGE");
- if (strncmp(envLang,"en",2) == 0)
+ if (envLang == NULL)
+ {
+ envLang = getenv("LANG");
+ }
+ if (envLang == NULL)
+ {
+ GetLogger()->Error("Failed to get language from environment, setting default language");
+ m_language = LANGUAGE_ENGLISH;
+ }
+ else if (strncmp(envLang,"en",2) == 0)
{
m_language = LANGUAGE_ENGLISH;
}
@@ -1484,7 +1493,7 @@ void CApplication::SetLanguage(Language language)
{
m_language = LANGUAGE_FRENCH;
}
- else if (strncmp(envLang,"po",2) == 0)
+ else if (strncmp(envLang,"pl",2) == 0)
{
m_language = LANGUAGE_POLISH;
}
diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt
index 26a31c9..70dac1f 100644
--- a/src/common/test/CMakeLists.txt
+++ b/src/common/test/CMakeLists.txt
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE debug)
endif(NOT CMAKE_BUILD_TYPE)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
include_directories(
diff --git a/src/graphics/engine/test/CMakeLists.txt b/src/graphics/engine/test/CMakeLists.txt
index 46509f4..c837ae5 100644
--- a/src/graphics/engine/test/CMakeLists.txt
+++ b/src/graphics/engine/test/CMakeLists.txt
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE debug)
endif(NOT CMAKE_BUILD_TYPE)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(MODELFILE_TEST_SOURCES
diff --git a/src/graphics/opengl/test/CMakeLists.txt b/src/graphics/opengl/test/CMakeLists.txt
index 154fec8..79e0ba5 100644
--- a/src/graphics/opengl/test/CMakeLists.txt
+++ b/src/graphics/opengl/test/CMakeLists.txt
@@ -8,7 +8,6 @@ find_package(PNG REQUIRED)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE debug)
endif(NOT CMAKE_BUILD_TYPE)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(ADD_LIBS "")
diff --git a/src/math/test/CMakeLists.txt b/src/math/test/CMakeLists.txt
index dae4018..e31260c 100644
--- a/src/math/test/CMakeLists.txt
+++ b/src/math/test/CMakeLists.txt
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE debug)
endif(NOT CMAKE_BUILD_TYPE)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
include_directories(
diff --git a/src/ui/test/CMakeLists.txt b/src/ui/test/CMakeLists.txt
index e411067..c38d2bb 100644
--- a/src/ui/test/CMakeLists.txt
+++ b/src/ui/test/CMakeLists.txt
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE debug)
endif(NOT CMAKE_BUILD_TYPE)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
include_directories(