diff --git a/CMake/GenerateConfigProperties.cpp b/CMake/GenerateConfigProperties.cpp
index 4f60a4ffb166b95981a166b6cb4a85f335ee02fd..bd08948e8f703fe3008eed8db7dff06469fd8e69 100644
--- a/CMake/GenerateConfigProperties.cpp
+++ b/CMake/GenerateConfigProperties.cpp
@@ -33,7 +33,7 @@ PURPOSE.  See the above copyright notices for more information.
  */
 int main(int argc, char* argv[])
 {
-   const unsigned int nbParameters = 3;
+   const unsigned int nbParameters = 2;
 
    std::ofstream os(argv[1]); 
    if (!os)
@@ -57,22 +57,26 @@ int main(int argc, char* argv[])
        paramVector.push_back("");
      }
    }
+   
+   /** Get local configuration*/
+   const std::locale& mylocale = std::locale("");
+   
    /** Write parameters to the configuration file*/
    os << "#Auto generated by config-properties \n"
       << "OTB_LANG="
-      <<  paramVector[0]
+      <<  mylocale.name()
       << "\n"
       << "OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING="
-      <<  paramVector[1]
+      <<  paramVector[0]
       << "\n"
       << "OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING="
-      <<  paramVector[2]
+      <<  paramVector[1]
       << "\n"
       << "#End of config file properties generation"
       << std::endl;
    
    os.close();
-
+   
    std::cout << "wrote file: " << argv[1] << std::endl;
 
    exit(0);
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 265aa8e3ea1aa4c38fd1288278a326689290ef89..6633a2a15846e72790034630b1731a228d7be686 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1136,5 +1136,5 @@ ADD_CUSTOM_COMMAND(
           TARGET GenerateConfigProperties
           POST_BUILD
           COMMAND GenerateConfigProperties
-          ARGS "${otbconfigfile_DEFAULT}" "${OTB_LANG}" "${OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING}" "${OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING}"
+          ARGS "${otbconfigfile_DEFAULT}" "${OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING}" "${OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING}"
           COMMENT "Generating ${otbconfigfile_DEFAULT}" )
diff --git a/Testing/Code/Common/otbConfigurationTest.cxx b/Testing/Code/Common/otbConfigurationTest.cxx
index 5ddcf80a50ec9b02a703a8449c8eb749e88c5dc1..62dcc47e07d9ba48249c648fae3a6db01a6f9049 100644
--- a/Testing/Code/Common/otbConfigurationTest.cxx
+++ b/Testing/Code/Common/otbConfigurationTest.cxx
@@ -34,7 +34,10 @@ int otbConfigurationTest(int argc, char * argv[])
   std::cout << conf << std::endl;
   
   if (lang != "fr_FR.UTF-8")
-      return EXIT_FAILURE;
+  {
+    std::cout << "Locale language " << lang << std::endl;
+    return EXIT_FAILURE;
+  }
   
   return EXIT_SUCCESS;
 }