about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch')
-rw-r--r--nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch22
1 files changed, 11 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch b/nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
index 775a8ec6007d..60a3dc457453 100644
--- a/nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
+++ b/nixpkgs/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
@@ -1,20 +1,20 @@
 diff --git a/src/translations.cpp b/src/translations.cpp
-index 6520cfe..49f7b2c 100644
+index 2585b7ec56..7bb005823c 100644
 --- a/src/translations.cpp
 +++ b/src/translations.cpp
-@@ -72,15 +72,11 @@ void set_language(bool reload_options)
- 
-     // Step 2. Bind to gettext domain.
-     const char *locale_dir;
--#ifdef __linux__
-     if (!FILENAMES["base_path"].empty()) {
-         locale_dir = std::string(FILENAMES["base_path"] + "share/locale").c_str();
+@@ -195,14 +195,12 @@ void set_language()
+     auto env = getenv( "LANGUAGE" );
+     locale_dir = std::string( FILENAMES["base_path"] + "lang/mo/" + ( env ? env : "none" ) +
+                               "/LC_MESSAGES/cataclysm-dda.mo" );
+-#elif (defined __linux__ || (defined MACOSX && !defined TILES))
++#else
+     if( !FILENAMES["base_path"].empty() ) {
+         locale_dir = FILENAMES["base_path"] + "share/locale";
      } else {
          locale_dir = "lang/mo";
      }
 -#else
 -    locale_dir = "lang/mo";
--#endif // __linux__
+ #endif
  
-     bindtextdomain("cataclysm-dda", locale_dir);
-     bind_textdomain_codeset("cataclysm-dda", "UTF-8");
+     const char *locale_dir_char = locale_dir.c_str();