Commit graph

28 commits

Author SHA1 Message Date
Robert Müller a91b51c8a2 Select language on first start based on user locale
On first client start (when `cl_show_welcome` is `1`), determine the user locale with `os_locale_str` and initially select the most fitting language for this locale.

For this the language index must also be loaded immediately on client launch, before the initial language is loaded.
2023-03-21 21:17:40 +01:00
Robert Müller cddbc78592 Add RFC 3066 language tags to language index
Add RFC 3066 language tags to language index in order to identify the language to select when first starting the game based on the user's locale.

Multiple language tags can be specified per entry separated with a semicolon, as some languages have different tags that do not share a unique prefix (e.g., Simplified and Traditional Chinese).
2023-03-21 21:17:40 +01:00
Robert Müller 481698c7d0 Move CLanguage and LoadLanguageIndexfile to localization
The `CLanguage` class and `LoadLanguageIndexfile` function are more appropriately located in the file for the other localization functions.
2023-03-21 21:17:40 +01:00
Chairn 01edaec628 Format vector variables names (fixes #5209) 2022-06-11 21:38:49 +02:00
Robert Müller d0b5d096f5 Use emplace_back for CString 2022-05-27 00:03:13 +02:00
Robert Müller de23bf912d Use std::vector<CString> instead of sorted_array, improve string search 2022-05-27 00:03:13 +02:00
Robert Müller 3e1cfcd306 Store localized strings in a CHeap instead of using tl/string.h 2022-05-07 00:02:43 +02:00
Robert Müller e2a049f0ca Mark methods as const 2022-05-06 23:24:58 +02:00
heinrich5991 cdbf8ff2d2 Skip the UTF-8 BOM on all read text files
Fixes #4462.
2021-12-17 22:07:01 +01:00
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
def 7af517009c Implement context for translations (largely taken from Teeworlds)
Missing: scripts/languages doesn't work yet, but the context can be
added manually, see german.txt for an example.
2020-09-15 10:30:49 +02:00
def 0a8a1b078b Localization: Print line number where failure occured 2020-06-26 18:42:56 +02:00
oy 06115dd49d added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
oy 0c119ba99b fixed possible problem with localisations if the linereader flushes its memory between reading the origin and the replacement string 2011-02-10 12:07:00 +01:00
oy 9a9c10b1a3 added a missing close handle 2011-01-19 22:14:40 +01:00
oy e447de38ba use original string as localisation if there's no replacement 2010-11-21 00:27:38 +01:00
Sworddragon fc9211c777 Updated copyrights 2010-11-20 21:26:06 +01:00
oy e89cb59891 fixed problem with CLocConstString when changing to English and back to the previous language again 2010-11-03 02:15:39 +01:00
oy 3a98f7a048 added mod system. Closes #34 2010-10-06 23:07:35 +02:00
oy cabecb7fa9 added output level for console print function, categorised the debug messages and merged them into the new functionality. Closes #8 2010-08-18 00:06:00 +02:00
Magnus Auvinen 72c06a2589 copied refactor to trunk 2010-05-29 07:25:38 +00:00
Magnus Auvinen 878ede3080 major update with stuff 2009-10-27 14:38:53 +00:00
Magnus Auvinen 8bd49fe30b some clean up. fixed double server side record messages 2009-06-15 13:01:04 +00:00
Magnus Auvinen 307cf4aa64 done language selector 2009-06-15 08:15:53 +00:00
Magnus Auvinen ab171f8f30 updated localization 2009-06-15 07:34:25 +00:00
Magnus Auvinen 6309d7ad56 continued with localization 2009-06-15 06:45:44 +00:00
Magnus Auvinen bc20e9c433 localization update 2009-06-13 17:18:06 +00:00
Magnus Auvinen 6d9ccee95d base for the localization system 2009-06-13 16:54:04 +00:00