fix: Bool CMD hotkey toggle message showing translation key (#1510)
* feat(TranslationService): introduced fallback key to joaat version of get_translation
This commit is contained in:
@ -60,16 +60,16 @@ namespace big
|
||||
|
||||
std::string_view translation_service::get_translation(const std::string_view translation_key) const
|
||||
{
|
||||
return get_translation(rage::joaat(translation_key));
|
||||
return get_translation(rage::joaat(translation_key), translation_key);
|
||||
}
|
||||
|
||||
|
||||
std::string_view translation_service::get_translation(const rage::joaat_t translation_key) const
|
||||
std::string_view translation_service::get_translation(const rage::joaat_t translation_key, const std::string_view fallback) const
|
||||
{
|
||||
if (auto it = m_translations.find(translation_key); it != m_translations.end())
|
||||
return it->second.c_str();
|
||||
|
||||
return {0, 0};
|
||||
return fallback;
|
||||
}
|
||||
|
||||
std::map<std::string, translation_entry>& translation_service::available_translations()
|
||||
|
@ -23,7 +23,7 @@ namespace big
|
||||
void init();
|
||||
|
||||
std::string_view get_translation(const std::string_view translation_key) const;
|
||||
std::string_view get_translation(const rage::joaat_t translation_key) const;
|
||||
std::string_view get_translation(const rage::joaat_t translation_key, const std::string_view fallback = { 0, 0 }) const;
|
||||
|
||||
std::map<std::string, translation_entry>& available_translations();
|
||||
const std::string& current_language_pack();
|
||||
|
Reference in New Issue
Block a user