3#include <Foundation/Basics.h>
4#include <Foundation/Containers/DynamicArray.h>
5#include <Foundation/Containers/Map.h>
6#include <Foundation/Strings/String.h>
7#include <Foundation/Types/UniquePtr.h>
10enum class plTranslationUsage
33 virtual void Reload();
36 static void ReloadAllTranslators();
38 static void HighlightUntranslated(
bool bHighlight);
40 static bool GetHighlightUntranslated() {
return s_bHighlightUntranslated; }
43 static bool s_bHighlightUntranslated;
60 virtual void StoreTranslation(
plStringView sString, plUInt64 uiStringHash, plTranslationUsage usage);
66 virtual void Reset()
override;
69 virtual void Reload()
override;
95 void AddTranslationFilesFromFolder(
const char* szFolder);
99 virtual void Reload()
override;
102 void LoadTranslationFile(
const char* szFullPath);
135#define plTranslate(string) plTranslationLookup::Translate(string, plHashingUtils::StringHash(string), plTranslationUsage::Default)
138#define plTranslateTooltip(string) plTranslationLookup::Translate(string, plHashingUtils::StringHash(string), plTranslationUsage::Tooltip)
141#define plTranslateHelpURL(string) plTranslationLookup::Translate(string, plHashingUtils::StringHash(string), plTranslationUsage::HelpURL)
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Handles looking up translations for strings.
Definition TranslationLookup.h:118
Loads translations from files. Each translator can have different search paths, but the files to be l...
Definition TranslationLookup.h:88
Base class to translate one string into another.
Definition TranslationLookup.h:21
virtual plStringView Translate(plStringView sString, plUInt64 uiStringHash, plTranslationUsage usage)=0
The given string (with the given hash) shall be translated.
Outputs a 'Missing Translation' warning the first time a string translation is requested....
Definition TranslationLookup.h:78
static bool s_bActive
Can be used from external code to (temporarily) deactivate error logging (a bit hacky)
Definition TranslationLookup.h:81
Returns the same string that is passed into it, but strips off class names and separates the text at ...
Definition TranslationLookup.h:109
Just returns the same string that is passed into it. Can be used to display the actually untranslated...
Definition TranslationLookup.h:49
virtual plStringView Translate(plStringView sString, plUInt64 uiStringHash, plTranslationUsage usage) override
The given string (with the given hash) shall be translated.
Definition TranslationLookup.h:51
Can store translated strings and all translation requests will come from that storage....
Definition TranslationLookup.h:57
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10