[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu
Subject:    Re: [kde-edu]: Fwd: Month names in libkdeedu
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2006-07-22 19:11:12
Message-ID: 200607222111.13027.aacid () kde ! org
[Download RAW message or body]

A Dissabte 22 Juliol 2006 16:20, Jason Harris va escriure:
> That's my fault...they're in my ExtDate class.  I need to modify that
> class to use the new KDateTime classes anyway, so I'll take care of this
> at that time.  It's just a matter of using I18N_NOOP() instead of
> i18n(), isn't that right?

No,  I18N_NOOP() still marks the strings for extraction.

AFAIK what you need is this. Agree to commit?

Albert

>
> Jason
>
> Carsten Niehaus wrote:
> > ----------  Weitergeleitete Nachricht  ----------
> >
> > Subject: Month names in libkdeedu
> > Date: Samstag 22 Juli 2006 15:18
> > From: Krzysztof Lichota <krzysiek@lichota.net>
> > To: KDE i18n-doc <kde-i18n-doc@kde.org>
> >
> > I have noticed that in libkdeedu.po appeared 38 strings with names of
> > months, days of week, etc.
> > I am wondering, what are they for as there are already such strings in
> > kdelibs.po, so they should be used. Having them in 2 places is not a
> > good idea.
> >
> > Anyone knows something about this?
> >
> > 	Krzysztof Lichota
> >
> > -------------------------------------------------------
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > kde-edu mailing list
> > kde-edu@mail.kde.org
> > https://mail.kde.org/mailman/listinfo/kde-edu
>
> _______________________________________________
> kde-edu mailing list
> kde-edu@mail.kde.org
> https://mail.kde.org/mailman/listinfo/kde-edu

["i18nless" (text/x-diff)]

Index: extdatetime.cpp
===================================================================
--- extdatetime.cpp	(revision 565226)
+++ extdatetime.cpp	(working copy)
@@ -45,34 +45,10 @@
 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("Short month name", "Jan"), i18n("Short month name", "Feb"), 
-	i18n("Short month name", "Mar"), i18n("Short month name", "Apr"), 
-	i18n("Short month name", "May"), i18n("Short month name", "Jun"),
-	i18n("Short month name", "Jul"), i18n("Short month name", "Aug"), 
-	i18n("Short month name", "Sep"), i18n("Short month name", "Oct"), 
-	i18n("Short month name", "Nov"), i18n("Short month name", "Dec")
-};
-QString ExtDate::m_shortDayNames[7] = {
-	i18n("Short day name", "Mon"), i18n("Short day name", "Tue"), 
-	i18n("Short day name", "Wed"), i18n("Short day name", "Thu"), 
-	i18n("Short day name", "Fri"), i18n("Short day name", "Sat"), 
-	i18n("Short day name", "Sun")
-};
-QString ExtDate::m_longMonthNames[12] = {
-	i18n("Long month name", "January"), i18n("Long month name", "February"), 
-	i18n("Long month name", "March"), i18n("Long month name", "April"), 
-	i18n("Long month name", "May"), i18n("Long month name", "June"), 
-	i18n("Long month name", "July"), i18n("Long month name", "August"), 
-	i18n("Long month name", "September"), i18n("Long month name", "October"),
-	i18n("Long month name", "November"), i18n("Long month name", "December")
-};
-QString ExtDate::m_longDayNames[7] = {
-	i18n("Long day name", "Monday"), i18n("Long day name", "Tuesday"), 
-	i18n("Long day name", "Wednesday"), i18n("Long day name", "Thursday"),
-	i18n("Long day name", "Friday"), i18n("Long day name", "Saturday"), 
-	i18n("Long day name", "Sunday")
-};
+QStringList ExtDate::m_shortMonthNames;
+QStringList ExtDate::m_shortDayNames;
+QStringList ExtDate::m_longMonthNames;
+QStringList ExtDate::m_longDayNames;
 
 ExtDate::ExtDate( int y, int m, int d)
 {
@@ -200,10 +176,72 @@
 }
 
 #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];}
+QString ExtDate::shortMonthName( int month )
+{
+	if (m_shortMonthNames.isEmpty())
+	{
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("January", "Jan") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("February", "Feb") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("March", "Mar") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("April", "Apr") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("May short", "May") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("June", "Jun") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("July", "Jul") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("August", "Aug") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("September", "Sep") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("October", "Oct") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("November", "Nov") );
+		m_shortMonthNames.push_back( KGlobal::locale()->translate("December", "Dec") );
+	}
+	return m_shortMonthNames[month-1];
+}
+QString ExtDate::shortDayName( int weekday )
+{
+	if (m_shortDayNames.isEmpty())
+	{
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Monday", "Mon") );
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Tuesday", "Tue") );
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Wednesday", "Wed") );
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Thursday", "Thu") );
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Friday", "Fri") );
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Saturday", "Sat") );
+		m_shortDayNames.push_back( KGlobal::locale()->translate("Sunday", "Sun") );
+	}
+	return m_shortDayNames[weekday-1];
+}
+QString ExtDate::longMonthName( int month )
+{
+	if (m_longMonthNames.isEmpty())
+	{
+		m_longMonthNames.push_back( KGlobal::locale()->translate("January") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("February") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("March") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("April") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("May long", "May") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("June") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("July") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("August") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("September") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("October") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("November") );
+		m_longMonthNames.push_back( KGlobal::locale()->translate("December") );
+	}
+	return m_longMonthNames[month-1];
+}
+QString ExtDate::longDayName( int weekday )
+{
+	if (m_longDayNames.isEmpty())
+	{
+		m_longDayNames.push_back( KGlobal::locale()->translate("Monday") );
+		m_longDayNames.push_back( KGlobal::locale()->translate("Tuesday") );
+		m_longDayNames.push_back( KGlobal::locale()->translate("Wednesday") );
+		m_longDayNames.push_back( KGlobal::locale()->translate("Thursday") );
+		m_longDayNames.push_back( KGlobal::locale()->translate("Friday") );
+		m_longDayNames.push_back( KGlobal::locale()->translate("Saturday") );
+		m_longDayNames.push_back( KGlobal::locale()->translate("Sunday") );
+	}
+	return m_longDayNames[weekday-1];
+}
 #endif //QT_NO_TEXTDATE
 
 #ifndef QT_NO_TEXTSTRING
Index: extdatetime.h
===================================================================
--- extdatetime.h	(revision 565226)
+++ extdatetime.h	(working copy)
@@ -18,6 +18,7 @@
 
 #include <limits.h>
 #include "qstring.h"
+#include "qstringlist.h"
 #include "qnamespace.h"
 #include "qdatetime.h"
 #include <kdemacros.h>
@@ -106,10 +107,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 QStringList m_shortMonthNames;
+	static QStringList m_shortDayNames;
+	static QStringList m_longMonthNames;
+	static QStringList m_longDayNames;
 
 	friend class ExtDateTime;
 


_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic