L10n/chinese translation (#5)

* hotkey tips using \t .
* simplified edit menu translation (ZH_CN)
* refactored GetLanguageStringACP and implemented 'TranslateDlgItem' and 'TranslateWindowCaption' helper function .
---------

Co-authored-by: shuiping233 <49360196+shuiping233@users.noreply.github.com>
This commit is contained in:
Zero Fanker 2024-10-29 00:22:39 -04:00 committed by GitHub
parent 1672fd8901
commit f0d808a912
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 1162 additions and 533 deletions

View file

@ -437,7 +437,7 @@ const CString* getLanguageString(const CString& key)
return language.GetSection("English-Strings").TryGetString(key);
}
CString escapeString(const CString& input)
CString EscapeString(const CString& input)
{
auto updated = input;
if (updated.Find("\\n")) {
@ -492,7 +492,7 @@ void TranslateDlgItem(CWnd& cwnd, int controlID, const CString& label)
{
auto const translated = getLanguageString(label);
if (translated) {
cwnd.SetDlgItemText(controlID, escapeString(*translated));
cwnd.SetDlgItemText(controlID, EscapeString(*translated));
}
}
@ -500,7 +500,7 @@ void TranslateWindowCaption(CWnd& cwnd, const CString& label)
{
auto const translated = getLanguageString(label);
if (translated) {
cwnd.SetWindowText(escapeString(*translated));
cwnd.SetWindowText(EscapeString(*translated));
}
}