diff options
Diffstat (limited to 'zen/i18n.h')
-rw-r--r-- | zen/i18n.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -35,6 +35,8 @@ struct TranslationHandler virtual std::wstring translate(const std::wstring& text) const = 0; //simple translation virtual std::wstring translate(const std::wstring& singular, const std::wstring& plural, int64_t n) const = 0; + virtual bool layoutIsRtl() const = 0; //right-to-left? e.g. Hebrew, Arabic + private: TranslationHandler (const TranslationHandler&) = delete; TranslationHandler& operator=(const TranslationHandler&) = delete; @@ -50,8 +52,6 @@ std::shared_ptr<const TranslationHandler> getTranslator(); - - //######################## implementation ############################## namespace impl { @@ -101,6 +101,15 @@ std::wstring translate(const std::wstring& singular, const std::wstring& plural, //fallback: return replaceCpy(std::abs(n64) == 1 ? singular : plural, L"%x", formatNumber(n)); } + + +inline +bool languageLayoutIsRtl() +{ + if (std::shared_ptr<const TranslationHandler> t = getTranslator()) + return t->layoutIsRtl(); + return false; +} } #endif //I18_N_H_3843489325044253425456 |