summaryrefslogtreecommitdiff
path: root/src/rules/po.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rules/po.cpp')
-rw-r--r--src/rules/po.cpp46
1 files changed, 32 insertions, 14 deletions
diff --git a/src/rules/po.cpp b/src/rules/po.cpp
index f0d743f..d600d19 100644
--- a/src/rules/po.cpp
+++ b/src/rules/po.cpp
@@ -61,9 +61,11 @@ static void processMessage(RuleBase *const rule)
}
if (szId > 1 && szStr > 1)
{
- const char cStr = msgStr[szStr - 1];
- const char cId = msgId[szId - 1];
- if (cStr == ' ' && cId != ' ')
+ const char sStr = msgStr[0];
+ const char sId = msgId[0];
+ const char eStr = msgStr[szStr - 1];
+ const char eId = msgId[szId - 1];
+ if (eStr == ' ' && eId != ' ')
rule->print("Useless space at end of translation line.");
std::string name = rule->getFile();
if (findCutLast(name, "po/ar.po") || findCutLast(name, "po/fa.po"))
@@ -71,20 +73,36 @@ static void processMessage(RuleBase *const rule)
if (name.find("po/unused/") != std::string::npos)
return;
- if (cId == '.' ||
- cId == ',' ||
- cId == '!' ||
- cId == '?' ||
- cId == '-' ||
- cId == ':' ||
- cId == ';' ||
- cId == '+' ||
- cId == '|' ||
- cId == ' ')
+ if (eId == '.' ||
+ eId == ',' ||
+ eId == '!' ||
+ eId == '?' ||
+ eId == '-' ||
+ eId == ':' ||
+ eId == ';' ||
+ eId == '+' ||
+ eId == '|' ||
+ eId == '/' ||
+ eId == ' ')
{
- if (cId != cStr)
+ if (eId != eStr)
rule->print("Wrong character at end of translation line.");
}
+ if (sId == '.' ||
+ sId == ',' ||
+ sId == '!' ||
+ sId == '?' ||
+ sId == '-' ||
+ sId == ':' ||
+ sId == ';' ||
+ sId == '+' ||
+ sId == '|' ||
+ sId == '/' ||
+ sId == ' ')
+ {
+ if (sId != sStr)
+ rule->print("Wrong character at start of translation line.");
+ }
if (msgId.find("###") != std::string::npos
&& msgStr.find("###") == std::string::npos)
{