[Kst] extragear/graphics/kst/kst/extdate

George Staikos staikos at kde.org
Tue Jan 31 05:52:45 CET 2006


SVN commit 504024 by staikos:

Patch from Dirk Mueller to fix i18n bugs


 M  +17 -16    kstextdatetime.cpp  
 M  +4 -4      kstextdatetime.h  


--- trunk/extragear/graphics/kst/kst/extdate/kstextdatetime.cpp #504023:504024
@@ -46,21 +46,21 @@
 uint ExtDate::m_monthLength[] = {31, 28, 31, 30,  31,  30,  31,  31,  30,  31,  30,  31};
 uint ExtDate::m_monthOrigin[] = { 0, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
 
-QString ExtDate::m_shortMonthNames[12] = {
-	i18n("Jan"), i18n("Feb"), i18n("Mar"), i18n("Apr"), i18n("Short form may", "May"), i18n("Jun"),
-	i18n("Jul"), i18n("Aug"), i18n("Sep"), i18n("Oct"), i18n("Nov"), i18n("Dec")
+const char* const ExtDate::m_shortMonthNames[12] = {
+	I18N_NOOP("Jan"), I18N_NOOP("Feb"), I18N_NOOP("Mar"), I18N_NOOP("Apr"), I18N_NOOP2("Short form may", "May"), I18N_NOOP("Jun"),
+	I18N_NOOP("Jul"), I18N_NOOP("Aug"), I18N_NOOP("Sep"), I18N_NOOP("Oct"), I18N_NOOP("Nov"), I18N_NOOP("Dec")
 };
-QString ExtDate::m_shortDayNames[7] = {
-	i18n("Mon"), i18n("Tue"), i18n("Wed"), i18n("Thu"), i18n("Fri"), i18n("Sat"), i18n("Sun")
+const char* const ExtDate::m_shortDayNames[7] = {
+	I18N_NOOP("Mon"), I18N_NOOP("Tue"), I18N_NOOP("Wed"), I18N_NOOP("Thu"), I18N_NOOP("Fri"), I18N_NOOP("Sat"), I18N_NOOP("Sun")
 };
-QString ExtDate::m_longMonthNames[12] = {
-	i18n("January"), i18n("February"), i18n("March"), i18n("April"), i18n("Long form may", "May"),
-	i18n("June"), i18n("July"), i18n("August"), i18n("September"), i18n("October"),
-	i18n("November"), i18n("December")
+const char* const ExtDate::m_longMonthNames[12] = {
+	I18N_NOOP("January"), I18N_NOOP("February"), I18N_NOOP("March"), I18N_NOOP("April"), I18N_NOOP2("Long form may", "May"),
+	I18N_NOOP("June"), I18N_NOOP("July"), I18N_NOOP("August"), I18N_NOOP("September"), I18N_NOOP("October"),
+	I18N_NOOP("November"), I18N_NOOP("December")
 };
-QString ExtDate::m_longDayNames[7] = {
-	i18n("Monday"), i18n("Tuesday"), i18n("Wednesday"), i18n("Thursday"),
-	i18n("Friday"), i18n("Saturday"), i18n("Sunday")
+const char* const ExtDate::m_longDayNames[7] = {
+	I18N_NOOP("Monday"), I18N_NOOP("Tuesday"), I18N_NOOP("Wednesday"), I18N_NOOP("Thursday"),
+	I18N_NOOP("Friday"), I18N_NOOP("Saturday"), I18N_NOOP("Sunday")
 };
 
 ExtDate::ExtDate( int y, int m, int d)
@@ -189,10 +189,11 @@
 }
 
 #ifndef QT_NO_TEXTDATE
-QString ExtDate::shortMonthName( int month ) {return m_shortMonthNames[month-1];}
-QString ExtDate::shortDayName( int weekday ) {return m_shortDayNames[weekday-1];}
-QString ExtDate::longMonthName( int month ) {return m_longMonthNames[month-1];}
-QString ExtDate::longDayName( int weekday ) {return m_longDayNames[weekday-1];}
+// ### to whoever wrote this code: Please read kcalendarsystem.h api documentation
+QString ExtDate::shortMonthName( int month ) {return i18n(m_shortMonthNames[month-1]);}
+QString ExtDate::shortDayName( int weekday ) {return i18n(m_shortDayNames[weekday-1]);}
+QString ExtDate::longMonthName( int month ) {return i18n(m_longMonthNames[month-1]);}
+QString ExtDate::longDayName( int weekday ) {return i18n(m_longDayNames[weekday-1]);}
 #endif //QT_NO_TEXTDATE
 
 #ifndef QT_NO_TEXTSTRING
--- trunk/extragear/graphics/kst/kst/extdate/kstextdatetime.h #504023:504024
@@ -112,10 +112,10 @@
 	int m_year, m_month, m_day;
 	static uint m_monthLength[12];
 	static uint m_monthOrigin[12];
-	static QString m_shortMonthNames[12];
-	static QString m_shortDayNames[7];
-	static QString m_longMonthNames[12];
-	static QString m_longDayNames[7];
+	static const char* const m_shortMonthNames[12];
+	static const char* const m_shortDayNames[7];
+	static const char* const m_longMonthNames[12];
+	static const char* const m_longDayNames[7];
 
 	friend class ExtDateTime;
 


More information about the Kst mailing list