Author: ashaposhnikov
Date: Thu Jul 13 22:01:02 2017
New Revision: 75334
URL:
http://svn.reactos.org/svn/reactos?rev=75334&view=rev
Log:
[RAPPS] Showing info from Languages sectin
- Created dummies & added new string resources
- lang/uk-UA.rc: translated all strings
- crichedit.h: safe text add
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc
branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc
branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1]
Thu Jul 13 22:01:02 2017
@@ -111,6 +111,16 @@
//TODO: make the actual check
return TRUE;
}
+BOOL
+HasEnglishLanguage(PAPPLICATION_INFO Info)
+{
+ if (!Info)
+ {
+ return FALSE;
+ }
+ //TODO: make the actual check
+ return TRUE;
+}
LICENSE_TYPE
ParserGetLicenseType(const ATL::CStringW& szFileName)
@@ -145,12 +155,15 @@
InsertTextAfterLoaded_RichEdit(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0);
}
else
+ {
InsertLoadedTextNewl_RichEdit(IDS_STATUS_INSTALLED, CFE_ITALIC);
-
+ }
}
else
+ {
InsertLoadedTextNewl_RichEdit(IDS_STATUS_NOTINSTALLED, CFE_ITALIC);
-
+ }
+
InsertTextAfterLoaded_RichEdit(IDS_AINFO_AVAILABLEVERSION, Info->szVersion,
CFE_BOLD, 0);
}
@@ -185,6 +198,38 @@
}
+VOID
+InsertLanguageInfo_RichEdit(PAPPLICATION_INFO Info)
+{
+ const INT nTranslations = Info->Languages.GetSize();
+ ATL::CStringW szLangInfo;
+ ATL::CStringW szLoadedTextAvailability;
+ ATL::CStringW szLoadedAInfoText;
+ szLoadedAInfoText.LoadStringW(IDS_AINFO_LANGUAGES);
+
+ if(HasNativeLanguage(Info))
+ {
+ szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_AVAILABLE_TRANSLATION);
+ }
+ else if (HasEnglishLanguage(Info))
+ {
+ szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_ENGLISH_TRANSLATION);
+ }
+ else
+ {
+ szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_NO_TRANSLATION);
+ }
+
+ if (nTranslations > 1)
+ {
+ szLangInfo.Format(L" (+%d more)", nTranslations - 1);
+ }
+
+ InsertRichEditText(szLoadedAInfoText, CFE_BOLD);
+ InsertRichEditText(szLoadedTextAvailability, NULL);
+ InsertRichEditText(szLangInfo, CFE_ITALIC);
+}
+
BOOL
ShowAvailableAppInfo(INT Index)
{
@@ -194,6 +239,7 @@
NewRichEditText(Info->szName, CFE_BOLD);
InsertVersionInfo_RichEdit(Info);
InsertLicenseInfo_RichEdit(Info);
+ InsertLanguageInfo_RichEdit(Info);
InsertTextAfterLoaded_RichEdit(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0);
InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD,
CFE_LINK);
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h [iso-8859-1] Thu
Jul 13 22:01:02 2017
@@ -9,14 +9,17 @@
SETTEXTEX SetText;
LONG Len = GetTextLen();
- /* Insert new text */
- SetText.flags = ST_SELECTION;
- SetText.codepage = 1200;
+ if (InsertedTextLen)
+ {
+ /* Insert new text */
+ SetText.flags = ST_SELECTION;
+ SetText.codepage = 1200;
- SendMessageW(EM_SETTEXTEX, (WPARAM) &SetText, (LPARAM) lpszText);
+ SendMessageW(EM_SETTEXTEX, (WPARAM) &SetText, (LPARAM) lpszText);
- SetRangeFormatting(Len, Len + InsertedTextLen,
- (dwEffects == CFM_LINK) ? (PathIsURLW(lpszText) ? dwEffects : 0) :
dwEffects);
+ SetRangeFormatting(Len, Len + InsertedTextLen,
+ (dwEffects == CFM_LINK) ? (PathIsURLW(lpszText) ? dwEffects : 0) :
dwEffects);
+ }
}
public:
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1]
Thu Jul 13 22:01:02 2017
@@ -158,6 +158,7 @@
IDS_AINFO_URLSITE "\nHome Page: "
IDS_AINFO_LICENSE "\nLicense: "
IDS_AINFO_URLDOWNLOAD "\nDownload: "
+ IDS_AINFO_LANGUAGES "\nLanguages: "
END
STRINGTABLE
@@ -224,3 +225,11 @@
IDS_LICENSE_FREEWARE "Freeware"
IDS_LICENSE_TRIAL "Trial/Demo"
END
+
+STRINGTABLE
+BEGIN
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "In your language"
+ IDS_LANGUAGE_NO_TRANSLATION "In your language"
+ IDS_LANGUAGE_NOT_AVAILABLE "No translations"
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "In English"
+END
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1]
Thu Jul 13 22:01:02 2017
@@ -26,7 +26,7 @@
MENUITEM SEPARATOR
MENUITEM "&ÐновиÑи\tF5", ID_REFRESH
MENUITEM SEPARATOR
- MENUITEM "Update Da&tabase\tCtrl+F5", ID_RESETDB
+ MENUITEM "ÐновиÑи ÑпиÑок &пÑогÑам\tCtrl+F5",
ID_RESETDB
END
POPUP "&ÐовÑдка"
BEGIN
@@ -56,7 +56,7 @@
MENUITEM SEPARATOR
MENUITEM "&ÐновиÑи\tF5", ID_REFRESH
MENUITEM SEPARATOR
- MENUITEM "Update Da&tabase\tCtrl+F5", ID_RESETDB
+ MENUITEM "ÐновиÑи ÑпиÑок &пÑогÑам\tCtrl+F5",
ID_RESETDB
END
END
@@ -79,7 +79,7 @@
CONTROL "Direct (No proxy)", IDC_NO_PROXY, "Button",
BS_AUTORADIOBUTTON | WS_TABSTOP, 15, 145, 210, 10
CONTROL "Proxy", IDC_USE_PROXY, "Button", BS_AUTORADIOBUTTON |
WS_TABSTOP, 15, 160, 74, 10
EDITTEXT IDC_PROXY_SERVER, 90, 160, 147, 12, ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "No proxy for", -1, 27, 175, 64, 10
+ LTEXT "ÐиклÑÑеннÑ", -1, 27, 175, 64, 10
EDITTEXT IDC_NO_PROXY_FOR, 90, 175, 147, 12, ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "СÑандаÑÑно", IDC_DEFAULT_SETTINGS, 8, 195, 60, 14
PUSHBUTTON "OK", IDOK, 116, 195, 60, 14
@@ -125,7 +125,7 @@
IDS_TOOLTIP_MODIFY "ÐмÑниÑи"
IDS_TOOLTIP_SETTINGS "ÐалаÑÑÑваннÑ"
IDS_TOOLTIP_REFRESH "ÐновиÑи"
- IDS_TOOLTIP_UPDATE_DB "Update Database"
+ IDS_TOOLTIP_UPDATE_DB "ÐновиÑи ÑпиÑок пÑогÑам"
IDS_TOOLTIP_EXIT "ÐиÑ
Ñд"
END
@@ -206,14 +206,14 @@
IDS_CHOOSE_FOLDER_ERROR "Ðи вказали неÑÑнÑÑÑÑ ÑекÑ!"
IDS_APP_REG_REMOVE "Ðи дÑйÑно Ñ
оÑеÑе видалиÑи Ð´Ð°Ð½Ñ Ð¿Ñо вÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ñ Ð¿ÑогÑÐ°Ð¼Ñ Ð·
ÑеÑÑÑÑÑ?"
IDS_INFORMATION "ÐнÑоÑмаÑÑÑ"
- IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
- IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet
Connection!"
+ IDS_UNABLE_TO_DOWNLOAD "Ðеможливо заванÑажиÑи
додаÑок! ÐдÑеÑÑ Ð½Ðµ знайдено!"
+ IDS_UNABLE_TO_DOWNLOAD2 "Ðеможливо заванÑажиÑи
додаÑок! ÐеÑевÑÑÑе пÑдклÑÑÐµÐ½Ð½Ñ Ð´Ð¾ меÑежÑ
ÐнÑеÑнеÑ!"
IDS_UNABLE_TO_REMOVE "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñи Ð´Ð°Ð½Ñ Ð¿Ñо
пÑогÑÐ°Ð¼Ñ Ð· ÑеÑÑÑÑÑ!"
- IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed."
- IDS_INTEG_CHECK_TITLE "Verifying package integrity..."
- IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have
been corrupted or tampered with during downloading. Running the software is not
recommended."
- IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to
Internet."
- IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity."
+ IDS_CERT_DOES_NOT_MATCH "Ðомилка пеÑевÑки ÑеÑÑиÑÑкаÑÑ
SSL."
+ IDS_INTEG_CHECK_TITLE "ÐеÑевÑÑка ÑÑлÑÑÑноÑÑÑ
додаÑкÑ..."
+ IDS_INTEG_CHECK_FAIL "ÐодаÑок не пÑойÑов пеÑевÑÑкÑ
ÑÑлÑÑÑноÑÑÑ, його молги поÑкодиÑи Ñи замÑниÑи.
ÐапÑÑк додаÑÐºÑ Ð½Ðµ ÑекомендÑÑÑÑÑÑ."
+ IDS_INTERRUPTED_DOWNLOAD "ÐаванÑÐ°Ð¶ÐµÐ½Ð½Ñ Ð¿ÐµÑеÑвано.
ÐеÑевÑÑÑе пÑдклÑÑÐµÐ½Ð½Ñ Ð´Ð¾ меÑÐµÐ¶Ñ ÐнÑеÑнеÑ."
+ IDS_UNABLE_TO_WRITE "ÐапиÑк на диÑк неможливий.
Ðожливо, на диÑÐºÑ Ð½ÐµÐ´Ð¾ÑÑаÑнÑо мÑÑÑÑÑ."
END
STRINGTABLE
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h [iso-8859-1] Thu
Jul 13 22:01:02 2017
@@ -145,6 +145,7 @@
#define IDS_AINFO_LICENSE 354
#define IDS_AINFO_URLDOWNLOAD 355
#define IDS_AINFO_AVAILABLEVERSION 356
+#define IDS_AINFO_LANGUAGES 357
/* Names of categories */
@@ -177,6 +178,12 @@
#define IDS_LICENSE_FREEWARE 901
#define IDS_LICENSE_TRIAL 902
+/* Language related strings */
+#define IDS_LANGUAGE_AVAILABLE_TRANSLATION 910
+#define IDS_LANGUAGE_NO_TRANSLATION 911
+#define IDS_LANGUAGE_NOT_AVAILABLE 912
+#define IDS_LANGUAGE_ENGLISH_TRANSLATION 913
+
/* Accelerators */
#define HOTKEYS 715