From de8d0e9918f94ec9a5b91b6900e9a58018c4d266 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 5 Jun 2016 12:32:43 -0400 Subject: [PATCH] Define Internat::Parenthesize, for good of right-to-left languages --- src/Internat.cpp | 9 +++++++++ src/Internat.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/Internat.cpp b/src/Internat.cpp index 6a5c5f97a..687373cec 100644 --- a/src/Internat.cpp +++ b/src/Internat.cpp @@ -229,3 +229,12 @@ wxString Internat::StripAccelerators(const wxString &s) } return result; } + +wxString Internat::Parenthesize(const wxString &str) +{ + /* i18n-hint: An opening parenthesis, in some languages a right parenthesis */ + auto open = _("("); + /* i18n-hint: A closing parenthesis, in some languages a left parenthesis */ + auto close = _(")"); + return open + str + close; +} diff --git a/src/Internat.h b/src/Internat.h index 1a0306096..dd8465b81 100644 --- a/src/Internat.h +++ b/src/Internat.h @@ -73,6 +73,8 @@ public: * when they aren't, saving translators effort. */ static wxString StripAccelerators(const wxString& str); + static wxString Parenthesize(const wxString &str); + private: static wxChar mDecimalSeparator;