From ea9e833e5dfd63072a85955eb99df5b315bd765e Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 1 Aug 2013 14:32:50 +0100 Subject: [PATCH] Added an overloaded translate() function that takes CharPointer_UTF8 --- .../juce_core/text/juce_LocalisedStrings.cpp | 24 ++++--------------- .../juce_core/text/juce_LocalisedStrings.h | 5 ++++ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/modules/juce_core/text/juce_LocalisedStrings.cpp b/modules/juce_core/text/juce_LocalisedStrings.cpp index 5534742459..0fb31552de 100644 --- a/modules/juce_core/text/juce_LocalisedStrings.cpp +++ b/modules/juce_core/text/juce_LocalisedStrings.cpp @@ -155,26 +155,12 @@ LocalisedStrings* LocalisedStrings::getCurrentMappings() return currentMappings; } -String LocalisedStrings::translateWithCurrentMappings (const String& text) -{ - return juce::translate (text); -} +String LocalisedStrings::translateWithCurrentMappings (const String& text) { return juce::translate (text); } +String LocalisedStrings::translateWithCurrentMappings (const char* text) { return juce::translate (text); } -String LocalisedStrings::translateWithCurrentMappings (const char* text) -{ - return juce::translate (String (text)); -} - -String translate (const String& text) -{ - return translate (text, text); -} - -String translate (const char* const literal) -{ - const String text (literal); - return translate (text, text); -} +String translate (const String& text) { return juce::translate (text, text); } +String translate (const char* text) { return juce::translate (String (text)); } +String translate (CharPointer_UTF8 text) { return juce::translate (String (text)); } String translate (const String& text, const String& resultIfNotFound) { diff --git a/modules/juce_core/text/juce_LocalisedStrings.h b/modules/juce_core/text/juce_LocalisedStrings.h index 0781a8a918..8a55e06576 100644 --- a/modules/juce_core/text/juce_LocalisedStrings.h +++ b/modules/juce_core/text/juce_LocalisedStrings.h @@ -215,6 +215,11 @@ String translate (const String& stringLiteral); */ String translate (const char* stringLiteral); +/** Uses the LocalisedStrings class to translate the given string literal. + @see LocalisedStrings +*/ +String translate (CharPointer_UTF8 stringLiteral); + /** Uses the LocalisedStrings class to translate the given string literal. @see LocalisedStrings */