1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 09:22:42 +01:00

Change: Make truncation ellipsis translatable. (#14417)

This commit is contained in:
Peter Nelson
2025-07-09 22:55:43 +01:00
committed by GitHub
parent 259830777c
commit f6e78a480d
4 changed files with 36 additions and 26 deletions

View File

@@ -286,6 +286,7 @@ struct LoadedLanguagePack {
std::array<uint, TEXT_TAB_END> langtab_start; ///< Offset into langpack offs
std::string list_separator; ///< Current list separator string.
std::string ellipsis; ///< Current ellipsis string.
};
static LoadedLanguagePack _langpack;
@@ -301,6 +302,15 @@ std::string_view GetListSeparator()
return _langpack.list_separator;
}
/**
* Get the ellipsis string for the current language.
* @returns string containing ellipsis to use.
*/
std::string_view GetEllipsis()
{
return _langpack.ellipsis;
}
std::string_view GetStringPtr(StringID string)
{
switch (GetStringTab(string)) {
@@ -2063,6 +2073,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
_config_language_file = FS2OTTD(_current_language->file.filename().native());
SetCurrentGrfLangID(_current_language->newgrflangid);
_langpack.list_separator = GetString(STR_LIST_SEPARATOR);
_langpack.ellipsis = GetString(STR_TRUNCATION_ELLIPSIS);
#ifdef _WIN32
extern void Win32SetCurrentLocaleName(std::string iso_code);