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

List:       kde-i18n-doc
Subject:    Re: [Bug 85785] New: Some strings cannot be translated
From:       Clarence Dang <dang () kde ! org>
Date:       2004-07-24 4:57:46
Message-ID: 200407241457.46489.dang () kde ! org
[Download RAW message or body]

On Fri, 23 Jul 2004 11:07 pm, CÃ ©dric Pasteur wrote:
> KolourPaint use sometimes (in particular in tools) strange way to create to
> create strings, which make those strings very hard to translate, or maybe
> impossible in some languages. 
If you tell me specifically which ones, I can provides patches very quickly.

> For example, in kptoolskew.cpp, there is "
> Skewing the %1" where %1 is "image", "selection" or "text box". This works
> good in English, but not with other languages. 
Ok, how's the attached patch (also removes strings for unreachable code 
paths)?

Thanks,
Clarence

["kolourpaint-rotate_skew-strings.diff" (text/x-diff)]

Index: tools/kptoolrotate.cpp
===================================================================
RCS file: /home/kde/kdegraphics/kolourpaint/tools/kptoolrotate.cpp,v
retrieving revision 1.17
diff -u -p -r1.17 kptoolrotate.cpp
--- tools/kptoolrotate.cpp	14 Jul 2004 13:29:00 -0000	1.17
+++ tools/kptoolrotate.cpp	24 Jul 2004 04:39:07 -0000
@@ -435,25 +445,38 @@ void kpToolRotateDialog::slotUpdate ()
 // private slot virtual [base KDialogBase]
 void kpToolRotateDialog::slotOk ()
 {
-    QString selOrImageLowerCase, selOrImageTitleCase;
+    QString message, caption, continueButtonText;
 
     if (document ()->selection ())
     {
-        if (document ()->selection ()->isText ())
-        {
-            selOrImageLowerCase = i18n ("text box");
-            selOrImageTitleCase = i18n ("Text Box");
-        }
-        else
+        if (!document ()->selection ()->isText ())
         {
-            selOrImageLowerCase = i18n ("selection");
-            selOrImageTitleCase = i18n ("Selection");
+            message =
+                i18n ("<qt><p>Rotating the selection to %1x%2"
+                      " may take a substantial amount of memory."
+                      " This can reduce system"
+                      " responsiveness and cause other application resource"
+                      " problems.</p>"
+
+                      "<p>Are you sure want to rotate the selection?</p></qt>");
+
+            caption = i18n ("Rotate Selection?");
+            continueButtonText = i18n ("Rotat&e Selection");
         }
     }
     else
     {
-        selOrImageLowerCase = i18n ("image");
-        selOrImageTitleCase = i18n ("Image");
+        message =
+            i18n ("<qt><p>Rotating the image to %1x%2"
+                  " may take a substantial amount of memory."
+                  " This can reduce system"
+                  " responsiveness and cause other application resource"
+                  " problems.</p>"
+
+                  "<p>Are you sure want to rotate the image?</p></qt>");
+
+        caption = i18n ("Rotate Image?");
+        continueButtonText = i18n ("Rotat&e Image");
     }
 
 
@@ -463,25 +486,13 @@ void kpToolRotateDialog::slotOk ()
     if (kpTool::warnIfBigImageSize (m_oldWidth,
             m_oldHeight,
             newWidth, newHeight,
-            i18n ("<qt><p>Rotating the %1 to"
-                    " %2x%3 may take a substantial amount of memory."
-                    " This can reduce system"
-                    " responsiveness and cause other application resource"
-                    " problems.</p>"
-
-                    "<p>Are you sure want to rotate the"
-                    " %4?</p></qt>")
-                .arg (selOrImageLowerCase)
-                .arg (newWidth)
-                .arg (newHeight)
-                .arg (selOrImageLowerCase),
-            i18n ("Rotate %1?").arg (selOrImageTitleCase),
-            i18n ("Rotat&e %1").arg (selOrImageTitleCase),
+            message.arg (newWidth).arg (newHeight),
+            caption,
+            continueButtonText,
             this))
     {
         KDialogBase::slotOk ();
     }
 }
 
-
 #include <kptoolrotate.moc>
Index: tools/kptoolskew.cpp
===================================================================
RCS file: /home/kde/kdegraphics/kolourpaint/tools/kptoolskew.cpp,v
retrieving revision 1.16
diff -u -p -r1.16 kptoolskew.cpp
--- tools/kptoolskew.cpp	14 Jul 2004 13:29:00 -0000	1.16
+++ tools/kptoolskew.cpp	24 Jul 2004 04:39:08 -0000
@@ -379,25 +390,38 @@ bool kpToolSkewDialog::isNoOp () const
 // private slot virtual [base KDialogBase]
 void kpToolSkewDialog::slotOk ()
 {
-    QString selOrImageLowerCase, selOrImageTitleCase;
+    QString message, caption, continueButtonText;
 
     if (document ()->selection ())
     {
-        if (document ()->selection ()->isText ())
-        {
-            selOrImageLowerCase = i18n ("text box");
-            selOrImageTitleCase = i18n ("Text Box");
-        }
-        else
+        if (!document ()->selection ()->isText ())
         {
-            selOrImageLowerCase = i18n ("selection");
-            selOrImageTitleCase = i18n ("Selection");
+            message =
+                i18n ("<qt><p>Skewing the selection to %1x%2"
+                      " may take a substantial amount of memory."
+                      " This can reduce system"
+                      " responsiveness and cause other application resource"
+                      " problems.</p>"
+
+                      "<p>Are you sure want to skew the selection?</p></qt>");
+
+            caption = i18n ("Skew Selection?");
+            continueButtonText = i18n ("Sk&ew Selection");
         }
     }
     else
     {
-        selOrImageLowerCase = i18n ("image");
-        selOrImageTitleCase = i18n ("Image");
+        message =
+            i18n ("<qt><p>Skewing the image to %1x%2"
+                  " may take a substantial amount of memory."
+                  " This can reduce system"
+                  " responsiveness and cause other application resource"
+                  " problems.</p>"
+
+                  "<p>Are you sure want to skew the image?</p></qt>");
+
+        caption = i18n ("Skew Image?");
+        continueButtonText = i18n ("Sk&ew Image");
     }
 
 
@@ -407,20 +431,9 @@ void kpToolSkewDialog::slotOk ()
     if (kpTool::warnIfBigImageSize (m_oldWidth,
             m_oldHeight,
             newWidth, newHeight,
-            i18n ("<qt><p>Skewing the %1 to"
-                    " %2x%3 may take a substantial amount of memory."
-                    " This can reduce system"
-                    " responsiveness and cause other application resource"
-                    " problems.</p>"
-
-                    "<p>Are you sure want to skew the"
-                    " %4?</p></qt>")
-                .arg (selOrImageLowerCase)
-                .arg (newWidth)
-                .arg (newHeight)
-                .arg (selOrImageLowerCase),
-            i18n ("Skew %1?").arg (selOrImageTitleCase),
-            i18n ("Sk&ew %1").arg (selOrImageTitleCase),
+            message.arg (newWidth).arg (newHeight),
+            caption,
+            continueButtonText,
             this))
     {
         KDialogBase::slotOk ();


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

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