diff options
author | Jacek Antonelli | 2008-12-09 22:25:37 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-09 22:25:41 -0600 |
commit | 22b861982f2efd5d16097a012627e73b9fb85834 (patch) | |
tree | 6152a84b92c682e271bdd52d46cd1728454f679a /linden/indra/llui/llui.cpp | |
parent | Second Life viewer sources 1.22.1-RC (diff) | |
download | meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.zip meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.tar.gz meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.tar.bz2 meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.tar.xz |
Second Life viewer sources 1.22.2-RC
Diffstat (limited to 'linden/indra/llui/llui.cpp')
-rw-r--r-- | linden/indra/llui/llui.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 5502246..4817d78 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp | |||
@@ -30,8 +30,6 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | // Utilities functions the user interface needs | 32 | // Utilities functions the user interface needs |
33 | |||
34 | //#include "llviewerprecompiledheaders.h" | ||
35 | #include "linden_common.h" | 33 | #include "linden_common.h" |
36 | 34 | ||
37 | #include <string> | 35 | #include <string> |
@@ -1647,6 +1645,34 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y) | |||
1647 | setCursorPositionScreen(screen_x, screen_y); | 1645 | setCursorPositionScreen(screen_x, screen_y); |
1648 | } | 1646 | } |
1649 | 1647 | ||
1648 | // On Windows, the user typically sets the language when they install the | ||
1649 | // app (by running it with a shortcut that sets InstallLanguage). On Mac, | ||
1650 | // or on Windows if the SecondLife.exe executable is run directly, the | ||
1651 | // language follows the OS language. In all cases the user can override | ||
1652 | // the language manually in preferences. JC | ||
1653 | // static | ||
1654 | std::string LLUI::getLanguage() | ||
1655 | { | ||
1656 | std::string language = "en-us"; | ||
1657 | if (sConfigGroup) | ||
1658 | { | ||
1659 | language = sConfigGroup->getString("Language"); | ||
1660 | if (language.empty() || language == "default") | ||
1661 | { | ||
1662 | language = sConfigGroup->getString("InstallLanguage"); | ||
1663 | } | ||
1664 | if (language.empty() || language == "default") | ||
1665 | { | ||
1666 | language = sConfigGroup->getString("SystemLanguage"); | ||
1667 | } | ||
1668 | if (language.empty() || language == "default") | ||
1669 | { | ||
1670 | language = "en-us"; | ||
1671 | } | ||
1672 | } | ||
1673 | return language; | ||
1674 | } | ||
1675 | |||
1650 | //static | 1676 | //static |
1651 | std::string LLUI::locateSkin(const std::string& filename) | 1677 | std::string LLUI::locateSkin(const std::string& filename) |
1652 | { | 1678 | { |
@@ -1660,11 +1686,7 @@ std::string LLUI::locateSkin(const std::string& filename) | |||
1660 | { | 1686 | { |
1661 | if (!gDirUtilp->fileExists(found_file)) | 1687 | if (!gDirUtilp->fileExists(found_file)) |
1662 | { | 1688 | { |
1663 | std::string localization(sConfigGroup->getString("Language")); | 1689 | std::string localization = getLanguage(); |
1664 | if(localization == "default") | ||
1665 | { | ||
1666 | localization = sConfigGroup->getString("SystemLanguage"); | ||
1667 | } | ||
1668 | std::string local_skin = "xui" + slash + localization + slash + filename; | 1690 | std::string local_skin = "xui" + slash + localization + slash + filename; |
1669 | found_file = gDirUtilp->findSkinnedFilename(local_skin); | 1691 | found_file = gDirUtilp->findSkinnedFilename(local_skin); |
1670 | } | 1692 | } |