]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-main.cc
move 'dump' solver from apt-utils to apt package
[apt.git] / apt-private / private-main.cc
index 9eb306834c5de2d616b4329a6da3e512b9710e0b..60ba422b6802906269c2069656f7e90b77c46878 100644 (file)
@@ -7,6 +7,8 @@
 #include <apt-private/private-main.h>
 
 #include <iostream>
+#include <locale>
+
 #include <string.h>
 #include <unistd.h>
 #include <signal.h>
 #include <apti18n.h>
 
 
-void InitLocale()                                                      /*{{{*/
+void InitLocale(APT_CMD const binary)                          /*{{{*/
 {
-   setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   try {
+      std::locale::global(std::locale(""));
+   } catch (...) {
+      setlocale(LC_ALL, "");
+   }
+   switch(binary)
+   {
+      case APT_CMD::APT:
+      case APT_CMD::APT_CACHE:
+      case APT_CMD::APT_CDROM:
+      case APT_CMD::APT_CONFIG:
+      case APT_CMD::APT_DUMP_SOLVER:
+      case APT_CMD::APT_HELPER:
+      case APT_CMD::APT_GET:
+      case APT_CMD::APT_MARK:
+        textdomain("apt");
+        break;
+      case APT_CMD::APT_EXTRACTTEMPLATES:
+      case APT_CMD::APT_FTPARCHIVE:
+      case APT_CMD::APT_INTERNAL_SOLVER:
+      case APT_CMD::APT_SORTPKG:
+        textdomain("apt-utils");
+        break;
+   }
 }
+void InitLocale() {}
                                                                        /*}}}*/
 void InitSignals()                                                     /*{{{*/
 {