ImageVisual Action::Reload added
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TextSelectionPopupMirroringLTR.cpp
index 5234210..6a4bfa8 100644 (file)
@@ -31,22 +31,33 @@ namespace
 {
 
 const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
-const std::string DEFAULT_EN_LOCALE_DIR = "/tmp/locale/en/LC_MESSAGES/";
+static std::string gLocaleLang;
+static std::string gLocaleLanguage;
 
 }
 
 void dali_textselectionpopupmirroringltr_startup(void)
 {
-  // Cheat! Copy the .mo file
-  std::ifstream  src( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo.en" ).c_str(), std::ifstream::binary );
-  std::ofstream  dst( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo" ).c_str(), std::ofstream::binary );
-  dst << src.rdbuf();
+  // Keep the current locale environment.
+  char* langPtr = getenv( "LANG" );
+  gLocaleLang = std::string( langPtr );
+
+  char* languagePtr = getenv( "LANGUAGE" );
+  gLocaleLanguage = std::string( languagePtr );
+
+  // Set the locale environment to Arabic.
+  setenv( "LANG", "en_GB.UTF-8", 1 );
+  setenv( "LANGUAGE", "en_GB:en", 1 );
 
   test_return_value = TET_UNDEF;
 }
 
 void dali_textselectionpopupmirroringltr_cleanup(void)
 {
+  // Restore the locale environment.
+  setenv( "LANG", gLocaleLang.c_str(), 1 );
+  setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+
   test_return_value = TET_PASS;
 }