Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Crowdin updates #2505

Merged
merged 5,954 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5954 commits
Select commit Hold shift + click to select a range
4f53262
New translations client.pot (Dutch)
MTABot Feb 20, 2023
ce821d5
New translations client.pot (Polish)
MTABot Feb 20, 2023
7ac3cf4
New translations client.pot (Portuguese)
MTABot Feb 20, 2023
606159e
New translations client.pot (Russian)
MTABot Feb 20, 2023
21942d5
New translations client.pot (Slovak)
MTABot Feb 20, 2023
0b186b4
New translations client.pot (Slovenian)
MTABot Feb 20, 2023
99f410e
New translations client.pot (Swedish)
MTABot Feb 20, 2023
36565f3
New translations client.pot (Ukrainian)
MTABot Feb 20, 2023
398ca6b
New translations client.pot (Chinese Simplified)
MTABot Feb 20, 2023
248a398
New translations client.pot (Vietnamese)
MTABot Feb 20, 2023
e28889f
New translations client.pot (Portuguese, Brazilian)
MTABot Feb 20, 2023
e3eb0f7
New translations client.pot (Indonesian)
MTABot Feb 20, 2023
ed585d5
New translations client.pot (Persian)
MTABot Feb 20, 2023
6098843
New translations client.pot (Croatian)
MTABot Feb 20, 2023
aaabdb3
New translations client.pot (Estonian)
MTABot Feb 20, 2023
4d9efbf
New translations client.pot (Latvian)
MTABot Feb 20, 2023
7df76c2
New translations client.pot (Azerbaijani)
MTABot Feb 20, 2023
a1ab07d
New translations client.pot (Hindi)
MTABot Feb 20, 2023
04c11b0
New translations client.pot (Filipino)
MTABot Feb 20, 2023
1bb263c
New translations client.pot (Bosnian)
MTABot Feb 20, 2023
56ac3bc
New translations client.pot (Norwegian Bokmal)
MTABot Feb 20, 2023
81c6c0d
New translations client.pot (Serbian)
MTABot Feb 20, 2023
9250a96
New translations client.pot (German)
MTABot Feb 25, 2023
1ab342b
New translations client.pot (Lithuanian)
MTABot Feb 25, 2023
272d813
New translations client.pot (Turkish)
MTABot Feb 25, 2023
a9b8e94
New translations client.pot (Chinese Traditional)
MTABot Feb 25, 2023
431719e
New translations client.pot (Romanian)
MTABot Feb 25, 2023
8973bdc
New translations client.pot (French)
MTABot Feb 25, 2023
170d67e
New translations client.pot (Spanish)
MTABot Feb 25, 2023
d9f0fa8
New translations client.pot (Arabic)
MTABot Feb 25, 2023
3fbca1e
New translations client.pot (Bulgarian)
MTABot Feb 25, 2023
b234fb8
New translations client.pot (Czech)
MTABot Feb 25, 2023
31c4406
New translations client.pot (Danish)
MTABot Feb 25, 2023
9d01579
New translations client.pot (Greek)
MTABot Feb 25, 2023
ee2874a
New translations client.pot (Finnish)
MTABot Feb 25, 2023
b483183
New translations client.pot (Hebrew)
MTABot Feb 25, 2023
b7dc23e
New translations client.pot (Hungarian)
MTABot Feb 25, 2023
f2d5393
New translations client.pot (Italian)
MTABot Feb 25, 2023
17022d8
New translations client.pot (Japanese)
MTABot Feb 25, 2023
5fc7b60
New translations client.pot (Georgian)
MTABot Feb 25, 2023
6a04516
New translations client.pot (Korean)
MTABot Feb 25, 2023
125bd45
New translations client.pot (Macedonian)
MTABot Feb 25, 2023
cd6d51a
New translations client.pot (Dutch)
MTABot Feb 25, 2023
f05bb01
New translations client.pot (Polish)
MTABot Feb 25, 2023
6a1d85e
New translations client.pot (Portuguese)
MTABot Feb 25, 2023
44232c0
New translations client.pot (Russian)
MTABot Feb 25, 2023
200fbcd
New translations client.pot (Slovak)
MTABot Feb 25, 2023
caea8cf
New translations client.pot (Slovenian)
MTABot Feb 25, 2023
24a8b74
New translations client.pot (Swedish)
MTABot Feb 25, 2023
f599346
New translations client.pot (Ukrainian)
MTABot Feb 25, 2023
fee8e66
New translations client.pot (Chinese Simplified)
MTABot Feb 25, 2023
2c79fb8
New translations client.pot (Vietnamese)
MTABot Feb 25, 2023
2fb26f9
New translations client.pot (Portuguese, Brazilian)
MTABot Feb 25, 2023
b8f708e
New translations client.pot (Indonesian)
MTABot Feb 25, 2023
3f3368f
New translations client.pot (Persian)
MTABot Feb 25, 2023
0ac2798
New translations client.pot (Croatian)
MTABot Feb 25, 2023
60bfca4
New translations client.pot (Estonian)
MTABot Feb 25, 2023
01244d3
New translations client.pot (Latvian)
MTABot Feb 25, 2023
646f19b
New translations client.pot (Azerbaijani)
MTABot Feb 25, 2023
a2fe154
New translations client.pot (Hindi)
MTABot Feb 25, 2023
57c611d
New translations client.pot (Filipino)
MTABot Feb 25, 2023
c64cf9c
New translations client.pot (Bosnian)
MTABot Feb 25, 2023
596c693
New translations client.pot (Norwegian Bokmal)
MTABot Feb 25, 2023
b4cb3c5
New translations client.pot (Serbian)
MTABot Feb 25, 2023
adafc22
New translations client.pot (Romanian)
MTABot Feb 27, 2023
e0d3796
New translations client.pot (Italian)
MTABot Mar 2, 2023
12e6083
New translations main_menu.pot (Italian)
MTABot Mar 2, 2023
034f04b
New translations client.pot (Italian)
MTABot Mar 2, 2023
42cb387
New translations client.pot (Arabic)
MTABot Mar 3, 2023
9bcd723
New translations client.pot (Arabic)
MTABot Mar 3, 2023
ace4ef2
New translations client.pot (German)
MTABot Mar 5, 2023
bf8327d
New translations client.pot (Lithuanian)
MTABot Mar 5, 2023
dbe4490
New translations client.pot (Romanian)
MTABot Mar 5, 2023
7cab4b6
New translations client.pot (French)
MTABot Mar 5, 2023
132747c
New translations client.pot (Spanish)
MTABot Mar 5, 2023
f5adecc
New translations client.pot (Arabic)
MTABot Mar 5, 2023
d828794
New translations client.pot (Bulgarian)
MTABot Mar 5, 2023
a70a676
New translations client.pot (Czech)
MTABot Mar 5, 2023
73c7439
New translations client.pot (Danish)
MTABot Mar 5, 2023
2499d51
New translations client.pot (Greek)
MTABot Mar 5, 2023
60f96bc
New translations client.pot (Finnish)
MTABot Mar 5, 2023
76e0c5e
New translations client.pot (Hebrew)
MTABot Mar 5, 2023
08a1621
New translations client.pot (Hungarian)
MTABot Mar 5, 2023
cb4bce2
New translations client.pot (Turkish)
MTABot Mar 5, 2023
5a0cf14
New translations client.pot (Chinese Traditional)
MTABot Mar 5, 2023
ae9609d
New translations client.pot (Italian)
MTABot Mar 5, 2023
4c6268b
New translations client.pot (Japanese)
MTABot Mar 5, 2023
1be45c2
New translations client.pot (Georgian)
MTABot Mar 5, 2023
e3c27b8
New translations client.pot (Korean)
MTABot Mar 5, 2023
0e747e3
New translations client.pot (Macedonian)
MTABot Mar 5, 2023
bfa32c6
New translations client.pot (Dutch)
MTABot Mar 5, 2023
888f256
New translations client.pot (Polish)
MTABot Mar 5, 2023
b8b1ab3
New translations client.pot (Portuguese)
MTABot Mar 5, 2023
1d0c4e0
New translations client.pot (Russian)
MTABot Mar 5, 2023
5d7ed1d
New translations client.pot (Slovak)
MTABot Mar 5, 2023
e4da739
New translations client.pot (Slovenian)
MTABot Mar 5, 2023
1ebb57b
New translations client.pot (Swedish)
MTABot Mar 5, 2023
593152f
New translations client.pot (Ukrainian)
MTABot Mar 5, 2023
03dfa09
New translations client.pot (Chinese Simplified)
MTABot Mar 5, 2023
443c6a6
New translations client.pot (Vietnamese)
MTABot Mar 5, 2023
feacd96
New translations client.pot (Portuguese, Brazilian)
MTABot Mar 5, 2023
b403197
New translations client.pot (Indonesian)
MTABot Mar 5, 2023
5250e86
New translations client.pot (Persian)
MTABot Mar 5, 2023
25f1819
New translations client.pot (Croatian)
MTABot Mar 5, 2023
d41ecc0
New translations client.pot (Estonian)
MTABot Mar 5, 2023
52f1f8b
New translations client.pot (Latvian)
MTABot Mar 5, 2023
90fc098
New translations client.pot (Azerbaijani)
MTABot Mar 5, 2023
865b04a
New translations client.pot (Hindi)
MTABot Mar 5, 2023
2fb2de2
New translations client.pot (Filipino)
MTABot Mar 5, 2023
394d5a6
New translations client.pot (Bosnian)
MTABot Mar 5, 2023
0d9ff0c
New translations client.pot (Norwegian Bokmal)
MTABot Mar 5, 2023
dbe492b
New translations client.pot (Serbian)
MTABot Mar 5, 2023
be6e2a0
New translations client.pot (Filipino)
MTABot Mar 8, 2023
d45f99f
New translations client.pot (Filipino)
MTABot Mar 8, 2023
c6f9130
New translations client.pot (Azerbaijani)
MTABot Mar 8, 2023
11ea58b
New translations client.pot (German)
MTABot Mar 18, 2023
ca8f970
New translations client.pot (Lithuanian)
MTABot Mar 18, 2023
743f45c
New translations client.pot (Turkish)
MTABot Mar 18, 2023
4ee27f1
New translations client.pot (Chinese Traditional)
MTABot Mar 18, 2023
84d47ad
New translations client.pot (Romanian)
MTABot Mar 18, 2023
4ff8d03
New translations client.pot (French)
MTABot Mar 18, 2023
e5afd28
New translations client.pot (Spanish)
MTABot Mar 18, 2023
693b37f
New translations client.pot (Arabic)
MTABot Mar 18, 2023
8c2e27c
New translations client.pot (Bulgarian)
MTABot Mar 18, 2023
1010902
New translations client.pot (Czech)
MTABot Mar 18, 2023
ec04d5d
New translations client.pot (Danish)
MTABot Mar 18, 2023
97bc2bd
New translations client.pot (Greek)
MTABot Mar 18, 2023
659b9f4
New translations client.pot (Finnish)
MTABot Mar 18, 2023
5f2032e
New translations client.pot (Hebrew)
MTABot Mar 18, 2023
44efa41
New translations client.pot (Hungarian)
MTABot Mar 18, 2023
2665a31
New translations client.pot (Italian)
MTABot Mar 18, 2023
aaa5b55
New translations client.pot (Japanese)
MTABot Mar 18, 2023
0fd9d1d
New translations client.pot (Georgian)
MTABot Mar 18, 2023
97aee99
New translations client.pot (Korean)
MTABot Mar 18, 2023
78a966e
New translations client.pot (Macedonian)
MTABot Mar 18, 2023
4581c8e
New translations client.pot (Dutch)
MTABot Mar 18, 2023
98e7438
New translations client.pot (Polish)
MTABot Mar 18, 2023
bbf9498
New translations client.pot (Portuguese)
MTABot Mar 18, 2023
ff25403
New translations client.pot (Russian)
MTABot Mar 18, 2023
714b646
New translations client.pot (Slovak)
MTABot Mar 18, 2023
16e5b8b
New translations client.pot (Slovenian)
MTABot Mar 18, 2023
aaa2763
New translations client.pot (Swedish)
MTABot Mar 18, 2023
c15591a
New translations client.pot (Ukrainian)
MTABot Mar 18, 2023
3b25faf
New translations client.pot (Chinese Simplified)
MTABot Mar 18, 2023
38b7da0
New translations client.pot (Vietnamese)
MTABot Mar 18, 2023
a870a92
New translations client.pot (Portuguese, Brazilian)
MTABot Mar 18, 2023
b9b84eb
New translations client.pot (Indonesian)
MTABot Mar 18, 2023
e57dfd4
New translations client.pot (Persian)
MTABot Mar 18, 2023
de4ffcb
New translations client.pot (Croatian)
MTABot Mar 18, 2023
8cac85d
New translations client.pot (Estonian)
MTABot Mar 18, 2023
1d0b52e
New translations client.pot (Latvian)
MTABot Mar 18, 2023
5c15ff1
New translations client.pot (Azerbaijani)
MTABot Mar 18, 2023
68293e5
New translations client.pot (Hindi)
MTABot Mar 18, 2023
8f22252
New translations client.pot (Filipino)
MTABot Mar 18, 2023
bcc90e1
New translations client.pot (Bosnian)
MTABot Mar 18, 2023
d482aab
New translations client.pot (Norwegian Bokmal)
MTABot Mar 18, 2023
cdd2ce9
New translations client.pot (Serbian)
MTABot Mar 18, 2023
62b962c
New translations client.pot (Arabic)
MTABot Mar 31, 2023
5280dce
New translations client.pot (Arabic)
MTABot Mar 31, 2023
23f5d02
New translations client.pot (Arabic)
MTABot Apr 5, 2023
c368123
New translations client.pot (Arabic)
MTABot Apr 7, 2023
b669f68
New translations client.pot (Romanian)
MTABot Apr 7, 2023
2db529e
New translations client.pot (French)
MTABot Apr 7, 2023
595a993
New translations client.pot (Spanish)
MTABot Apr 7, 2023
d45cd53
New translations client.pot (Bulgarian)
MTABot Apr 7, 2023
cc53a5c
New translations client.pot (Czech)
MTABot Apr 7, 2023
3e41082
New translations client.pot (Danish)
MTABot Apr 7, 2023
2809c6a
New translations client.pot (German)
MTABot Apr 7, 2023
5b9c84e
New translations client.pot (Greek)
MTABot Apr 7, 2023
440bdef
New translations client.pot (Finnish)
MTABot Apr 7, 2023
cb030ca
New translations client.pot (Hebrew)
MTABot Apr 7, 2023
2d8bb4c
New translations client.pot (Hungarian)
MTABot Apr 7, 2023
1c8dd17
New translations client.pot (Italian)
MTABot Apr 7, 2023
ba93754
New translations client.pot (Japanese)
MTABot Apr 7, 2023
156c567
New translations client.pot (Georgian)
MTABot Apr 7, 2023
d118085
New translations client.pot (Korean)
MTABot Apr 7, 2023
3e55684
New translations client.pot (Lithuanian)
MTABot Apr 7, 2023
05b6be0
New translations client.pot (Macedonian)
MTABot Apr 7, 2023
ffa2de5
New translations client.pot (Dutch)
MTABot Apr 7, 2023
79844e8
New translations client.pot (Polish)
MTABot Apr 7, 2023
e1c6c0c
New translations client.pot (Portuguese)
MTABot Apr 7, 2023
a4efed3
New translations client.pot (Russian)
MTABot Apr 7, 2023
e7c9dd4
New translations client.pot (Slovak)
MTABot Apr 7, 2023
6ee36f2
New translations client.pot (Slovenian)
MTABot Apr 7, 2023
fc1c914
New translations client.pot (Swedish)
MTABot Apr 7, 2023
a89d9e8
New translations client.pot (Turkish)
MTABot Apr 7, 2023
5e634e2
New translations client.pot (Ukrainian)
MTABot Apr 7, 2023
9056ef5
New translations client.pot (Chinese Simplified)
MTABot Apr 7, 2023
b9d5a38
New translations client.pot (Chinese Traditional)
MTABot Apr 7, 2023
b60a6b3
New translations client.pot (Vietnamese)
MTABot Apr 7, 2023
c7ca36a
New translations client.pot (Portuguese, Brazilian)
MTABot Apr 7, 2023
d71583b
New translations client.pot (Indonesian)
MTABot Apr 7, 2023
02f8e35
New translations client.pot (Persian)
MTABot Apr 7, 2023
09eb587
New translations client.pot (Croatian)
MTABot Apr 7, 2023
780e2df
New translations client.pot (Estonian)
MTABot Apr 7, 2023
c0882c4
New translations client.pot (Latvian)
MTABot Apr 7, 2023
6bd5388
New translations client.pot (Azerbaijani)
MTABot Apr 7, 2023
81b954c
New translations client.pot (Hindi)
MTABot Apr 7, 2023
2ecf842
New translations client.pot (Filipino)
MTABot Apr 7, 2023
5bb39fb
New translations client.pot (Bosnian)
MTABot Apr 7, 2023
6b9a4ed
New translations client.pot (Norwegian Bokmal)
MTABot Apr 7, 2023
9fd4483
New translations client.pot (Serbian)
MTABot Apr 7, 2023
559216a
Merge branch 'master' into l10n/master
patrikjuvonen Apr 7, 2023
2277f2b
Update main menu images
patrikjuvonen Apr 7, 2023
206a3b6
Update client en_US pot
github-actions[bot] Apr 7, 2023
042dd31
New translations client.pot (Arabic)
MTABot Apr 7, 2023
cd32f49
New translations client.pot (Arabic)
MTABot Apr 7, 2023
9f15d91
New translations client.pot (Romanian)
MTABot Apr 7, 2023
2100d2f
New translations client.pot (French)
MTABot Apr 7, 2023
8a31b57
New translations client.pot (Spanish)
MTABot Apr 7, 2023
71df221
New translations client.pot (Bulgarian)
MTABot Apr 7, 2023
4bda7ba
New translations client.pot (Czech)
MTABot Apr 7, 2023
8a44101
New translations client.pot (Danish)
MTABot Apr 7, 2023
3aa542f
New translations client.pot (German)
MTABot Apr 7, 2023
3ba3d10
New translations client.pot (Greek)
MTABot Apr 7, 2023
5711fc7
New translations client.pot (Finnish)
MTABot Apr 7, 2023
518754c
New translations client.pot (Hebrew)
MTABot Apr 7, 2023
ce218e7
New translations client.pot (Hungarian)
MTABot Apr 7, 2023
ff855eb
New translations client.pot (Italian)
MTABot Apr 7, 2023
f757d82
New translations client.pot (Japanese)
MTABot Apr 7, 2023
0d44844
New translations client.pot (Georgian)
MTABot Apr 7, 2023
b3d9cb8
New translations client.pot (Korean)
MTABot Apr 7, 2023
70a333f
New translations client.pot (Lithuanian)
MTABot Apr 7, 2023
ceae89b
New translations client.pot (Macedonian)
MTABot Apr 7, 2023
6ef8d8c
New translations client.pot (Dutch)
MTABot Apr 7, 2023
e0df42c
New translations client.pot (Polish)
MTABot Apr 7, 2023
cc9c826
New translations client.pot (Portuguese)
MTABot Apr 7, 2023
5468386
New translations client.pot (Russian)
MTABot Apr 7, 2023
b06c58f
New translations client.pot (Slovak)
MTABot Apr 7, 2023
8d1676d
New translations client.pot (Slovenian)
MTABot Apr 7, 2023
145c9c6
New translations client.pot (Swedish)
MTABot Apr 7, 2023
365e866
New translations client.pot (Turkish)
MTABot Apr 7, 2023
1903dd3
New translations client.pot (Ukrainian)
MTABot Apr 7, 2023
e9c730a
New translations client.pot (Chinese Simplified)
MTABot Apr 7, 2023
377c04a
New translations client.pot (Chinese Traditional)
MTABot Apr 7, 2023
9f17888
New translations client.pot (Vietnamese)
MTABot Apr 7, 2023
0df8bf0
New translations client.pot (Portuguese, Brazilian)
MTABot Apr 7, 2023
0c47526
New translations client.pot (Indonesian)
MTABot Apr 7, 2023
ea196e5
New translations client.pot (Persian)
MTABot Apr 7, 2023
47d59d8
New translations client.pot (Croatian)
MTABot Apr 7, 2023
d9b00a5
New translations client.pot (Estonian)
MTABot Apr 7, 2023
6a4bec5
New translations client.pot (Latvian)
MTABot Apr 7, 2023
f4d3a59
New translations client.pot (Azerbaijani)
MTABot Apr 7, 2023
7d51a47
New translations client.pot (Hindi)
MTABot Apr 7, 2023
07b7a41
New translations client.pot (Filipino)
MTABot Apr 7, 2023
4406a7f
New translations client.pot (Bosnian)
MTABot Apr 7, 2023
7bdfdaa
New translations client.pot (Norwegian Bokmal)
MTABot Apr 7, 2023
e8f834f
New translations client.pot (Serbian)
MTABot Apr 7, 2023
66377ca
Merge branch 'master' into l10n/master
botder Apr 7, 2023
1d549c3
New translations client.pot (Arabic)
MTABot Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 17 additions & 3 deletions Client/core/CLocalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ SString CLocalization::ValidateLocale(SString strLocale)
{
if (strLocale.empty() && (CClientVariables::GetSingletonPtr() == nullptr || !CVARS_GET("locale", strLocale)))
strLocale = "en_US";

// NOTE(patrik): Convert old two letter language to locale to fix any issues with flags
if (strLocale == "en")
strLocale = "en_US";
else if (strLocale == "fi")
strLocale = "fi_FI";
else if (strLocale == "az")
strLocale = "az_AZ";
else if (strLocale == "ka")
strLocale = "ka_GE";

Language Lang = Language::from_name(strLocale);
Lang = Lang ? Lang : Language::from_name("en_US");
return Lang.str();
Expand Down Expand Up @@ -128,7 +139,9 @@ std::vector<SString> CLocalization::GetAvailableLocales()
{
std::vector<SString> localeList = {"en_US"};
for (const auto& language : m_DictManager.get_languages(MTA_LOCALE_TEXTDOMAIN))
localeList.push_back(language.str());
// To avoid duplicates
if (std::find(localeList.begin(), localeList.end(), language.str()) == localeList.end())
localeList.push_back(language.str());
// Alpha sort
std::sort(localeList.begin(), localeList.end());
return localeList;
Expand All @@ -153,9 +166,10 @@ SString CLocalization::GetLanguageName()
}

// Get the file directory of the current language
SString CLocalization::GetLanguageDirectory()
SString CLocalization::GetLanguageDirectory(CLanguage* pLanguage)
{
SString strFullPath = m_pCurrentLang->GetDictionary().get_filepath();
CLanguage* pSelectLang = pLanguage != nullptr ? pLanguage : m_pCurrentLang;
SString strFullPath = pSelectLang->GetDictionary().get_filepath();

// Replace all backslashes with forward slashes
int idx = 0;
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CLocalization.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CLocalization : public CLocalizationInterface
SString GetTranslators();
std::vector<SString> GetAvailableLocales();
bool IsLocalized();
SString GetLanguageDirectory();
SString GetLanguageDirectory(CLanguage* pLanguage = nullptr);
SString GetLanguageCode();
SString GetLanguageName();
SString ValidateLocale(SString strLocale);
Expand Down
33 changes: 19 additions & 14 deletions Client/core/CMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#define CORE_MTA_LOGO "cgui\\images\\background_logo.png"
#define CORE_MTA_FILLER "cgui\\images\\mta_filler.png"
#define CORE_MTA_VERSION "cgui\\images\\version.png"
#define CORE_MTA_LATEST_NEWS "cgui\\images\\latest_news.png"

static int WaitForMenu = 0;
static const SColor headlineColors[] = {SColorRGBA(233, 234, 106, 255), SColorRGBA(233 / 6 * 4, 234 / 6 * 4, 106 / 6 * 4, 255),
Expand Down Expand Up @@ -209,21 +208,28 @@ CMainMenu::CMainMenu(CGUI* pManager)
m_pMenuArea->SetMouseEnterHandler(GUI_CALLBACK(&CMainMenu::OnMenuEnter, this));
m_pMenuArea->SetMouseLeaveHandler(GUI_CALLBACK(&CMainMenu::OnMenuExit, this));

float fDrawSizeX = (335 / NATIVE_RES_X) * m_iMenuSizeX; // Right aligned
float fDrawSizeY = (53 / NATIVE_RES_Y) * m_iMenuSizeY;
float fDrawPosX = 0.83f * m_iMenuSizeX - fDrawSizeX;
float fDrawPosY = 0.60f * m_iMenuSizeY;
m_pLatestNews = reinterpret_cast<CGUIStaticImage*>(pManager->CreateStaticImage());
m_pLatestNews->LoadFromFile(CORE_MTA_LATEST_NEWS);
if (!m_pLatestNews->LoadFromFile(PathJoin(g_pCore->GetLocalization()->GetLanguageDirectory(), "latest_news.png")))
{
// Load en_US if no localization is available
auto pLanguage = g_pLocalization->GetLanguage("en_US");
m_pLatestNews->LoadFromFile(PathJoin(g_pCore->GetLocalization()->GetLanguageDirectory(pLanguage), "latest_news.png"));
}
m_pLatestNews->SetParent(m_pCanvas);
m_pLatestNews->SetPosition(CVector2D(fDrawPosX, fDrawPosY), false);
m_pLatestNews->SetSize(CVector2D(fDrawSizeX, fDrawSizeY), false);
m_pLatestNews->SetProperty("InheritsAlpha", "False");
CVector2D vecNativeSize;
m_pLatestNews->GetNativeSize(vecNativeSize);
float fDrawSizeX = (vecNativeSize.fX / NATIVE_RES_X) * m_iMenuSizeX;
float fDrawSizeY = (vecNativeSize.fY / NATIVE_RES_Y) * m_iMenuSizeY;
m_pLatestNews->SetSize(CVector2D(fDrawSizeX, fDrawSizeY), false);
float fDrawPosX = 0.83f * m_iMenuSizeX - fDrawSizeX; // Right aligned
float fDrawPosY = 0.61f * m_iMenuSizeY;
m_pLatestNews->SetPosition(CVector2D(fDrawPosX, fDrawPosY), false);
m_pLatestNews->SetVisible(false);

// Create news item stuff
fDrawPosX -= 25;
fDrawPosY += fDrawSizeY - 8;
fDrawPosY += fDrawSizeY + 3;
for (uint i = 0; i < CORE_MTA_NEWS_ITEMS; i++)
{
fDrawPosY += 20;
Expand Down Expand Up @@ -1007,13 +1013,12 @@ sMenuItem* CMainMenu::CreateItem(unsigned char menuType, const char* szFilename,
{
CGUIStaticImage* pImage = reinterpret_cast<CGUIStaticImage*>(m_pManager->CreateStaticImage());

if (g_pCore->GetLocalization()->IsLocalized())
if (!pImage->LoadFromFile(PathJoin(g_pCore->GetLocalization()->GetLanguageDirectory(), szFilename)))
{
if (!pImage->LoadFromFile(PathJoin(g_pCore->GetLocalization()->GetLanguageDirectory(), szFilename)))
pImage->LoadFromFile(PathJoin("cgui/images", szFilename));
// Load en_US if no localization is available
auto pLanguage = g_pLocalization->GetLanguage("en_US");
pImage->LoadFromFile(PathJoin(g_pCore->GetLocalization()->GetLanguageDirectory(pLanguage), szFilename));
}
else
pImage->LoadFromFile(PathJoin("cgui/images", szFilename));

// Make our positions absolute
int iPosX = vecRelPosition.fX * m_iMenuSizeX;
Expand Down
49 changes: 24 additions & 25 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void CSettings::CreateGUI()
// Mouse Options
m_pControlsMouseLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabControls, _("Mouse options")));
m_pControlsMouseLabel->SetPosition(CVector2D(vecTemp.fX + 11, vecTemp.fY));
m_pControlsMouseLabel->AutoSize(NULL, 5.0f);
m_pControlsMouseLabel->AutoSize(NULL, 20.0f);
m_pControlsMouseLabel->SetFont("default-bold-small");
vecTemp.fY += 18;

Expand All @@ -177,7 +177,7 @@ void CSettings::CreateGUI()
m_pFlyWithMouse->AutoSize(NULL, 20.0f);

// MouseSensitivity
vecTemp.fY += 52.0f;
vecTemp.fY += 54.0f;
m_pLabelMouseSensitivity = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabControls, _("Mouse sensitivity:")));
m_pLabelMouseSensitivity->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
m_pLabelMouseSensitivity->AutoSize();
Expand All @@ -193,7 +193,7 @@ void CSettings::CreateGUI()
m_pLabelMouseSensitivityValue->SetPosition(CVector2D(vecTemp.fX + vecSize.fX + 5.0f, vecTemp.fY));
m_pLabelMouseSensitivityValue->AutoSize("100%");
vecTemp.fX = 16;
vecTemp.fY += 26.f;
vecTemp.fY += 24.f;

// VerticalAimSensitivity
m_pLabelVerticalAimSensitivity = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabControls, _("Vertical aim sensitivity:")));
Expand Down Expand Up @@ -272,12 +272,12 @@ void CSettings::CreateGUI()
m_pEditSaturation->SetTextChangedHandler(GUI_CALLBACK(&CSettings::OnJoypadTextChanged, this));

CGUILabel* pLabelDeadZone = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabControls, _("Dead Zone")));
pLabelDeadZone->SetPosition(m_pEditDeadzone->GetPosition() + CVector2D(52.f, -1.f));
pLabelDeadZone->SetPosition(m_pEditDeadzone->GetPosition() + CVector2D(52.f, 1.f));
pLabelDeadZone->AutoSize();
pLabelDeadZone->SetVerticalAlign(CGUI_ALIGN_VERTICALCENTER);

CGUILabel* pLabelSaturation = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabControls, _("Saturation")));
pLabelSaturation->SetPosition(m_pEditSaturation->GetPosition() + CVector2D(52.f, -1.f));
pLabelSaturation->SetPosition(m_pEditSaturation->GetPosition() + CVector2D(52.f, 1.f));
pLabelSaturation->AutoSize();
pLabelSaturation->SetVerticalAlign(CGUI_ALIGN_VERTICALCENTER);
vecTemp.fY += 106;
Expand Down Expand Up @@ -526,7 +526,7 @@ void CSettings::CreateGUI()
m_pAudioRadioLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAudio, _("Radio options")));
m_pAudioRadioLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f), false);
m_pAudioRadioLabel->GetPosition(vecTemp, false);
m_pAudioRadioLabel->AutoSize(NULL, 10.0f);
m_pAudioRadioLabel->AutoSize(NULL, 20.0f);
m_pAudioRadioLabel->SetFont("default-bold-small");

m_pCheckBoxAudioEqualizer = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabAudio, _("Radio Equalizer"), true));
Expand All @@ -542,7 +542,7 @@ void CSettings::CreateGUI()
m_pAudioUsertrackLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAudio, _("Usertrack options")));
m_pAudioUsertrackLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f), false);
m_pAudioUsertrackLabel->GetPosition(vecTemp, false);
m_pAudioUsertrackLabel->AutoSize(NULL, 10.0f);
m_pAudioUsertrackLabel->AutoSize(NULL, 20.0f);
m_pAudioUsertrackLabel->SetFont("default-bold-small");

m_pLabelUserTrackMode = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAudio, _("Play mode:")));
Expand All @@ -568,7 +568,7 @@ void CSettings::CreateGUI()
m_pAudioMuteLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAudio, _("Mute options")));
m_pAudioMuteLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 52.0f));
m_pAudioMuteLabel->GetPosition(vecTemp, false);
m_pAudioMuteLabel->AutoSize(NULL, 5.0f);
m_pAudioMuteLabel->AutoSize(NULL, 20.0f);
m_pAudioMuteLabel->SetFont("default-bold-small");

m_pCheckBoxMuteMaster = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabAudio, _("Mute All sounds when minimized"), true));
Expand Down Expand Up @@ -903,16 +903,16 @@ void CSettings::CreateGUI()
m_pLabelBrowserCustomBlacklist = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(m_pTabBrowser, _("Custom blacklist")));
m_pLabelBrowserCustomBlacklist->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f));
m_pLabelBrowserCustomBlacklist->GetPosition(vecTemp);
m_pLabelBrowserCustomBlacklist->AutoSize(NULL, 5.0f);
m_pLabelBrowserCustomBlacklist->AutoSize(NULL, 20.0f);
m_pLabelBrowserCustomBlacklist->SetFont("default-bold-small");

m_pEditBrowserBlacklistAdd = reinterpret_cast<CGUIEdit*>(pManager->CreateEdit(m_pTabBrowser));
m_pEditBrowserBlacklistAdd->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 25.0f));
m_pEditBrowserBlacklistAdd->GetPosition(vecTemp);
m_pEditBrowserBlacklistAdd->SetSize(CVector2D(191.0f, 22.0f));
m_pEditBrowserBlacklistAdd->SetSize(CVector2D(209.0f, 22.0f));

m_pLabelBrowserBlacklistAdd = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(m_pEditBrowserBlacklistAdd, _("Enter a domain e.g. google.com")));
m_pLabelBrowserBlacklistAdd->SetPosition(CVector2D(10, 3), false);
m_pLabelBrowserBlacklistAdd->SetPosition(CVector2D(10.0f, 3.0f), false);
m_pLabelBrowserBlacklistAdd->SetTextColor(0, 0, 0);
m_pLabelBrowserBlacklistAdd->SetSize(CVector2D(1, 1), true);
m_pLabelBrowserBlacklistAdd->SetAlpha(0.7f);
Expand All @@ -921,12 +921,12 @@ void CSettings::CreateGUI()

m_pButtonBrowserBlacklistAdd = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Block")));
m_pButtonBrowserBlacklistAdd->SetPosition(CVector2D(vecTemp.fX + m_pEditBrowserBlacklistAdd->GetSize().fX + 2.0f, vecTemp.fY));
m_pButtonBrowserBlacklistAdd->SetSize(CVector2D(64.0f, 22.0f));
m_pButtonBrowserBlacklistAdd->SetSize(CVector2D(90.0f, 22.0f));

m_pGridBrowserBlacklist = reinterpret_cast<CGUIGridList*>(pManager->CreateGridList(m_pTabBrowser));
m_pGridBrowserBlacklist->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 32.0f));
m_pGridBrowserBlacklist->GetPosition(vecTemp);
m_pGridBrowserBlacklist->SetSize(CVector2D(256.0f, 150.0f));
m_pGridBrowserBlacklist->SetSize(CVector2D(300.0f, 150.0f));
m_pGridBrowserBlacklist->AddColumn(_("Domain"), 0.9f);

m_pButtonBrowserBlacklistRemove = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove domain")));
Expand All @@ -936,18 +936,18 @@ void CSettings::CreateGUI()
m_pLabelBrowserCustomBlacklist->GetPosition(vecTemp); // Reset vecTemp

m_pLabelBrowserCustomWhitelist = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(m_pTabBrowser, _("Custom whitelist")));
m_pLabelBrowserCustomWhitelist->SetPosition(CVector2D(292.0f, vecTemp.fY));
m_pLabelBrowserCustomWhitelist->SetPosition(CVector2D(vecTemp.fX + 300.0f + 19.0f, vecTemp.fY));
m_pLabelBrowserCustomWhitelist->GetPosition(vecTemp);
m_pLabelBrowserCustomWhitelist->AutoSize(NULL, 5.0f);
m_pLabelBrowserCustomWhitelist->AutoSize(NULL, 20.0f);
m_pLabelBrowserCustomWhitelist->SetFont("default-bold-small");

m_pEditBrowserWhitelistAdd = reinterpret_cast<CGUIEdit*>(pManager->CreateEdit(m_pTabBrowser));
m_pEditBrowserWhitelistAdd->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 25.0f));
m_pEditBrowserWhitelistAdd->GetPosition(vecTemp);
m_pEditBrowserWhitelistAdd->SetSize(CVector2D(191.0f, 22.0f));
m_pEditBrowserWhitelistAdd->SetSize(CVector2D(209.0f, 22.0f));

m_pLabelBrowserWhitelistAdd = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(m_pEditBrowserWhitelistAdd, _("Enter a domain e.g. google.com")));
m_pLabelBrowserWhitelistAdd->SetPosition(CVector2D(10, 3), false);
m_pLabelBrowserWhitelistAdd->SetPosition(CVector2D(10.0f, 3.0f), false);
m_pLabelBrowserWhitelistAdd->SetTextColor(0, 0, 0);
m_pLabelBrowserWhitelistAdd->SetSize(CVector2D(1, 1), true);
m_pLabelBrowserWhitelistAdd->SetAlpha(0.7f);
Expand All @@ -956,12 +956,12 @@ void CSettings::CreateGUI()

m_pButtonBrowserWhitelistAdd = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Allow")));
m_pButtonBrowserWhitelistAdd->SetPosition(CVector2D(vecTemp.fX + m_pEditBrowserWhitelistAdd->GetSize().fX + 2.0f, vecTemp.fY));
m_pButtonBrowserWhitelistAdd->SetSize(CVector2D(64.0f, 22.0f));
m_pButtonBrowserWhitelistAdd->SetSize(CVector2D(90.0f, 22.0f));

m_pGridBrowserWhitelist = reinterpret_cast<CGUIGridList*>(pManager->CreateGridList(m_pTabBrowser));
m_pGridBrowserWhitelist->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 32.0f));
m_pGridBrowserWhitelist->GetPosition(vecTemp);
m_pGridBrowserWhitelist->SetSize(CVector2D(256.0f, 150.0f));
m_pGridBrowserWhitelist->SetSize(CVector2D(300.0f, 150.0f));
m_pGridBrowserWhitelist->AddColumn(_("Domain"), 0.9f);

m_pButtonBrowserWhitelistRemove = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove domain")));
Expand Down Expand Up @@ -1124,18 +1124,17 @@ void CSettings::CreateGUI()
m_pWin8Label = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Windows 8 compatibility:")));
m_pWin8Label->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
m_pWin8Label->AutoSize();
vecTemp.fX += 20;

m_pWin8ColorCheckBox = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabAdvanced, _("16-bit color")));
m_pWin8ColorCheckBox->SetPosition(CVector2D(vecTemp.fX + fIndentX, vecTemp.fY - 1.0f));
m_pWin8ColorCheckBox->SetPosition(CVector2D(vecTemp.fX + fIndentX, vecTemp.fY));
m_pWin8ColorCheckBox->AutoSize(NULL, 20.0f);
vecTemp.fX += 90;
vecTemp.fX += 140;

m_pWin8MouseCheckBox = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabAdvanced, _("Mouse fix")));
m_pWin8MouseCheckBox->SetPosition(CVector2D(vecTemp.fX + fIndentX, vecTemp.fY - 1.0f));
m_pWin8MouseCheckBox->SetPosition(CVector2D(vecTemp.fX + fIndentX, vecTemp.fY));
m_pWin8MouseCheckBox->AutoSize(NULL, 20.0f);
vecTemp.fY += fLineHeight;
vecTemp.fX -= 110;
vecTemp.fX -= 140;

// Hide if not Win8
if (atoi(GetApplicationSetting("real-os-version")) != 8)
Expand Down Expand Up @@ -2318,7 +2317,7 @@ void CSettings::CreateInterfaceTabGUI()
pLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabOptions, _("Options")));
pLabel->SetPosition(CVector2D(fMarginX, 10.0f));
pLabel->GetPosition(vecTemp);
pLabel->AutoSize(NULL, 5.0f);
pLabel->AutoSize(NULL, 20.0f);
pLabel->SetFont("default-bold-small");

m_pChatCssBackground = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabOptions, _("Hide background when not typing")));
Expand Down
2 changes: 1 addition & 1 deletion Client/loader/MainFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CLocalizationDummy : public CLocalizationInterface

virtual std::vector<SString> GetAvailableLocales() { return std::vector<SString>(); }
virtual bool IsLocalized() { return false; }
virtual SString GetLanguageDirectory() { return ""; }
virtual SString GetLanguageDirectory(CLanguage* pLanguage = nullptr) { return ""; }
virtual SString GetLanguageCode() { return "en_US"; }
virtual SString GetLanguageName() { return "English"; }
};
Expand Down
4 changes: 3 additions & 1 deletion Client/sdk/core/CLocalizationInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#define _tcn g_pLocalization->TranslatePluralWithContext
#define _td // Dummy translation tag for compile-time use only. Translation templates are generated by this, but no source code interaction

class CLanguage;

class CLocalizationInterface
{
public:
Expand All @@ -31,7 +33,7 @@ class CLocalizationInterface

virtual std::vector<SString> GetAvailableLocales() = 0;
virtual bool IsLocalized() = 0;
virtual SString GetLanguageDirectory() = 0;
virtual SString GetLanguageDirectory(CLanguage* pLanguage = nullptr) = 0;
virtual SString GetLanguageCode() = 0;
virtual SString GetLanguageName() = 0;
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading