yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
translator.h
Go to the documentation of this file.
1#ifndef YAZE_UTIL_I18N_TRANSLATOR_H
2#define YAZE_UTIL_I18N_TRANSLATOR_H
3
4#include <string>
5
6namespace yaze {
7namespace i18n {
8
9// Translates a user-visible source string (the English msgid) into the active
10// language. Returns a pointer that stays valid until the next language switch;
11// never returns null.
12//
13// ImGui label convention is handled transparently: for a label like
14// "Mode##selector" or "Layout###main", only the VISIBLE prefix ("Mode",
15// "Layout") is translated while the "##id"/"###id" suffix is preserved
16// byte-for-byte so ImGui widget state/IDs remain stable across languages.
17// A pure-id label like "##foo" is returned unchanged.
18const char* tr(const char* source);
19const char* tr(const std::string& source);
20
21// Drops the internal resolution caches. Called by LanguageManager whenever the
22// active language changes so the next frame re-resolves every string.
24
25} // namespace i18n
26} // namespace yaze
27
28#endif // YAZE_UTIL_I18N_TRANSLATOR_H
void ClearTranslationCache()
Definition translator.cc:64
const char * tr(const char *source)
Definition translator.cc:50