summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-07-29 20:59:54 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-08-09 20:15:12 (GMT)
commit42defb3516a8b7f06c7b0fbc832332a4e60c0f86 (patch)
treeb833bc3cf0166947da16345be511b71dcb04baca /Swift/Controllers/Translator.h
parent3c7b2b3dc884f347771f6e3036779193e7e45627 (diff)
downloadswift-42defb3516a8b7f06c7b0fbc832332a4e60c0f86.zip
swift-42defb3516a8b7f06c7b0fbc832332a4e60c0f86.tar.bz2
Enable better date formatting in the UI
This adds the ability to provide more specific date formatting via the Translator interface. The default translator will use Boost's formatting capabilities. The QtTranslator use more localized and better readable formatting. Test-Information: Tested with Qt 5.5.1 on OS X 10.11.6. Checked that tooltips and presence text in new chat views show the new formatting. Change-Id: I90ff5ab8b31fb41f2dcbea2c40b8846c534c355f
Diffstat (limited to 'Swift/Controllers/Translator.h')
-rw-r--r--Swift/Controllers/Translator.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/Controllers/Translator.h b/Swift/Controllers/Translator.h
index 5c52e9f..f37e059 100644
--- a/Swift/Controllers/Translator.h
+++ b/Swift/Controllers/Translator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,6 +8,8 @@
#include <string>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+
namespace Swift {
class Translator {
public:
@@ -15,6 +17,8 @@ namespace Swift {
virtual std::string translate(const std::string& text, const std::string& context) = 0;
+ virtual std::string ptimeToHumanReadableString(const boost::posix_time::ptime& time) = 0;
+
static void setInstance(Translator* translator);
static Translator* getInstance() {