summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-08-20 13:54:46 +0200
committerArne Schwabe <arne@rfc2549.org>2013-08-20 13:54:46 +0200
commit91beceb628c99c8c351d844a164b11e40a50d0f9 (patch)
tree050585b051b75fc660bb7645d5d1f85df4f7a838
parent8dbfc2cf65c808827058d426cf57932eb9eaefc4 (diff)
More debug for broken format string in translations
-rwxr-xr-xmisc/genFAQ.py14
-rw-r--r--src/de/blinkt/openvpn/core/VpnStatus.java6
2 files changed, 20 insertions, 0 deletions
diff --git a/misc/genFAQ.py b/misc/genFAQ.py
index ccd3e589..713d71f1 100755
--- a/misc/genFAQ.py
+++ b/misc/genFAQ.py
@@ -99,6 +99,20 @@ def main():
faq= genPage(faqdom,lang)
open("%s/FAQ.wiki" % langdir,"w").write(faq.encode("utf-8"))
+ checkFormatString(lang)
+def checkFormatString(lang):
+ for strid in strres["default"]:
+ ostr = getString(strid,"default")
+ tstr = getString(strid,lang)
+
+
+ for f in ["%s", "%d", "%f"] + ["%%%d$s" % d for d in range(0,10)] + ["%%%d$d" % d for d in range(0,10)]:
+ ino = ostr.find(f)==-1
+ int = tstr.find(f)==-1
+
+ if ino != int:
+ print "Mismatch",strid,f,ostr,tstr
+
if __name__=="__main__":
main()
diff --git a/src/de/blinkt/openvpn/core/VpnStatus.java b/src/de/blinkt/openvpn/core/VpnStatus.java
index 86f0f727..60fa730e 100644
--- a/src/de/blinkt/openvpn/core/VpnStatus.java
+++ b/src/de/blinkt/openvpn/core/VpnStatus.java
@@ -18,6 +18,7 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Arrays;
+import java.util.FormatFlagsConversionMismatchException;
import java.util.LinkedList;
import java.util.Locale;
import java.util.UnknownFormatConversionException;
@@ -168,6 +169,11 @@ public class VpnStatus {
throw new UnknownFormatConversionException(e.getLocalizedMessage() + getString(null));
else
throw e;
+ } catch (java.util.FormatFlagsConversionMismatchException e) {
+ if (c != null)
+ throw new FormatFlagsConversionMismatchException(e.getLocalizedMessage() + getString(null),e.getConversion());
+ else
+ throw e;
}
}