summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2013-08-22 13:54:53 +0200
committerAndras Timar <atimar@suse.com>2013-08-22 13:56:11 +0200
commitbb5544622b86cd6fb98dfcb81f32f3cd6b56b97a (patch)
tree01f0a7141116b631d81ffa632c29254f6cd28a51 /l10ntools
parente830fa3f496fd4d3ff53d8d9ca5916e4023d055a (diff)
pocheck: Math symbol names (from symbol.src) must not contain spaces
Change-Id: I4195ae747229dd5f991acc8ed5764b42aeb73cf3
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/pocheck.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx
index a868153f43e7..423b917fe064 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;
}