summaryrefslogtreecommitdiff
path: root/indra/llui/llui.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-11-19 23:26:29 +0000
committerJames Cook <james@lindenlab.com>2008-11-19 23:26:29 +0000
commit2a44e81675d22aa5ed0844d5a4ac18bb9bd49f64 (patch)
tree595dd4b8b7beac938fc0e14ee075e5cfeb1f129b /indra/llui/llui.cpp
parent2d2d427158ca2465e2d70d84b4499cab57e2e208 (diff)
QAR-1018 Lightweight Windows Setup App (windows-setup-3). svn merge -r102882:102883 svn+ssh://svn.lindenlab.com/svn/linden/branches/windows-setup/windows-setup-3-merge
Diffstat (limited to 'indra/llui/llui.cpp')
-rw-r--r--indra/llui/llui.cpp36
1 files changed, 29 insertions, 7 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 472f8606b1..f1e7b98a60 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -30,8 +30,6 @@
*/
// Utilities functions the user interface needs
-
-//#include "llviewerprecompiledheaders.h"
#include "linden_common.h"
#include <string>
@@ -1647,6 +1645,34 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y)
setCursorPositionScreen(screen_x, screen_y);
}
+// On Windows, the user typically sets the language when they install the
+// app (by running it with a shortcut that sets InstallLanguage). On Mac,
+// or on Windows if the SecondLife.exe executable is run directly, the
+// language follows the OS language. In all cases the user can override
+// the language manually in preferences. JC
+// static
+std::string LLUI::getLanguage()
+{
+ std::string language = "en-us";
+ if (sConfigGroup)
+ {
+ language = sConfigGroup->getString("Language");
+ if (language.empty() || language == "default")
+ {
+ language = sConfigGroup->getString("InstallLanguage");
+ }
+ if (language.empty() || language == "default")
+ {
+ language = sConfigGroup->getString("SystemLanguage");
+ }
+ if (language.empty() || language == "default")
+ {
+ language = "en-us";
+ }
+ }
+ return language;
+}
+
//static
std::string LLUI::locateSkin(const std::string& filename)
{
@@ -1660,11 +1686,7 @@ std::string LLUI::locateSkin(const std::string& filename)
{
if (!gDirUtilp->fileExists(found_file))
{
- std::string localization(sConfigGroup->getString("Language"));
- if(localization == "default")
- {
- localization = sConfigGroup->getString("SystemLanguage");
- }
+ std::string localization = getLanguage();
std::string local_skin = "xui" + slash + localization + slash + filename;
found_file = gDirUtilp->findSkinnedFilename(local_skin);
}