summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorOrcan Ogetbil <oget.fedora@gmail.com>2010-12-13 11:31:53 +0000
committerOrcan Ogetbil <oget.fedora@gmail.com>2010-12-13 11:31:53 +0000
commit466a93203ef2cccbf91316e28661aaa29f8a506e (patch)
treeacc8f595d9f196217972d877fc27247fedfdd2c9 /muse2/muse
parent0da3a1d73e2b407047bfedfb4f085fb8df067a19 (diff)
List the available locales in the --help output
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/app.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index 2d19f2cc..e2748724 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -3590,6 +3590,33 @@ class MuseApplication : public QApplication {
};
//---------------------------------------------------------
+// localeList
+//---------------------------------------------------------
+
+static QString localeList()
+ {
+ // Find out what translations are available:
+ QStringList deliveredLocaleListFiltered;
+ QString distLocale = QString(INSTPREFIX) + "/" + SHAREINSTPREFIX + "/"
+ + INSTALL_NAME + "/locale";
+ QFileInfo distLocaleFi(distLocale);
+ if (distLocaleFi.isDir()) {
+ QDir dir = QDir(distLocale);
+ QStringList deliveredLocaleList = dir.entryList();
+ for(QStringList::iterator it = deliveredLocaleList.begin(); it != deliveredLocaleList.end(); ++it) {
+ QString item = *it;
+ if (item.endsWith(".qm")) {
+ int inipos = item.indexOf("muse_") + 5;
+ int finpos = item.lastIndexOf(".qm");
+ deliveredLocaleListFiltered << item.mid(inipos, finpos - inipos);
+ }
+ }
+ return deliveredLocaleListFiltered.join(",");
+ }
+ return QString("No translations found!");
+ }
+
+//---------------------------------------------------------
// usage
//---------------------------------------------------------
@@ -3621,7 +3648,7 @@ static void usage(const char* prog, const char* txt)
#ifdef HAVE_LASH
fprintf(stderr, " -L don't use LASH\n");
#endif
- fprintf(stderr, " -l xx force locale given by language/country code (de, sv_SE, ...)");
+ fprintf(stderr, " -l xx force locale to the given language/country code (xx = %s)\n", localeList().toLatin1().constData());
fprintf(stderr, "useful environment variables:\n");
fprintf(stderr, " MUSE override library and shared directories location\n");
fprintf(stderr, " MUSEHOME override user home directory (HOME/)\n");