Bug 330050 - i18n + l10n issues in kst2
Summary: i18n + l10n issues in kst2
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: i18n (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-16 22:56 UTC by Burkhard Lück
Modified: 2014-05-07 02:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Burkhard Lück 2014-01-16 22:56:27 UTC
1) Not extracted + untranslated gui strings:
1a) kst-plot(master)$ wcgrep addItem |grep -v "tr("|grep '"'|wc
69 strange strings like "DashDotDotLine"

1b) wcgrep setTypeName graphics/kst-plot/|grep -v "tr("|grep '"'|wc
14 strings used eg in caption of context menu ("Arrow Menu")

2) it is impossible to translate msgs like "P1" or "P2" properly whithout context (Point 1 / Point 2)

3) A lot of QT_TR_NOOP calls like:
3a) const QString Equation::staticTypeString = QT_TR_NOOP("Equation");
3b) const QString Equation::staticTypeTag = QT_TR_NOOP("equation");
same for image histogram, plugin etc
QT_TR_NOOP is only for msg extraction to the catalog, but does not make a string translated!
Where are the tr() calls for these const?
Where are the string from 3b) visible in the GUI? Afaik nowhere, so do not extract them

4) All Dynamic Properties in ui files are marked as translation in designer-qt, e.g. 
label bold, label italic, and many many more (~100)
Are these strings really user visible in the GUI?
I seriously doubt that!
Comment 1 Netterfield 2014-01-17 23:11:56 UTC
Git commit efecd6e10a42cb241ceab9013ea40626cfca0a30 by Barth Netterfield.
Committed on 17/01/2014 at 23:09.
Pushed by netterfield into branch 'master'.

Some fixes for translations.

Only item 2 remains - but this will require some discussion.

M  +5    -5    src/datasources/ascii/asciiconfig.ui
M  +1    -1    src/libkst/datamatrix.cpp
M  +1    -1    src/libkst/datavector.cpp
M  +1    -1    src/libkst/matrix.cpp
M  +2    -2    src/libkst/scalar.cpp
M  +1    -1    src/libkst/vscalar.cpp
M  +4    -5    src/libkstapp/aboutdialog.ui
M  +1    -1    src/libkstapp/arrowitem.cpp
M  +12   -12   src/libkstapp/axistab.cpp
M  +1    -1    src/libkstapp/boxitem.cpp
M  +1    -1    src/libkstapp/buttonitem.cpp
M  +3    -3    src/libkstapp/circledimensionstab.ui
M  +1    -1    src/libkstapp/circleitem.cpp
M  +2    -2    src/libkstapp/contenttab.ui
M  +3    -3    src/libkstapp/datawizard.cpp
M  +4    -4    src/libkstapp/dimensionstab.ui
M  +1    -1    src/libkstapp/ellipseitem.cpp
M  +4    -4    src/libkstapp/eventmonitortab.ui
M  +15   -15   src/libkstapp/filltab.cpp
M  +3    -3    src/libkstapp/filltab.ui
M  +4    -4    src/libkstapp/histogramtab.ui
M  +1    -1    src/libkstapp/imagetab.ui
M  +3    -3    src/libkstapp/labelcreator.ui
M  +3    -3    src/libkstapp/labeldimensionstab.ui
M  +1    -1    src/libkstapp/labelitem.cpp
M  +3    -3    src/libkstapp/labelpropertiestab.ui
M  +3    -3    src/libkstapp/labeltab.ui
M  +1    -1    src/libkstapp/layoutboxitem.cpp
M  +4    -4    src/libkstapp/layouttab.ui
M  +4    -4    src/libkstapp/legenditem.cpp
M  +3    -3    src/libkstapp/legendtab.ui
M  +4    -4    src/libkstapp/linedimensionstab.ui
M  +1    -1    src/libkstapp/lineedititem.cpp
M  +1    -1    src/libkstapp/lineitem.cpp
M  +1    -1    src/libkstapp/logwidget.cpp
M  +6    -6    src/libkstapp/mainwindow.cpp
M  +6    -6    src/libkstapp/markerstab.cpp
M  +4    -4    src/libkstapp/markerstab.ui
M  +16   -12   src/libkstapp/matrixtab.ui
M  +3    -3    src/libkstapp/overridelabeltab.ui
M  +1    -1    src/libkstapp/pictureitem.cpp
M  +1    -1    src/libkstapp/plotitem.cpp
M  +1    -1    src/libkstapp/plotrenderitem.cpp
M  +2    -2    src/libkstapp/scalartab.ui
M  +1    -1    src/libkstapp/sharedaxisboxitem.cpp
M  +32   -32   src/libkstapp/stroketab.cpp
M  +6    -6    src/libkstapp/stroketab.ui
M  +1    -1    src/libkstapp/svgitem.cpp
M  +3    -3    src/libkstapp/themedialog.ui
M  +3    -3    src/libkstapp/vectordialog.cpp
M  +10   -10   src/libkstapp/vectortab.ui
M  +1    -1    src/libkstmath/curve.cpp
M  +7    -14   src/libkstmath/plotdefines.h
M  +3    -3    src/plugins/dataobject/effectivebandwidth/effectivebandwidthconfig.ui
M  +1    -1    src/plugins/dataobject/shift/shift.cpp
M  +1    -1    src/plugins/filters/unwind/filterunwind.cpp
M  +3    -3    src/widgets/curveappearance.ui
M  +1    -1    src/widgets/curveplacement.ui
M  +2    -2    src/widgets/datarange.ui
M  +5    -5    src/widgets/fftoptions.ui

http://commits.kde.org/kst-plot/efecd6e10a42cb241ceab9013ea40626cfca0a30
Comment 2 Netterfield 2014-01-17 23:28:24 UTC
kst has a user-visible unique serial number for each data object.

For example, the first Power Spectrum is P1.  The fourth Scalar is X4, etc.  
(ie, P for power spectra, H for histograms, V for vectors, X for scalars, M for matrixes, etc)

We could put this prefix in tr() with a nice comment, BUT, the prefix needs to be unique between types. For example, you can't use S for both Strings and Scalars - so we use S for strings and X for scalars.

Do we need to translate these prefixes (so in some other language we might have Z for strings)? If so, how do we make sure that the prefixes stay unique?
Comment 3 Burkhard Lück 2014-01-18 14:00:18 UTC
(In reply to comment #0)
> 1a) kst-plot(master)$ wcgrep addItem |grep -v "tr("|grep '"'|wc
> 
Seems to be solved
> 
> 1b) wcgrep setTypeName graphics/kst-plot/|grep -v "tr("|grep '"'|wc

Seems to be solved

> 3) A lot of QT_TR_NOOP calls like:

Seems to be solved


> 4) All Dynamic Properties in ui files are marked as translation in
> designer-qt, e.g. 

Seems to be solved, except these two:
$ git diff src/
diff --git a/src/libkstapp/filltab.ui b/src/libkstapp/filltab.ui
index 0e562e7..db69fa8 100644
--- a/src/libkstapp/filltab.ui
+++ b/src/libkstapp/filltab.ui
@@ -89,7 +89,7 @@
         <string>&amp;Reset Gradient</string>
        </property>
        <property name="si" stdset="0">
-        <string>reset fill gradient</string>
+        <string notr="true">reset fill gradient</string>
        </property>
       </widget>
      </item>
diff --git a/src/widgets/curveappearance.ui b/src/widgets/curveappearance.ui
index 9ba811b..e7c9f25 100644
--- a/src/widgets/curveappearance.ui
+++ b/src/widgets/curveappearance.ui
@@ -193,7 +193,7 @@
          </sizepolicy>
         </property>
         <property name="si" stdset="0">
-         <string>curve color</string>
+         <string notr="true">curve color</string>
         </property>
        </widget>
       </item>
Right?
Comment 4 Netterfield 2014-01-18 21:15:39 UTC
Git commit 7beef24a0719c37a64f9071fee412da1e44eaffa by Barth Netterfield.
Committed on 18/01/2014 at 21:14.
Pushed by netterfield into branch 'master'.

Apply Burkhard Lueck's proposed patch.

M  +1    -1    src/libkstapp/filltab.ui
M  +1    -1    src/widgets/curveappearance.ui

http://commits.kde.org/kst-plot/7beef24a0719c37a64f9071fee412da1e44eaffa
Comment 5 Burkhard Lück 2014-05-04 11:49:21 UTC
Some more strings which might be user visible and therefore translated?

Please check, thanks.

./src/libkstapp/bugreportwizard.cpp:32:  _OS->setText("Mac OS 9");
./src/libkstapp/bugreportwizard.cpp:34:  _OS->setText("Mac OS X");
./src/libkstapp/bugreportwizard.cpp:36:  _OS->setText("Windows 32-Bit");
./src/libkstapp/bugreportwizard.cpp:38:  _OS->setText("Windows 64-Bit");
./src/libkstapp/bugreportwizard.cpp:40:  _OS->setText("Linux");
./src/libkstapp/lineedititem.cpp:34:  _lineEdit->setText("");
kdedev@parodia:~/svn/extragear/graphics-git/kst-plot(master)$ git diff 
diff --git a/src/datasources/ascii/asciiconfigwidget.cpp b/src/datasources/ascii/asciiconfigwidget.cpp
index 8400a20..ac5a82b 100644
--- a/src/datasources/ascii/asciiconfigwidget.cpp
+++ b/src/datasources/ascii/asciiconfigwidget.cpp
@@ -74,7 +74,7 @@ QString AsciiConfigWidgetInternal::readLine(QTextStream& in, int maxLength)
 void AsciiConfigWidgetInternal::showBeginning()
 {
   showBeginning(_showBeginning, 100);
-  _labelBeginning->setText(QString("First lines of file '%1'").arg(QFileInfo(_filename).fileName()));
+  _labelBeginning->setText(tr("First lines of file '%1'").arg(QFileInfo(_filename).fileName()));
 }
 
 
@@ -396,19 +396,19 @@ bool AsciiConfigWidget::isOkAcceptabe() const {
   QString msg;
   if (config._readFields) {
     if (config._fieldsLine == config._dataLine) {
-      msg = QString("Line %1 can not list field names AND values!").arg(config._fieldsLine + 1);
+      msg = tr("Line %1 can not list field names AND values!").arg(config._fieldsLine + 1);
     }
     if (config._readUnits) {
       if (config._unitsLine == config._dataLine) {
-        msg = QString("Line %1 can not list units AND values!").arg(config._unitsLine + 1);
+        msg = tr("Line %1 can not list units AND values!").arg(config._unitsLine + 1);
       }
       if (config._unitsLine == config._fieldsLine) {
-        msg = QString("Line %1 can not list field names AND units!").arg(config._unitsLine + 1);
+        msg = tr("Line %1 can not list field names AND units!").arg(config._unitsLine + 1);
       }
     }
   }
   if (!msg.isEmpty()) {
-    QMessageBox::critical(0, "Inconsistent parameters", msg);
+    QMessageBox::critical(0, tr("Inconsistent parameters"), msg);
     return false;
   }
   return true;
diff --git a/src/plugins/dataobject/syncbin/syncbin.cpp b/src/plugins/dataobject/syncbin/syncbin.cpp
index fdbf0bc..4cea748 100644
--- a/src/plugins/dataobject/syncbin/syncbin.cpp
+++ b/src/plugins/dataobject/syncbin/syncbin.cpp
@@ -26,7 +26,7 @@
 
 static const QString& VECTOR_IN_X = "Vector In X";
 static const QString& VECTOR_IN_Y = "Vector In Y";
-static const QString& SCALAR_IN_BINS = "Number of Bins";
+static const QString& SCALAR_IN_BINS = "Number of Bins"; //needs translation
 static const QString& SCALAR_IN_XMIN = "X Min";
 static const QString& SCALAR_IN_XMAX = "X Max";
 
@@ -215,16 +215,16 @@ bool SyncBinSource::algorithm() {
 
   //Make sure there is at least 1 element in the input vector
   if (inputVectorX->length() < 1) {
-    _errorString = "Error:  Input Vector X invalid size";
+    _errorString = "Error:  Input Vector X invalid size"; //needs translation?
     return false;
   }
   if (inputVectorX->length() != inputVectorY->length()) {
-    _errorString = "Error:  Input Vector lengths do not match";
+    _errorString = "Error:  Input Vector lengths do not match"; //needs translation?
     return false;
   }
 
   if (nbins < 2) {
-    _errorString = "Error:  Bins must be at least 2";
+    _errorString = "Error:  Bins must be at least 2"; //needs translation?
     return false;
   }
Comment 6 Netterfield 2014-05-07 01:00:35 UTC
Git commit 5b79e0bb7caa6abfc86b0d573f2b638d3408127c by Barth Netterfield.
Committed on 07/05/2014 at 00:59.
Pushed by netterfield into branch 'master'.

Fix some translation issues.
Fix all issues reported in comment 5 in the bug report.

M  +5    -5    src/datasources/ascii/asciiconfigwidget.cpp
M  +13   -5    src/libkstapp/bugreportwizard.cpp
M  +3    -0    src/libkstapp/bugreportwizard.h
M  +2    -2    src/plugins/dataobject/activitylevel/activitylevel.cpp
M  +2    -2    src/plugins/dataobject/bin/bin.cpp
M  +1    -1    src/plugins/dataobject/chop/chop.cpp
M  +2    -2    src/plugins/dataobject/convolution/convolve/convolve.cpp
M  +2    -2    src/plugins/dataobject/convolution/deconvolve/deconvolve.cpp
M  +2    -2    src/plugins/dataobject/correlation/autocorrelation/autocorrelation.cpp
M  +2    -2    src/plugins/dataobject/correlation/crosscorrelation/crosscorrelation.cpp
M  +3    -3    src/plugins/dataobject/effectivebandwidth/effectivebandwidth.cpp
M  +2    -2    src/plugins/dataobject/genericfilter/genericfilter.cpp
M  +2    -2    src/plugins/dataobject/linefit/linefit.cpp
M  +1    -1    src/plugins/dataobject/lockin/lockin.cpp
M  +1    -1    src/plugins/dataobject/noiseaddition/noiseaddition.cpp
M  +1    -1    src/plugins/dataobject/periodogram/periodogram.cpp
M  +2    -2    src/plugins/dataobject/phase/phase.cpp
M  +1    -1    src/plugins/dataobject/statistics/statistics.cpp
M  +3    -3    src/plugins/dataobject/syncbin/syncbin.cpp
M  +1    -1    src/plugins/filters/differentiation/differentiation.cpp
M  +4    -4    src/plugins/fits/kneefrequency/fitkneefrequency.cpp

http://commits.kde.org/kst-plot/5b79e0bb7caa6abfc86b0d573f2b638d3408127c
Comment 7 Burkhard Lück 2014-05-07 02:04:02 UTC
Thanks a lot, I can not find untranslated strings anymore.