Author: ekohl
Date: Sat Sep 8 19:43:19 2007
New Revision: 28950
URL:
http://svn.reactos.org/svn/reactos?rev=28950&view=rev
Log:
- Update language samples upon selection of a new language.
- Add a workaround for a special case: "Spanish (Spain)" uses two sorting
methods but two sublang ids are used to distinguish them instead of two sort ids. Ensure
they don't appear twice in the language list.
- Add "Spanish (Spain)" as a translatable string resource.
Modified:
trunk/reactos/dll/cpl/intl/generalp.c
trunk/reactos/dll/cpl/intl/lang/de-DE.rc
trunk/reactos/dll/cpl/intl/lang/en-US.rc
trunk/reactos/dll/cpl/intl/lang/it-IT.rc
trunk/reactos/dll/cpl/intl/lang/ru-RU.rc
trunk/reactos/dll/cpl/intl/lang/uk-UA.rc
trunk/reactos/dll/cpl/intl/resource.h
Modified: trunk/reactos/dll/cpl/intl/generalp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/generalp.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/intl/generalp.c (original)
+++ trunk/reactos/dll/cpl/intl/generalp.c Sat Sep 8 19:43:19 2007
@@ -40,6 +40,7 @@
HWND hList;
HWND hLocaleList, hGeoList;
+BOOL bSpain = FALSE;
static BOOL CALLBACK
LocalesEnumProc(LPTSTR lpLocale)
@@ -47,12 +48,30 @@
LCID lcid;
TCHAR lang[255];
INT index;
-
- //swscanf(lpLocale, L"%lx", &lcid); // maybe use wcstoul?
+ BOOL bNoShow = FALSE;
+
lcid = _tcstoul(lpLocale, NULL, 16);
- GetLocaleInfo(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang));
-
+ if (lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) ||
+ lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN),
SORT_DEFAULT))
+ {
+ if (bSpain == FALSE)
+ {
+ LoadString(hApplet, IDS_SPAIN, lang, 255);
+ bSpain = TRUE;
+ }
+ else
+ {
+ bNoShow = TRUE;
+ }
+ }
+ else
+ {
+ GetLocaleInfo(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang));
+ }
+
+ if (bNoShow == FALSE)
+ {
index = SendMessage(hList,
CB_ADDSTRING,
0,
@@ -62,6 +81,7 @@
CB_SETITEMDATA,
index,
(LPARAM)lcid);
+ }
return TRUE;
}
@@ -110,6 +130,7 @@
TCHAR langSel[255];
hList = hwnd;
+ bSpain = FALSE;
EnumSystemLocales(LocalesEnumProc, LCID_SUPPORTED);
/* Select current locale */
@@ -322,6 +343,25 @@
case IDC_LANGUAGELIST:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
+ LCID NewLcid;
+ INT iCurSel;
+
+ iCurSel = SendMessage(hList,
+ CB_GETCURSEL,
+ 0,
+ 0);
+ if (iCurSel == CB_ERR)
+ break;
+
+ NewLcid = SendMessage(hList,
+ CB_GETITEMDATA,
+ iCurSel,
+ 0);
+ if (NewLcid == (LCID)CB_ERR)
+ break;
+
+ UpdateLocaleSample(hwndDlg, NewLcid);
+
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
}
break;
Modified: trunk/reactos/dll/cpl/intl/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/de-DE.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/de-DE.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/de-DE.rc Sat Sep 8 19:43:19 2007
@@ -175,11 +175,12 @@
STRINGTABLE
BEGIN
- IDS_CUSTOMIZE_TITLE "Regionale Einstellungen bearbeiten"
+ IDS_CUSTOMIZE_TITLE "Regionale Einstellungen bearbeiten"
+ IDS_SPAIN "Spanisch (Spanien)"
END
STRINGTABLE
BEGIN
- IDS_CPLNAME "Regionale Einstellungen"
- IDS_CPLDESCRIPTION "Wählen Sie Anzeigeeinstellungen für Sprache, Zahlen, Währung,
Uhrzeit und Datum aus."
+ IDS_CPLNAME "Regionale Einstellungen"
+ IDS_CPLDESCRIPTION "Wählen Sie Anzeigeeinstellungen für Sprache, Zahlen,
Währung, Uhrzeit und Datum aus."
END
Modified: trunk/reactos/dll/cpl/intl/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/en-US.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/en-US.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/en-US.rc Sat Sep 8 19:43:19 2007
@@ -178,11 +178,12 @@
STRINGTABLE
BEGIN
- IDS_CUSTOMIZE_TITLE "Customize Regional Options"
+ IDS_CUSTOMIZE_TITLE "Customize Regional Options"
+ IDS_SPAIN "Spanish (Spain)"
END
STRINGTABLE
BEGIN
- IDS_CPLNAME "Regional Options"
- IDS_CPLDESCRIPTION "Select languages and format numbers, currencies, times and
date."
+ IDS_CPLNAME "Regional Options"
+ IDS_CPLDESCRIPTION "Select languages and format numbers, currencies, times and
date."
END
Modified: trunk/reactos/dll/cpl/intl/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/it-IT.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/it-IT.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/it-IT.rc Sat Sep 8 19:43:19 2007
@@ -179,11 +179,12 @@
STRINGTABLE
BEGIN
- IDS_CUSTOMIZE_TITLE "Opzioni internazionali e della lingua"
+ IDS_CUSTOMIZE_TITLE "Opzioni internazionali e della lingua"
+ IDS_SPAIN "Spanish (Spain)"
END
STRINGTABLE
BEGIN
- IDS_CPLNAME "Opzioni internazionali e della lingua"
- IDS_CPLDESCRIPTION "Personalizza le impostazioni per la visualizzazione delle
lingue, numeri, ora e data."
+ IDS_CPLNAME "Opzioni internazionali e della lingua"
+ IDS_CPLDESCRIPTION "Personalizza le impostazioni per la visualizzazione delle
lingue, numeri, ora e data."
END
Modified: trunk/reactos/dll/cpl/intl/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/ru-RU.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/ru-RU.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/ru-RU.rc Sat Sep 8 19:43:19 2007
@@ -178,11 +178,12 @@
STRINGTABLE
BEGIN
- IDS_CUSTOMIZE_TITLE "Íàñòðîéêà ðåãèîíàëüíûõ ïàðàìåòðîâ"
+ IDS_CUSTOMIZE_TITLE "Íàñòðîéêà ðåãèîíàëüíûõ ïàðàìåòðîâ"
+ IDS_SPAIN "Spanish (Spain)"
END
STRINGTABLE
BEGIN
- IDS_CPLNAME "ßçûê è ðåãèîíàëüíûå ñòàíäàðòû"
- IDS_CPLDESCRIPTION "Âûáîð ÿçûêà, ôîðìàòà ÷èñåë, äåíåæíûõ åäèíèö, âðåìåíè è
äàòû."
+ IDS_CPLNAME "ßçûê è ðåãèîíàëüíûå ñòàíäàðòû"
+ IDS_CPLDESCRIPTION "Âûáîð ÿçûêà, ôîðìàòà ÷èñåë, äåíåæíûõ åäèíèö, âðåìåíè è
äàòû."
END
Modified: trunk/reactos/dll/cpl/intl/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/uk-UA.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/uk-UA.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/uk-UA.rc Sat Sep 8 19:43:19 2007
@@ -184,11 +184,12 @@
STRINGTABLE
BEGIN
- IDS_CUSTOMIZE_TITLE "Íàñòðîéêà ðåã³îíàëüíèõ ïàðàìåòð³â"
+ IDS_CUSTOMIZE_TITLE "Íàñòðîéêà ðåã³îíàëüíèõ ïàðàìåòð³â"
+ IDS_SPAIN "Spanish (Spain)"
END
STRINGTABLE
BEGIN
- IDS_CPLNAME "Ðåã³îíàëüí³ ñòàíäàðòè"
- IDS_CPLDESCRIPTION "Íàñòðîéêà ìîâíèõ ïàðàìåòð³â ³ ôîðìàòó ÷èñåë, ãðîøîâèõ îäèíèöü,
÷àñó é äàò."
+ IDS_CPLNAME "Ðåã³îíàëüí³ ñòàíäàðòè"
+ IDS_CPLDESCRIPTION "Íàñòðîéêà ìîâíèõ ïàðàìåòð³â ³ ôîðìàòó ÷èñåë, ãðîøîâèõ
îäèíèöü, ÷àñó é äàò."
END
Modified: trunk/reactos/dll/cpl/intl/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/resource.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/intl/resource.h (original)
+++ trunk/reactos/dll/cpl/intl/resource.h Sat Sep 8 19:43:19 2007
@@ -74,7 +74,7 @@
#define IDS_CPLNAME 1000
#define IDS_CPLDESCRIPTION 1001
#define IDS_CUSTOMIZE_TITLE 1002
-
+#define IDS_SPAIN 1003
#endif /* __CPL_RESOURCE_H */