[Libreoffice-commits] core.git: l10ntools/source

Andras Timar atimar at suse.com
Thu Aug 22 04:56:18 PDT 2013


 l10ntools/source/pocheck.cxx |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

New commits:
commit bb5544622b86cd6fb98dfcb81f32f3cd6b56b97a
Author: Andras Timar <atimar at suse.com>
Date:   Thu Aug 22 13:54:53 2013 +0200

    pocheck: Math symbol names (from symbol.src) must not contain spaces
    
    Change-Id: I4195ae747229dd5f991acc8ed5764b42aeb73cf3

diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx
index a868153..423b917 100644
--- a/l10ntools/source/pocheck.cxx
+++ b/l10ntools/source/pocheck.cxx
@@ -242,6 +242,38 @@ static void checkVerticalBar(OString aLanguage)
     aPoInput.close();
 }
 
+// In starmath/source.po Math symbol names (from symbol.src)
+// must not contain spaces
+static void checkMathSymbolNames(OString aLanguage)
+{
+    OString aPoPath = OString(getenv("SRC_ROOT")) +
+                      "/translations/source/" +
+                      aLanguage +
+                      "/starmath/source.po";
+    PoIfstream aPoInput;
+    aPoInput.open(aPoPath);
+    if( !aPoInput.isOpen() )
+        std::cerr << "Warning: Cannot open " << aPoPath << std::endl;
+
+    for(;;)
+    {
+        PoEntry aPoEntry;
+        aPoInput.readEntry(aPoEntry);
+        if( aPoInput.eof() )
+            break;
+        if( !aPoEntry.isFuzzy() && aPoEntry.getGroupId() == "RID_UI_SYMBOL_NAMES" &&
+            !aPoEntry.getMsgStr().isEmpty() && (aPoEntry.getMsgStr().indexOf(" ") != -1) )
+        {
+            std::cout << "ERROR: Math symbol names must not contain spaces.\n" <<
+                "File: " << aPoPath << std::endl <<
+                "Language: " << aLanguage << std::endl <<
+                "English:   " << aPoEntry.getMsgId() << std::endl <<
+                "Localized: " << aPoEntry.getMsgStr() << std::endl << std::endl;
+        }
+    }
+    aPoInput.close();
+}
+
 int main()
 {
     OString aLanguages(getenv("ALL_LANGS"));
@@ -260,6 +292,7 @@ int main()
          checkStyleNames(aLanguage);
          checkFunctionNames(aLanguage);
          checkVerticalBar(aLanguage);
+         checkMathSymbolNames(aLanguage);
     }
     return 0;
 }


More information about the Libreoffice-commits mailing list