Diffstat (limited to 'core/pim/datebook/repeatentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/repeatentry.cpp | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/core/pim/datebook/repeatentry.cpp b/core/pim/datebook/repeatentry.cpp index 5637c4d..b1a162d 100644 --- a/core/pim/datebook/repeatentry.cpp +++ b/core/pim/datebook/repeatentry.cpp | |||
@@ -34,17 +34,34 @@ | |||
34 | 34 | ||
35 | // Global Templates for use in setting up the repeat label... | 35 | // Global Templates for use in setting up the repeat label... |
36 | const QString strDayTemplate = QObject::tr("Every"); | 36 | // the problem is these strings get initialized before QPEApplication can install the translator -zecke |
37 | const QString strYearTemplate = QObject::tr("%1 %2 every "); | 37 | namespace { |
38 | const QString strMonthDateTemplate = QObject::tr("The %1 every "); | 38 | QString strDayTemplate; |
39 | const QString strMonthDayTemplate = QObject::tr("The %1 %1 of every"); | 39 | QString strYearTemplate; |
40 | const QString strWeekTemplate = QObject::tr("Every "); | 40 | QString strMonthDateTemplate; |
41 | const QString dayLabel[] = { QObject::tr("Monday"), | 41 | QString strMonthDayTemplate; |
42 | QObject::tr("Tuesday"), | 42 | QString strWeekTemplate; |
43 | QObject::tr("Wednesday"), | 43 | QString dayLabel[7]; |
44 | QObject::tr("Thursday"), | 44 | } |
45 | QObject::tr("Friday"), | ||
46 | QObject::tr("Saturday"), | ||
47 | QObject::tr("Sunday") }; | ||
48 | 45 | ||
46 | /* | ||
47 | * static linkage to not polute the symbol table... | ||
48 | * The problem is that const and static linkage are resolved prior to installing a translator | ||
49 | * leading to that the above strings are translted but to the original we delay the init of these strings... | ||
50 | * -zecke | ||
51 | */ | ||
52 | static void fillStrings() { | ||
53 | strDayTemplate = QObject::tr("Every"); | ||
54 | strYearTemplate = QObject::tr("%1 %2 every "); | ||
55 | strMonthDateTemplate = QObject::tr("The %1 every "); | ||
56 | strMonthDayTemplate = QObject::tr("The %1 %1 of every"); | ||
57 | strWeekTemplate = QObject::tr("Every "); | ||
58 | dayLabel[0] = QObject::tr("Monday"); | ||
59 | dayLabel[1] = QObject::tr("Tuesday"); | ||
60 | dayLabel[2] = QObject::tr("Wednesday"); | ||
61 | dayLabel[3] = QObject::tr("Thursday"); | ||
62 | dayLabel[4] = QObject::tr("Friday"); | ||
63 | dayLabel[5] = QObject::tr("Saturday"); | ||
64 | dayLabel[6] = QObject::tr("Sunday"); | ||
65 | } | ||
49 | 66 | ||
50 | static QString numberPlacing( int x );// return the proper word format for | 67 | static QString numberPlacing( int x );// return the proper word format for |
@@ -60,4 +77,7 @@ RepeatEntry::RepeatEntry( bool startOnMonday, | |||
60 | startWeekOnMonday( startOnMonday ) | 77 | startWeekOnMonday( startOnMonday ) |
61 | { | 78 | { |
79 | if (strDayTemplate.isEmpty() ) | ||
80 | fillStrings(); | ||
81 | |||
62 | init(); | 82 | init(); |
63 | fraType->setButton( currInterval ); | 83 | fraType->setButton( currInterval ); |
@@ -75,4 +95,6 @@ RepeatEntry::RepeatEntry( bool startOnMonday, const Event::RepeatPattern &rp, | |||
75 | startWeekOnMonday( startOnMonday ) | 95 | startWeekOnMonday( startOnMonday ) |
76 | { | 96 | { |
97 | if (strDayTemplate.isEmpty() ) | ||
98 | fillStrings(); | ||
77 | // do some stuff with the repeat pattern | 99 | // do some stuff with the repeat pattern |
78 | init(); | 100 | init(); |
@@ -407,5 +429,5 @@ void RepeatEntry::setupRepeatLabel( int x ) | |||
407 | strVar2 = tr( "days" ); | 429 | strVar2 = tr( "days" ); |
408 | else | 430 | else |
409 | strVar2 = tr( "day" ); | 431 | strVar2 = tr( "day" ); |
410 | break; | 432 | break; |
411 | case WEEK: | 433 | case WEEK: |
@@ -501,5 +523,5 @@ void RepeatEntry::slotWeekLabel() | |||
501 | } | 523 | } |
502 | } | 524 | } |
503 | str = str.prepend( "on " ); | 525 | str = str.prepend( tr("on ") ); |
504 | lblWeekVar->setText( str ); | 526 | lblWeekVar->setText( str ); |
505 | } | 527 | } |