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

List:       kde-commits
Subject:    kdereview/ktimechooser
From:       Michael Leupold <lemma () confuego ! org>
Date:       2009-08-25 21:50:57
Message-ID: 1251237057.047622.30045.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1015568 by mleupold:

Add context to i18n calls.

 M  +13 -12    ktimevalidator.cpp  


--- trunk/kdereview/ktimechooser/ktimevalidator.cpp #1015567:1015568
@@ -128,7 +128,7 @@
     expIntermediate = '^';
 
     bool excludeSecs = ((options & KLocale::TimeWithoutSeconds) == \
                KLocale::TimeWithoutSeconds);
-    
+
     // if seconds aren't needed, strip them from the timeFormat
     // before actually building the regular expression
     if (excludeSecs) {
@@ -184,8 +184,8 @@
 
             case 'p': // TODO: suffix "?" for every letter
             {
-                const QString am(i18n("am"));
-                const QString pm(i18n("pm"));
+                const QString am(i18nc("suffix for times if the time is ante \
meridiem", "am")); +                const QString pm(i18nc("suffix for times if the \
time is post meridiem", "pm"));  QString amExp;
                 QString pmExp;
                 Q_FOREACH(const QChar &c, am) {
@@ -246,7 +246,7 @@
 
     // expression suffixes: Ws = with seconds
     //                      In = intermediate, Ac = acceptable
-   
+
     // expressions for military times
     QRegExp m_rxMil;
     QRegExp m_rxMilWs;
@@ -350,7 +350,7 @@
     }
 
     if ((d->m_options & KLocale::TimeWithoutSeconds) != KLocale::TimeWithoutSeconds) \
                { // format with seconds
-        
+
         QValidator::State localeState = validateLocale(input, d->m_rxLocWsAc, \
d->m_rxLocWsIn);  if (localeState != QValidator::Invalid) {
             // doesn't get better than intermediate anyway
@@ -364,9 +364,9 @@
         // no need to check for format without seconds as that's always a \
subexpression  // of the format with seconds
         return QValidator::Invalid;
-        
+
     } else { // format without seconds
-        
+
         QValidator::State localeState = validateLocale(input, d->m_rxLocAc, \
d->m_rxLocIn);  if (localeState != QValidator::Invalid) {
             // doesn't get better than intermediate anyway
@@ -378,7 +378,7 @@
             return QValidator::Intermediate;
         }
         return QValidator::Invalid;
-        
+
     }
 }
 
@@ -396,7 +396,7 @@
 QTime KTimeValidator::parseTime(const QString &originput, TimeRange *range) const
 {
     QString input(originput);
-    
+
     QTime time;
     bool ok;
     bool includeSecs;
@@ -523,7 +523,8 @@
 {
     if (exp.exactMatch(input)) {
         // TODO: this assumes am and pm always have equal length
-        if (ampmpos == AmPmAtStart && i18n("am").size() >= pos) {
+        if (ampmpos == AmPmAtStart &&
+            i18nc("suffix for times if the time is ante meridiem", "am").size() >= \
pos) {  field = KTimeValidator::FieldAmPm;
         } else if (exp.pos(1) <= pos && exp.pos(1) + exp.cap(1).size() >= pos) {
             field = KTimeValidator::FieldHours;
@@ -624,7 +625,7 @@
                 break;
             case AmPmAtStart:
                 // TODO: this assumes am and pm always have equal length
-                pos = i18n("am").size();
+                pos = i18nc("suffix for times if the time is ante meridiem", \
"am").size();  break;
             case AmPmAtEnd:
                 pos = input.size();
@@ -695,7 +696,7 @@
         } else if (checkFieldOther(input, field, d->m_rxMilWs, d->m_lenMilWs, rc)) {
             return rc;
         }
-        
+
     }
 
     // if not returned, check formats without seconds


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

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