Changeset - r28801:c5b7832cf53a
[Not reviewed]
master
! ! !
Rubidium - 10 months ago 2024-02-22 17:08:33
rubidium@openttd.org
Revert #11993: new number format system does not and cannot work for CJK languages

There are too many intricacies that I am unaware of that are popping up after
asking whether things are right or not.
I do not want to keep playing whack-a-mole, so just revert the whole thing.

This reverts:
15be383b934dbf7c876b6d6ffaec7a406c82a39f
360fe8b0b639be9d39bc03a9d5d34123204c14fa
1aa9a5c0abaf9c5d6c49a3a76e2b1d7134c0bd10
59f56941e50bd4ebad31f9e771a4441f647692e5
7e2eefb91ff5999667752eea6e13bd8a0d293f48
b741b2ba6f790891961cb66a9320e75ca168cee4
609d0071d5e6b93aa61688714e9b92cf102e4683
9f8fd80112c188675179c9568a9be84da3df1713
a253205b932cc50fc9f25be390a6aaa370f89a45
819c6c756edd68599571eae126f305d6e3d247fc
81 files changed with 313 insertions and 425 deletions:
0 comments (0 inline, 0 general)
src/currency.cpp
Show inline comments
 
@@ -18,61 +18,61 @@
 
#include "timer/timer_game_calendar.h"
 

	
 
#include "table/strings.h"
 

	
 
#include "safeguards.h"
 

	
 
	/*   exchange rate             postfix         code
 
	 *   |  Euro year              |               |     symbol_pos
 
	 *   |  |          prefix      |               |     | name
 
	 *   |  |          |           |               |     |  | */
 
	/*   exchange rate    prefix                             code
 
	 *   |  separator        |           postfix              |  symbol_pos
 
	 *   |   |   Euro year   |              |                 |     | name
 
	 *   |   |    |          |              |                 |     |  | */
 
/** The original currency specifications. */
 
static const CurrencySpec origin_currency_specs[CURRENCY_END] = {
 
	{    1, CF_NOEURO, "\u00a3",   "",             "GBP", 0, STR_GAME_OPTIONS_CURRENCY_GBP    }, ///< british pound
 
	{    2, CF_NOEURO, "$",        "",             "USD", 0, STR_GAME_OPTIONS_CURRENCY_USD    }, ///< american dollar
 
	{    2, CF_ISEURO, "\u20ac",   "",             "EUR", 0, STR_GAME_OPTIONS_CURRENCY_EUR    }, ///< euro
 
	{  220, CF_NOEURO, "\u00a5",   "",             "JPY", 0, STR_GAME_OPTIONS_CURRENCY_JPY    }, ///< japanese yen
 
	{   27, 2002,      "",         NBSP "S.",      "ATS", 1, STR_GAME_OPTIONS_CURRENCY_ATS    }, ///< austrian schilling
 
	{   81, 2002,      "BEF" NBSP, "",             "BEF", 0, STR_GAME_OPTIONS_CURRENCY_BEF    }, ///< belgian franc
 
	{    2, CF_NOEURO, "CHF" NBSP, "",             "CHF", 0, STR_GAME_OPTIONS_CURRENCY_CHF    }, ///< swiss franc
 
	{   41, CF_NOEURO, "",         NBSP "K\u010d", "CZK", 1, STR_GAME_OPTIONS_CURRENCY_CZK    }, ///< czech koruna
 
	{    4, 2002,      "DM" NBSP,  "",             "DEM", 0, STR_GAME_OPTIONS_CURRENCY_DEM    }, ///< deutsche mark
 
	{   11, CF_NOEURO, "",         NBSP "kr",      "DKK", 1, STR_GAME_OPTIONS_CURRENCY_DKK    }, ///< danish krone
 
	{  333, 2002,      "Pts" NBSP, "",             "ESP", 0, STR_GAME_OPTIONS_CURRENCY_ESP    }, ///< spanish peseta
 
	{   12, 2002,      "",         NBSP "mk",      "FIM", 1, STR_GAME_OPTIONS_CURRENCY_FIM    }, ///< finnish markka
 
	{   13, 2002,      "FF" NBSP,  "",             "FRF", 0, STR_GAME_OPTIONS_CURRENCY_FRF    }, ///< french franc
 
	{  681, 2002,      "",         "Dr.",          "GRD", 1, STR_GAME_OPTIONS_CURRENCY_GRD    }, ///< greek drachma
 
	{  378, CF_NOEURO, "",         NBSP "Ft",      "HUF", 1, STR_GAME_OPTIONS_CURRENCY_HUF    }, ///< hungarian forint
 
	{  130, CF_NOEURO, "",         NBSP "Kr",      "ISK", 1, STR_GAME_OPTIONS_CURRENCY_ISK    }, ///< icelandic krona
 
	{ 3873, 2002,      "",         NBSP "L.",      "ITL", 1, STR_GAME_OPTIONS_CURRENCY_ITL    }, ///< italian lira
 
	{    4, 2002,      "NLG" NBSP, "",             "NLG", 0, STR_GAME_OPTIONS_CURRENCY_NLG    }, ///< dutch gulden
 
	{   12, CF_NOEURO, "",         NBSP "Kr",      "NOK", 1, STR_GAME_OPTIONS_CURRENCY_NOK    }, ///< norwegian krone
 
	{    6, CF_NOEURO, "",         NBSP "z\u0142", "PLN", 1, STR_GAME_OPTIONS_CURRENCY_PLN    }, ///< polish zloty
 
	{    5, CF_NOEURO, "",         NBSP "Lei",     "RON", 1, STR_GAME_OPTIONS_CURRENCY_RON    }, ///< romanian leu
 
	{   50, CF_NOEURO, "",         NBSP "p",       "RUR", 1, STR_GAME_OPTIONS_CURRENCY_RUR    }, ///< russian rouble
 
	{  479, 2007,      "",         NBSP "SIT",     "SIT", 1, STR_GAME_OPTIONS_CURRENCY_SIT    }, ///< slovenian tolar
 
	{   13, CF_NOEURO, "",         NBSP "Kr",      "SEK", 1, STR_GAME_OPTIONS_CURRENCY_SEK    }, ///< swedish krona
 
	{    3, CF_NOEURO, "",         NBSP "TL",      "TRY", 1, STR_GAME_OPTIONS_CURRENCY_TRY    }, ///< turkish lira
 
	{   60, 2009,      "",         NBSP "Sk",      "SKK", 1, STR_GAME_OPTIONS_CURRENCY_SKK    }, ///< slovak koruna
 
	{    4, CF_NOEURO, "R$" NBSP,  "",             "BRL", 0, STR_GAME_OPTIONS_CURRENCY_BRL    }, ///< brazil real
 
	{   31, 2011,      "",         NBSP "EEK",     "EEK", 1, STR_GAME_OPTIONS_CURRENCY_EEK    }, ///< estonian krooni
 
	{    4, 2015,      "",         NBSP "Lt",      "LTL", 1, STR_GAME_OPTIONS_CURRENCY_LTL    }, ///< lithuanian litas
 
	{ 1850, CF_NOEURO, "\u20a9",   "",             "KRW", 0, STR_GAME_OPTIONS_CURRENCY_KRW    }, ///< south korean won
 
	{   13, CF_NOEURO, "R" NBSP,   "",             "ZAR", 0, STR_GAME_OPTIONS_CURRENCY_ZAR    }, ///< south african rand
 
	{    1, CF_NOEURO, "",         "",             "",    2, STR_GAME_OPTIONS_CURRENCY_CUSTOM }, ///< custom currency (add further languages below)
 
	{    3, CF_NOEURO, "",         NBSP "GEL",     "GEL", 1, STR_GAME_OPTIONS_CURRENCY_GEL    }, ///< Georgian Lari
 
	{ 4901, CF_NOEURO, "",         NBSP "Rls",     "IRR", 1, STR_GAME_OPTIONS_CURRENCY_IRR    }, ///< Iranian Rial
 
	{   80, CF_NOEURO, "",         NBSP "rub",     "RUB", 1, STR_GAME_OPTIONS_CURRENCY_RUB    }, ///< New Russian Ruble
 
	{   24, CF_NOEURO, "$",        "",             "MXN", 0, STR_GAME_OPTIONS_CURRENCY_MXN    }, ///< Mexican peso
 
	{   40, CF_NOEURO, "NTD" NBSP, "",             "NTD", 0, STR_GAME_OPTIONS_CURRENCY_NTD    }, ///< new taiwan dollar
 
	{    8, CF_NOEURO, "\u00a5",   "",             "CNY", 0, STR_GAME_OPTIONS_CURRENCY_CNY    }, ///< chinese renminbi
 
	{   10, CF_NOEURO, "HKD" NBSP, "",             "HKD", 0, STR_GAME_OPTIONS_CURRENCY_HKD    }, ///< hong kong dollar
 
	{   90, CF_NOEURO, "\u20b9",   "",             "INR", 0, STR_GAME_OPTIONS_CURRENCY_INR    }, ///< Indian Rupee
 
	{   19, CF_NOEURO, "Rp",       "",             "IDR", 0, STR_GAME_OPTIONS_CURRENCY_IDR    }, ///< Indonesian Rupiah
 
	{    5, CF_NOEURO, "RM",       "",             "MYR", 0, STR_GAME_OPTIONS_CURRENCY_MYR    }, ///< Malaysian Ringgit
 
	{    1, 2014,      "",         NBSP "Ls",      "LVL", 1, STR_GAME_OPTIONS_CURRENCY_LVL    }, ///< latvian lats
 
	{    1, "", CF_NOEURO, "\u00a3",   "",             "GBP", 0, STR_GAME_OPTIONS_CURRENCY_GBP    }, ///< british pound
 
	{    2, "", CF_NOEURO, "$",        "",             "USD", 0, STR_GAME_OPTIONS_CURRENCY_USD    }, ///< american dollar
 
	{    2, "", CF_ISEURO, "\u20ac",   "",             "EUR", 0, STR_GAME_OPTIONS_CURRENCY_EUR    }, ///< euro
 
	{  220, "", CF_NOEURO, "\u00a5",   "",             "JPY", 0, STR_GAME_OPTIONS_CURRENCY_JPY    }, ///< japanese yen
 
	{   27, "", 2002,      "",         NBSP "S.",      "ATS", 1, STR_GAME_OPTIONS_CURRENCY_ATS    }, ///< austrian schilling
 
	{   81, "", 2002,      "BEF" NBSP, "",             "BEF", 0, STR_GAME_OPTIONS_CURRENCY_BEF    }, ///< belgian franc
 
	{    2, "", CF_NOEURO, "CHF" NBSP, "",             "CHF", 0, STR_GAME_OPTIONS_CURRENCY_CHF    }, ///< swiss franc
 
	{   41, "", CF_NOEURO, "",         NBSP "K\u010d", "CZK", 1, STR_GAME_OPTIONS_CURRENCY_CZK    }, ///< czech koruna
 
	{    4, "", 2002,      "DM" NBSP,  "",             "DEM", 0, STR_GAME_OPTIONS_CURRENCY_DEM    }, ///< deutsche mark
 
	{   11, "", CF_NOEURO, "",         NBSP "kr",      "DKK", 1, STR_GAME_OPTIONS_CURRENCY_DKK    }, ///< danish krone
 
	{  333, "", 2002,      "Pts" NBSP, "",             "ESP", 0, STR_GAME_OPTIONS_CURRENCY_ESP    }, ///< spanish peseta
 
	{   12, "", 2002,      "",         NBSP "mk",      "FIM", 1, STR_GAME_OPTIONS_CURRENCY_FIM    }, ///< finnish markka
 
	{   13, "", 2002,      "FF" NBSP,  "",             "FRF", 0, STR_GAME_OPTIONS_CURRENCY_FRF    }, ///< french franc
 
	{  681, "", 2002,      "",         "Dr.",          "GRD", 1, STR_GAME_OPTIONS_CURRENCY_GRD    }, ///< greek drachma
 
	{  378, "", CF_NOEURO, "",         NBSP "Ft",      "HUF", 1, STR_GAME_OPTIONS_CURRENCY_HUF    }, ///< hungarian forint
 
	{  130, "", CF_NOEURO, "",         NBSP "Kr",      "ISK", 1, STR_GAME_OPTIONS_CURRENCY_ISK    }, ///< icelandic krona
 
	{ 3873, "", 2002,      "",         NBSP "L.",      "ITL", 1, STR_GAME_OPTIONS_CURRENCY_ITL    }, ///< italian lira
 
	{    4, "", 2002,      "NLG" NBSP, "",             "NLG", 0, STR_GAME_OPTIONS_CURRENCY_NLG    }, ///< dutch gulden
 
	{   12, "", CF_NOEURO, "",         NBSP "Kr",      "NOK", 1, STR_GAME_OPTIONS_CURRENCY_NOK    }, ///< norwegian krone
 
	{    6, "", CF_NOEURO, "",         NBSP "z\u0142", "PLN", 1, STR_GAME_OPTIONS_CURRENCY_PLN    }, ///< polish zloty
 
	{    5, "", CF_NOEURO, "",         NBSP "Lei",     "RON", 1, STR_GAME_OPTIONS_CURRENCY_RON    }, ///< romanian leu
 
	{   50, "", CF_NOEURO, "",         NBSP "p",       "RUR", 1, STR_GAME_OPTIONS_CURRENCY_RUR    }, ///< russian rouble
 
	{  479, "", 2007,      "",         NBSP "SIT",     "SIT", 1, STR_GAME_OPTIONS_CURRENCY_SIT    }, ///< slovenian tolar
 
	{   13, "", CF_NOEURO, "",         NBSP "Kr",      "SEK", 1, STR_GAME_OPTIONS_CURRENCY_SEK    }, ///< swedish krona
 
	{    3, "", CF_NOEURO, "",         NBSP "TL",      "TRY", 1, STR_GAME_OPTIONS_CURRENCY_TRY    }, ///< turkish lira
 
	{   60, "", 2009,      "",         NBSP "Sk",      "SKK", 1, STR_GAME_OPTIONS_CURRENCY_SKK    }, ///< slovak koruna
 
	{    4, "", CF_NOEURO, "R$" NBSP,  "",             "BRL", 0, STR_GAME_OPTIONS_CURRENCY_BRL    }, ///< brazil real
 
	{   31, "", 2011,      "",         NBSP "EEK",     "EEK", 1, STR_GAME_OPTIONS_CURRENCY_EEK    }, ///< estonian krooni
 
	{    4, "", 2015,      "",         NBSP "Lt",      "LTL", 1, STR_GAME_OPTIONS_CURRENCY_LTL    }, ///< lithuanian litas
 
	{ 1850, "", CF_NOEURO, "\u20a9",   "",             "KRW", 0, STR_GAME_OPTIONS_CURRENCY_KRW    }, ///< south korean won
 
	{   13, "", CF_NOEURO, "R" NBSP,   "",             "ZAR", 0, STR_GAME_OPTIONS_CURRENCY_ZAR    }, ///< south african rand
 
	{    1, "", CF_NOEURO, "",         "",             "",    2, STR_GAME_OPTIONS_CURRENCY_CUSTOM }, ///< custom currency (add further languages below)
 
	{    3, "", CF_NOEURO, "",         NBSP "GEL",     "GEL", 1, STR_GAME_OPTIONS_CURRENCY_GEL    }, ///< Georgian Lari
 
	{ 4901, "", CF_NOEURO, "",         NBSP "Rls",     "IRR", 1, STR_GAME_OPTIONS_CURRENCY_IRR    }, ///< Iranian Rial
 
	{   80, "", CF_NOEURO, "",         NBSP "rub",     "RUB", 1, STR_GAME_OPTIONS_CURRENCY_RUB    }, ///< New Russian Ruble
 
	{   24, "", CF_NOEURO, "$",        "",             "MXN", 0, STR_GAME_OPTIONS_CURRENCY_MXN    }, ///< Mexican peso
 
	{   40, "", CF_NOEURO, "NTD" NBSP, "",             "NTD", 0, STR_GAME_OPTIONS_CURRENCY_NTD    }, ///< new taiwan dollar
 
	{    8, "", CF_NOEURO, "\u00a5",   "",             "CNY", 0, STR_GAME_OPTIONS_CURRENCY_CNY    }, ///< chinese renminbi
 
	{   10, "", CF_NOEURO, "HKD" NBSP, "",             "HKD", 0, STR_GAME_OPTIONS_CURRENCY_HKD    }, ///< hong kong dollar
 
	{   90, "", CF_NOEURO, "\u20b9",   "",             "INR", 0, STR_GAME_OPTIONS_CURRENCY_INR    }, ///< Indian Rupee
 
	{   19, "", CF_NOEURO, "Rp",       "",             "IDR", 0, STR_GAME_OPTIONS_CURRENCY_IDR    }, ///< Indonesian Rupiah
 
	{    5, "", CF_NOEURO, "RM",       "",             "MYR", 0, STR_GAME_OPTIONS_CURRENCY_MYR    }, ///< Malaysian Ringgit
 
	{    1, "", 2014,      "",         NBSP "Ls",      "LVL", 1, STR_GAME_OPTIONS_CURRENCY_LVL    }, ///< latvian lats
 
};
 

	
 
/** Array of currencies used by the system */
 
CurrencySpec _currency_specs[CURRENCY_END];
 

	
 
/**
src/currency.h
Show inline comments
 
@@ -70,12 +70,13 @@ enum Currencies {
 
	CURRENCY_END,       ///< always the last item
 
};
 

	
 
/** Specification of a currency. */
 
struct CurrencySpec {
 
	uint16_t rate;           ///< The conversion rate compared to the base currency.
 
	std::string separator; ///< The thousands separator for this currency.
 
	TimerGameCalendar::Year to_euro; ///< Year of switching to the Euro. May also be #CF_NOEURO or #CF_ISEURO.
 
	std::string prefix;    ///< Prefix to apply when formatting money in this currency.
 
	std::string suffix;    ///< Suffix to apply when formatting money in this currency.
 
	std::string code; ///< 3 letter untranslated code to identify the currency.
 
	/**
 
	 * The currency symbol is represented by two possible values, prefix and suffix
 
@@ -88,14 +89,14 @@ struct CurrencySpec {
 
	 */
 
	byte symbol_pos;
 
	StringID name;
 

	
 
	CurrencySpec() = default;
 

	
 
	CurrencySpec(uint16_t rate, TimerGameCalendar::Year to_euro, const char *prefix, const char *suffix, const char *code, byte symbol_pos, StringID name) :
 
		rate(rate), to_euro(to_euro), prefix(prefix), suffix(suffix), code(code), symbol_pos(symbol_pos), name(name)
 
	CurrencySpec(uint16_t rate, const char *separator, TimerGameCalendar::Year to_euro, const char *prefix, const char *suffix, const char *code, byte symbol_pos, StringID name) :
 
		rate(rate), separator(separator), to_euro(to_euro), prefix(prefix), suffix(suffix), code(code), symbol_pos(symbol_pos), name(name)
 
	{
 
	}
 
};
 

	
 
extern CurrencySpec _currency_specs[CURRENCY_END];
 

	
src/lang/afrikaans.txt
Show inline comments
 
##name Afrikaans
 
##ownname Afrikaans
 
##isocode af_ZA
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0436
 
##grflangid 0x1b
 
##gender male
 

	
 

	
src/lang/arabic_egypt.txt
Show inline comments
 
##name Arabic (Egypt)
 
##ownname Arabic (Egypt)
 
##isocode ar_EG
 
##plural 1
 
##textdir rtl
 
##numberformat 00٬000٬000٬000٬000٬000٬000
 
##numberabbreviations 3=00٬000٬000٬000٬000٬000{NBSP}k|6=00٬000٬000٬000٬000{NBSP}m|9=00٬000٬000٬000{NBSP}bn|12=00٬000٬000{NBSP}tn|15=00٬000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ٬
 
##digitsepcur ٬
 
##decimalsep ٫
 
##winlangid 0x0c01
 
##grflangid 0x14
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/basque.txt
Show inline comments
 
##name Basque
 
##ownname Euskara
 
##isocode eu_ES
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x042d
 
##grflangid 0x21
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/belarusian.txt
Show inline comments
 
##name Belarusian
 
##ownname Беларуская
 
##isocode be_BY
 
##plural 6
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}m|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}bn|12=00{NBSP}000{NBSP}000{NBSP}tn|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x0423
 
##grflangid 0x10
 
##gender m f n p
 
##case m f n p nom gen dat acc abl pre
 

	
src/lang/brazilian_portuguese.txt
Show inline comments
 
##name Portuguese (Brazilian)
 
##ownname Português (BR)
 
##isocode pt_BR
 
##plural 2
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0416
 
##grflangid 0x37
 
##gender m f
 

	
 

	
src/lang/bulgarian.txt
Show inline comments
 
##name Bulgarian
 
##ownname Български
 
##isocode bg_BG
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0402
 
##grflangid 0x18
 
##gender m f n p
 
##case m f n p
 

	
src/lang/catalan.txt
Show inline comments
 
##name Catalan
 
##ownname Català
 
##isocode ca_ES
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}M|9=00.000.000.000{NBSP}G|12=00.000.000{NBSP}T|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0403
 
##grflangid 0x22
 
##gender Masculin Femenin
 

	
 

	
src/lang/chuvash.txt
Show inline comments
 
##name Chuvash
 
##ownname Чӑвашла
 
##isocode cv_RU
 
##plural 0
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}m|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}bn|12=00{NBSP}000{NBSP}000{NBSP}tn|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x0419
 
##grflangid 0x0b
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/croatian.txt
Show inline comments
 
##name Croatian
 
##ownname Hrvatski
 
##isocode hr_HR
 
##plural 6
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x041a
 
##grflangid 0x38
 
##gender male female middle
 
##case nom gen dat aku vok lok ins
 

	
src/lang/czech.txt
Show inline comments
 
##name Czech
 
##ownname Čeština
 
##isocode cs_CZ
 
##plural 10
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}tis.|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}mil.|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}mld.|12=00{NBSP}000{NBSP}000{NBSP}bil.|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x0405
 
##grflangid 0x15
 
##gender m f n map mnp fp np
 
##case nom gen dat acc voc loc ins big small
 

	
src/lang/danish.txt
Show inline comments
 
##name Danish
 
##ownname Dansk
 
##isocode da_DK
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0406
 
##grflangid 0x2d
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/dutch.txt
Show inline comments
 
##name Dutch
 
##ownname Nederlands
 
##isocode nl_NL
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}mj|9=00.000.000.000{NBSP}md|12=00.000.000{NBSP}bn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0413
 
##grflangid 0x1f
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/english.txt
Show inline comments
 
##name English (UK)
 
##ownname English (UK)
 
##isocode en_GB
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0809
 
##grflangid 0x01
 

	
 

	
 
# This file is part of OpenTTD.
 
@@ -1114,12 +1114,15 @@ STR_ERROR_FULLSCREEN_FAILED             
 
STR_CURRENCY_WINDOW                                             :{WHITE}Custom currency
 
STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Exchange rate: {ORANGE}{CURRENCY_LONG} = £ {COMMA}
 
STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP                     :{BLACK}Decrease the amount of your currency for one Pound (£)
 
STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP                     :{BLACK}Increase the amount of your currency for one Pound (£)
 
STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP                          :{BLACK}Set the exchange rate of your currency for one Pound (£)
 

	
 
STR_CURRENCY_SEPARATOR                                          :{LTBLUE}Separator: {ORANGE}{RAW_STRING}
 
STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP              :{BLACK}Set the separator for your currency
 

	
 
STR_CURRENCY_PREFIX                                             :{LTBLUE}Prefix: {ORANGE}{RAW_STRING}
 
STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP                 :{BLACK}Set the prefix string for your currency
 
STR_CURRENCY_SUFFIX                                             :{LTBLUE}Suffix: {ORANGE}{RAW_STRING}
 
STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP                 :{BLACK}Set the suffix string for your currency
 

	
 
STR_CURRENCY_SWITCH_TO_EURO                                     :{LTBLUE}Switch to Euro: {ORANGE}{NUM}
 
@@ -5804,12 +5807,17 @@ STR_PRESIDENT_NAME                      
 
STR_SIGN_NAME                                                   :{SIGN}
 
STR_STATION_NAME                                                :{STATION}
 
STR_TOWN_NAME                                                   :{TOWN}
 
STR_VEHICLE_NAME                                                :{VEHICLE}
 
STR_WAYPOINT_NAME                                               :{WAYPOINT}
 

	
 
STR_CURRENCY_SHORT_KILO                                         :{NBSP}k
 
STR_CURRENCY_SHORT_MEGA                                         :{NBSP}m
 
STR_CURRENCY_SHORT_GIGA                                         :{NBSP}bn
 
STR_CURRENCY_SHORT_TERA                                         :{NBSP}tn
 

	
 
STR_JUST_CARGO                                                  :{CARGO_LONG}
 
STR_JUST_RIGHT_ARROW                                            :{RIGHT_ARROW}
 
STR_JUST_CHECKMARK                                              :{CHECKMARK}
 
STR_JUST_COMMA                                                  :{COMMA}
 
STR_JUST_CURRENCY_SHORT                                         :{CURRENCY_SHORT}
 
STR_JUST_CURRENCY_LONG                                          :{CURRENCY_LONG}
src/lang/english_AU.txt
Show inline comments
 
##name English (AU)
 
##ownname English (AU)
 
##isocode en_AU
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0c09
 
##grflangid 0x3d
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/english_US.txt
Show inline comments
 
##name English (US)
 
##ownname English (US)
 
##isocode en_US
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}K|6=00,000,000,000,000{NBSP}M|9=00,000,000,000{NBSP}B|12=00,000,000{NBSP}T|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0409
 
##grflangid 0x00
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/esperanto.txt
Show inline comments
 
##name Esperanto
 
##ownname Esperanto
 
##isocode eo_EO
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0000
 
##grflangid 0x05
 
##case n
 

	
 

	
src/lang/estonian.txt
Show inline comments
 
##name Estonian
 
##ownname Eesti keel
 
##isocode et_EE
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0425
 
##grflangid 0x34
 
##case g in sü
 

	
 

	
src/lang/faroese.txt
Show inline comments
 
##name Faroese
 
##ownname Føroyskt
 
##isocode fo_FO
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0438
 
##grflangid 0x12
 
##gender m f n
 

	
 

	
src/lang/finnish.txt
Show inline comments
 
##name Finnish
 
##ownname Suomi
 
##isocode fi_FI
 
##plural 0
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}milj.|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}mrd.|12=00{NBSP}000{NBSP}000{NBSP} t|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x040b
 
##grflangid 0x35
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/french.txt
Show inline comments
 
##name French
 
##ownname Français
 
##isocode fr_FR
 
##plural 2
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}Mio|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}Mrd|12=00{NBSP}000{NBSP}000{NBSP}kMrd|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x040c
 
##grflangid 0x03
 
##gender m m2 f
 

	
 

	
src/lang/frisian.txt
Show inline comments
 
##name Frisian
 
##ownname Frysk
 
##isocode fy_NL
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0462
 
##grflangid 0x32
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/gaelic.txt
Show inline comments
 
##name Scottish Gaelic
 
##ownname Gàidhlig
 
##isocode gd_GB
 
##plural 13
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x083c
 
##grflangid 0x13
 
##gender m f
 
##case nom gen dat voc
 

	
src/lang/galician.txt
Show inline comments
 
##name Galician
 
##ownname Galego
 
##isocode gl_ES
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}M|9=00.000.000.000{NBSP}MM|12=00.000.000{NBSP}bn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0456
 
##grflangid 0x31
 
##gender m f n
 

	
 

	
src/lang/german.txt
Show inline comments
 
##name German
 
##ownname Deutsch
 
##isocode de_DE
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}Tsd.|6=00.000.000.000.000{NBSP}Mio.|9=00.000.000.000{NBSP}Mrd.|12=00.000.000{NBSP}Bio.|15=00.000{NBSP}Brd.|18=00{NBSP}Trill.
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0407
 
##grflangid 0x02
 
##gender m w n p
 

	
 

	
src/lang/greek.txt
Show inline comments
 
##name Greek
 
##ownname Ελληνικά
 
##isocode el_GR
 
##plural 2
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0408
 
##grflangid 0x1e
 
##gender m f n
 
##case subs date geniki
 

	
src/lang/hebrew.txt
Show inline comments
 
##name Hebrew
 
##ownname עברית
 
##isocode he_IL
 
##plural 0
 
##textdir rtl
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x040d
 
##grflangid 0x61
 
##gender m f
 
##case singular plural gen
 

	
src/lang/hindi.txt
Show inline comments
 
##name Hindi
 
##ownname हिन्दी
 
##isocode hi_IN
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0439
 
##grflangid 0x17
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/hungarian.txt
Show inline comments
 
##name Hungarian
 
##ownname Magyar
 
##isocode hu_HU
 
##plural 2
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}e|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}mrd|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x040e
 
##grflangid 0x24
 
##case t ba
 

	
 

	
src/lang/icelandic.txt
Show inline comments
 
##name Icelandic
 
##ownname Íslenska
 
##isocode is_IS
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x040f
 
##grflangid 0x29
 
##gender karlkyn kvenkyn hvorugkyn
 

	
 

	
src/lang/ido.txt
Show inline comments
 
##name Ido
 
##ownname Ido
 
##isocode io_IO
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0000
 
##grflangid 0x06
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/indonesian.txt
Show inline comments
 
##name Indonesian
 
##ownname Bahasa Indonesia
 
##isocode id_ID
 
##plural 1
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0421
 
##grflangid 0x5a
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/irish.txt
Show inline comments
 
##name Irish
 
##ownname Gaeilge
 
##isocode ga_IE
 
##plural 4
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x083c
 
##grflangid 0x08
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/italian.txt
Show inline comments
 
##name Italian
 
##ownname Italiano
 
##isocode it_IT
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0410
 
##grflangid 0x27
 
##gender m ma f
 
##case ms mp fs fp
 

	
src/lang/japanese.txt
Show inline comments
 
##name Japanese
 
##ownname 日本語
 
##isocode ja_JP
 
##plural 1
 
##textdir ltr
 
##numberformat 0000京0000兆0000億0000万0000
 
##numberabbreviations 4=0000京0000兆0000億0000万|8=0000京0000兆0000億|12=0000京0000兆|16=0000京
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0411
 
##grflangid 0x39
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/korean.txt
Show inline comments
 
##name Korean
 
##ownname 한국어
 
##isocode ko_KR
 
##plural 11
 
##textdir ltr
 
##numberformat 0000경0000조0000억0000만0000
 
##numberabbreviations 4=0000경0000조0000억0000만|8=0000경0000조0000억|12=0000경0000조|16=0000경
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0412
 
##grflangid 0x3a
 
##gender m f
 

	
 

	
src/lang/latin.txt
Show inline comments
 
##name Latin
 
##ownname Latina
 
##isocode la_VA
 
##plural 0
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}m|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}bn|12=00{NBSP}000{NBSP}000{NBSP}tn|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep .
 
##winlangid 0x0476
 
##grflangid 0x66
 
##gender m f n mp fp np
 
##case gen acc abl dat
 

	
src/lang/latvian.txt
Show inline comments
 
##name Latvian
 
##ownname Latviešu
 
##isocode lv_LV
 
##plural 3
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}tk.|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}mljrd.|12=00.000.000{NBSP}tonna|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0426
 
##grflangid 0x2a
 
##gender m f
 
##case kas
 

	
src/lang/lithuanian.txt
Show inline comments
 
##name Lithuanian
 
##ownname Lietuvių
 
##isocode lt_LT
 
##plural 5
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0427
 
##grflangid 0x2b
 
##gender vyr mot
 
##case kas ko kam ka kuo kur kreip
 

	
src/lang/luxembourgish.txt
Show inline comments
 
##name Luxembourgish
 
##ownname Lëtzebuergesch
 
##isocode lb_LU
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}d|6=00.000.000.000.000{NBSP}Mio|9=00.000.000.000{NBSP}Mrd|12=00.000.000{NBSP}Bio|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x046e
 
##grflangid 0x23
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/macedonian.txt
Show inline comments
 
##name Macedonian
 
##ownname Македонски
 
##isocode mk_MK
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x042f
 
##grflangid 0x26
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/malay.txt
Show inline comments
 
##name Malay
 
##ownname Melayu
 
##isocode ms_MY
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x043a
 
##grflangid 0x3c
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/maltese.txt
Show inline comments
 
##name Maltese
 
##ownname Malti
 
##isocode mt_MT
 
##plural 12
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x043a
 
##grflangid 0x09
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/marathi.txt
Show inline comments
 
##name Marathi
 
##ownname मराठी
 
##isocode mr_IN
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x044e
 
##grflangid 0x11
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/norwegian_bokmal.txt
Show inline comments
 
##name Norwegian (Bokmal)
 
##ownname Norsk (bokmål)
 
##isocode nb_NO
 
##plural 0
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}m|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}bn|12=00{NBSP}000{NBSP}000{NBSP}tn|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x0414
 
##grflangid 0x2f
 
##gender masculine feminine neuter
 
##case small
 

	
src/lang/norwegian_nynorsk.txt
Show inline comments
 
##name Norwegian (Nynorsk)
 
##ownname Norsk (nynorsk)
 
##isocode nn_NO
 
##plural 0
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}m|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}bn|12=00{NBSP}000{NBSP}000{NBSP}tn|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x0814
 
##grflangid 0x0e
 
##gender masculine feminine neuter
 
##case small
 

	
src/lang/persian.txt
Show inline comments
 
##name Persian
 
##ownname فارسی
 
##isocode fa_IR
 
##plural 0
 
##textdir rtl
 
##numberformat 00٬000٬000٬000٬000٬000٬000
 
##numberabbreviations 3=00٬000٬000٬000٬000٬000{NBSP}k|6=00٬000٬000٬000٬000{NBSP}m|9=00٬000٬000٬000{NBSP}bn|12=00٬000٬000{NBSP}tn|15=00٬000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ٬
 
##digitsepcur ٬
 
##decimalsep ٫
 
##winlangid 0x0429
 
##grflangid 0x62
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/polish.txt
Show inline comments
 
##name Polish
 
##ownname Polski
 
##isocode pl_PL
 
##plural 7
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}M|9=00.000.000.000{NBSP}G|12=00.000.000{NBSP}T|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0415
 
##grflangid 0x30
 
##gender m f n
 
##case d c b n m w
 

	
src/lang/portuguese.txt
Show inline comments
 
##name Portuguese
 
##ownname Português
 
##isocode pt_PT
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0816
 
##grflangid 0x36
 
##gender n m f mp fp
 

	
 

	
src/lang/romanian.txt
Show inline comments
 
##name Romanian
 
##ownname Română
 
##isocode ro_RO
 
##plural 14
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}mii|6=00.000.000.000.000{NBSP}mil.|9=00.000.000.000{NBSP}mld.|12=00.000.000{NBSP}bil.|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0418
 
##grflangid 0x28
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/russian.txt
Show inline comments
 
##name Russian
 
##ownname Русский
 
##isocode ru_RU
 
##plural 6
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}тыс.|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}млн|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}млрд.|12=00{NBSP}000{NBSP}000{NBSP}трлн.|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x0419
 
##grflangid 0x07
 
##gender m f n p
 
##case m f n p nom gen dat acc abl pre
 

	
src/lang/serbian.txt
Show inline comments
 
##name Serbian
 
##ownname Srpski
 
##isocode sr_RS
 
##plural 6
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x7c1a
 
##grflangid 0x0d
 
##gender muški ženski srednji
 
##case nom big gen dat aku vok lok ins
 

	
src/lang/simplified_chinese.txt
Show inline comments
 
##name Chinese (Simplified)
 
##ownname 简体中文
 
##isocode zh_CN
 
##plural 1
 
##textdir ltr
 
##numberformat 0000京0000兆0000亿0000万0000
 
##numberabbreviations 4=0000京0000兆0000亿0000万|8=0000京0000兆0000亿|12=0000京0000兆|16=0000京
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0804
 
##grflangid 0x56
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/slovak.txt
Show inline comments
 
##name Slovak
 
##ownname Slovenčina
 
##isocode sk_SK
 
##plural 10
 
##textdir ltr
 
##numberformat 00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000
 
##numberabbreviations 3=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}k|6=00{NBSP}000{NBSP}000{NBSP}000{NBSP}000{NBSP}m|9=00{NBSP}000{NBSP}000{NBSP}000{NBSP}bn|12=00{NBSP}000{NBSP}000{NBSP}tn|15=00{NBSP}000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep {NBSP}
 
##digitsepcur {NBSP}
 
##decimalsep ,
 
##winlangid 0x041b
 
##grflangid 0x16
 
##gender m z s
 
##case g
 

	
src/lang/slovenian.txt
Show inline comments
 
##name Slovenian
 
##ownname Slovenščina
 
##isocode sl_SI
 
##plural 8
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0424
 
##grflangid 0x2c
 
##case r d t
 

	
 

	
src/lang/spanish.txt
Show inline comments
 
##name Spanish
 
##ownname Español (ES)
 
##isocode es_ES
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}M|9=00.000.000.000{NBSP}kM|12=00.000.000{NBSP}MM|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0c0a
 
##grflangid 0x04
 
##gender m f
 

	
 

	
src/lang/spanish_MX.txt
Show inline comments
 
##name Spanish (Mexican)
 
##ownname Español (MX)
 
##isocode es_MX
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x080a
 
##grflangid 0x55
 
##gender m f
 

	
 

	
src/lang/swedish.txt
Show inline comments
 
##name Swedish
 
##ownname Svenska
 
##isocode sv_SE
 
##plural 0
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}t|6=00.000.000.000.000{NBSP}mn|9=00.000.000.000{NBSP}md|12=00.000.000{NBSP}bn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x081d
 
##grflangid 0x2e
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/tamil.txt
Show inline comments
 
##name Tamil
 
##ownname தமிழ்
 
##isocode ta_IN
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0449
 
##grflangid 0x0a
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/thai.txt
Show inline comments
 
##name Thai
 
##ownname Thai
 
##isocode th_TH
 
##plural 1
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x041e
 
##grflangid 0x42
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/traditional_chinese.txt
Show inline comments
 
##name Chinese (Traditional)
 
##ownname 繁體中文
 
##isocode zh_TW
 
##plural 1
 
##textdir ltr
 
##numberformat 0000京0000兆0000億0000万0000
 
##numberabbreviations 4=0000京0000兆0000億0000万|8=0000京0000兆0000億|12=0000京0000兆|16=0000京
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0404
 
##grflangid 0x0c
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/turkish.txt
Show inline comments
 
##name Turkish
 
##ownname Türkçe
 
##isocode tr_TR
 
##plural 1
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}mlyn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x041f
 
##grflangid 0x3e
 
##case tamlanan
 

	
 

	
src/lang/ukrainian.txt
Show inline comments
 
##name Ukrainian
 
##ownname Українська
 
##isocode uk_UA
 
##plural 6
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}тис.|6=00.000.000.000.000{NBSP}млн|9=00.000.000.000{NBSP}млрд|12=00.000.000{NBSP}трлн|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x0422
 
##grflangid 0x33
 
##gender m f s mn
 
##case r d z
 

	
src/lang/urdu.txt
Show inline comments
 
##name Urdu
 
##ownname Urdu
 
##isocode ur_PK
 
##plural 0
 
##textdir rtl
 
##numberformat 00٬000٬000٬000٬000٬000٬000
 
##numberabbreviations 3=00٬000٬000٬000٬000٬000{NBSP}k|6=00٬000٬000٬000٬000{NBSP}m|9=00٬000٬000٬000{NBSP}bn|12=00٬000٬000{NBSP}tn|15=00٬000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ٬
 
##digitsepcur ٬
 
##decimalsep ٫
 
##winlangid 0x0420
 
##grflangid 0x5c
 
##gender m f
 

	
 

	
src/lang/vietnamese.txt
Show inline comments
 
##name Vietnamese
 
##ownname Tiếng Việt
 
##isocode vi_VN
 
##plural 1
 
##textdir ltr
 
##numberformat 00.000.000.000.000.000.000
 
##numberabbreviations 3=00.000.000.000.000.000{NBSP}k|6=00.000.000.000.000{NBSP}m|9=00.000.000.000{NBSP}bn|12=00.000.000{NBSP}tn|15=00.000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep .
 
##digitsepcur .
 
##decimalsep ,
 
##winlangid 0x042a
 
##grflangid 0x54
 

	
 

	
 
# This file is part of OpenTTD.
src/lang/welsh.txt
Show inline comments
 
##name Welsh
 
##ownname Cymraeg
 
##isocode cy_GB
 
##plural 0
 
##textdir ltr
 
##numberformat 00,000,000,000,000,000,000
 
##numberabbreviations 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
##digitsep ,
 
##digitsepcur ,
 
##decimalsep .
 
##winlangid 0x0452
 
##grflangid 0x0f
 

	
 

	
 
# This file is part of OpenTTD.
src/language.h
Show inline comments
 
@@ -28,16 +28,16 @@ struct LanguagePackHeader {
 
	uint32_t version;     ///< 32-bits of auto generated version info which is basically a hash of strings.h
 
	char name[32];      ///< the international name of this language
 
	char own_name[32];  ///< the localized name of this language
 
	char isocode[16];   ///< the ISO code for the language (not country code)
 
	uint16_t offsets[TEXT_TAB_END]; ///< the offsets
 

	
 
	/** The raw formatting string for numbers. */
 
	char number_format[64];
 
	/** The raw formatting string for number abbreviations. */
 
	char number_abbreviations[256];
 
	/** Thousand separator used for anything not currencies */
 
	char digit_group_separator[8];
 
	/** Thousand separator used for currencies */
 
	char digit_group_separator_currency[8];
 
	/** Decimal separator */
 
	char digit_decimal_separator[8];
 
	uint16_t missing;     ///< number of missing strings.
 
	byte plural_form;   ///< plural form index
 
	byte text_dir;      ///< default direction of the text
 
	/**
 
@@ -104,31 +104,10 @@ extern LanguageList _languages;
 
extern const LanguageMetadata *_current_language;
 

	
 
#ifdef WITH_ICU_I18N
 
extern std::unique_ptr<icu::Collator> _current_collator;
 
#endif /* WITH_ICU_I18N */
 

	
 
/** The number digits available in a uint64_t. */
 
constexpr int DIGITS_IN_UINT64_T = 20;
 
/**
 
 * Table with the text to place after each of the digits of a number. The text at index "20 - i" will be
 
 * inserted after the digit with value "10**i". So, for "normal" thousand separators, the strings at indices
 
 * 3, 6, 9, 12, 15 and 18 will be filled. For CJK the strings at indices 0, 4, 8, 12 and 16 will be filled.
 
 * @see ParseNumberFormatSeparators
 
 */
 
using NumberFormatSeparators = std::array<std::string, DIGITS_IN_UINT64_T>;
 
/** Container for the power to abbreviation mapping for formatting short numbers. */
 
struct NumberAbbreviation {
 
	NumberAbbreviation(int64_t threshold, NumberFormatSeparators &format) : threshold(threshold), format(format) {}
 
	int64_t threshold; ///< The threshold from which this abbreviation holds.
 
	NumberFormatSeparators format; ///< Format separators to use for this specific power.
 
};
 
/** Lookup for abbreviated formats for different powers of ten. */
 
using NumberAbbreviations = std::vector<NumberAbbreviation>;
 

	
 
bool ReadLanguagePack(const LanguageMetadata *lang);
 
const LanguageMetadata *GetLanguage(byte newgrflangid);
 

	
 
std::optional<std::string> ParseNumberFormatSeparators(NumberFormatSeparators &separators, std::string_view format, size_t length = DIGITS_IN_UINT64_T);
 
std::optional<std::string> ParseNumberAbbreviations(NumberAbbreviations &abbreviations, std::string_view input);
 

	
 
#endif /* LANGUAGE_H */
src/newgrf.cpp
Show inline comments
 
@@ -2743,13 +2743,14 @@ static ChangeInfoResult GlobalVarChangeI
 

	
 
			case 0x0C: { // Currency options
 
				uint curidx = GetNewgrfCurrencyIdConverted(gvid + i);
 
				uint16_t options = buf->ReadWord();
 

	
 
				if (curidx < CURRENCY_END) {
 
					/* Ignore the thousands separator, as this is a translated thing. */
 
					_currency_specs[curidx].separator.clear();
 
					_currency_specs[curidx].separator.push_back(GB(options, 0, 8));
 
					/* By specifying only one bit, we prevent errors,
 
					 * since newgrf specs said that only 0 and 1 can be set for symbol_pos */
 
					_currency_specs[curidx].symbol_pos = GB(options, 8, 1);
 
				} else {
 
					GrfMsg(1, "GlobalVarChangeInfo: Currency option {} out of range, ignoring", curidx);
 
				}
src/saveload/compat/settings_sl_compat.h
Show inline comments
 
@@ -255,12 +255,12 @@ const SaveLoadCompat _settings_sl_compat
 
	SLC_VAR("locale.units_velocity"),
 
	SLC_VAR("locale.units_power"),
 
	SLC_VAR("locale.units_weight"),
 
	SLC_VAR("locale.units_volume"),
 
	SLC_VAR("locale.units_force"),
 
	SLC_VAR("locale.units_height"),
 
	SLC_NULL_STR(1, SLV_118, SLV_TABLE_CHUNKS),
 
	SLC_NULL_STR(1, SLV_118, SLV_TABLE_CHUNKS),
 
	SLC_NULL_STR(1, SLV_126, SLV_TABLE_CHUNKS),
 
	SLC_VAR("locale.digit_group_separator"),
 
	SLC_VAR("locale.digit_group_separator_currency"),
 
	SLC_VAR("locale.digit_decimal_separator"),
 
};
 

	
 
#endif /* SAVELOAD_COMPAT_SETTINGS_H */
src/settings_gui.cpp
Show inline comments
 
@@ -2986,12 +2986,13 @@ struct CustomCurrencyWindow : Window {
 
	}
 

	
 
	void SetStringParameters(WidgetID widget) const override
 
	{
 
		switch (widget) {
 
			case WID_CC_RATE:      SetDParam(0, 1); SetDParam(1, 1);            break;
 
			case WID_CC_SEPARATOR: SetDParamStr(0, _custom_currency.separator); break;
 
			case WID_CC_PREFIX:    SetDParamStr(0, _custom_currency.prefix);    break;
 
			case WID_CC_SUFFIX:    SetDParamStr(0, _custom_currency.suffix);    break;
 
			case WID_CC_YEAR:
 
				SetDParam(0, (_custom_currency.to_euro != CF_NOEURO) ? STR_CURRENCY_SWITCH_TO_EURO : STR_CURRENCY_SWITCH_TO_EURO_NEVER);
 
				SetDParam(1, _custom_currency.to_euro);
 
				break;
 
@@ -3011,12 +3012,13 @@ struct CustomCurrencyWindow : Window {
 
			case WID_CC_YEAR_DOWN:
 
			case WID_CC_YEAR_UP:
 
				*size = maxdim(*size, {(uint)SETTING_BUTTON_WIDTH / 2, (uint)SETTING_BUTTON_HEIGHT});
 
				break;
 

	
 
			/* Set the appropriate width for the edit buttons. */
 
			case WID_CC_SEPARATOR_EDIT:
 
			case WID_CC_PREFIX_EDIT:
 
			case WID_CC_SUFFIX_EDIT:
 
				*size = maxdim(*size, {(uint)SETTING_BUTTON_WIDTH, (uint)SETTING_BUTTON_HEIGHT});
 
				break;
 

	
 
			/* Make sure the window is wide enough for the widest exchange rate */
 
@@ -3053,12 +3055,20 @@ struct CustomCurrencyWindow : Window {
 
				str = STR_JUST_INT;
 
				len = 5;
 
				line = WID_CC_RATE;
 
				afilter = CS_NUMERAL;
 
				break;
 

	
 
			case WID_CC_SEPARATOR_EDIT:
 
			case WID_CC_SEPARATOR:
 
				SetDParamStr(0, _custom_currency.separator);
 
				str = STR_JUST_RAW_STRING;
 
				len = 7;
 
				line = WID_CC_SEPARATOR;
 
				break;
 

	
 
			case WID_CC_PREFIX_EDIT:
 
			case WID_CC_PREFIX:
 
				SetDParamStr(0, _custom_currency.prefix);
 
				str = STR_JUST_RAW_STRING;
 
				len = 15;
 
				line = WID_CC_PREFIX;
 
@@ -3108,12 +3118,16 @@ struct CustomCurrencyWindow : Window {
 

	
 
		switch (this->query_widget) {
 
			case WID_CC_RATE:
 
				_custom_currency.rate = Clamp(atoi(str), 1, UINT16_MAX);
 
				break;
 

	
 
			case WID_CC_SEPARATOR: // Thousands separator
 
				_custom_currency.separator = str;
 
				break;
 

	
 
			case WID_CC_PREFIX:
 
				_custom_currency.prefix = str;
 
				break;
 

	
 
			case WID_CC_SUFFIX:
 
				_custom_currency.suffix = str;
 
@@ -3149,12 +3163,16 @@ static constexpr NWidgetPart _nested_cus
 
						NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_CC_RATE_DOWN), SetDataTip(AWV_DECREASE, STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP),
 
						NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_CC_RATE_UP), SetDataTip(AWV_INCREASE, STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP),
 
					EndContainer(),
 
					NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_RATE), SetDataTip(STR_CURRENCY_EXCHANGE_RATE, STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP), SetFill(1, 0),
 
				EndContainer(),
 
				NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0),
 
					NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_SEPARATOR_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(0, 1),
 
					NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_SEPARATOR), SetDataTip(STR_CURRENCY_SEPARATOR, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(1, 0),
 
				EndContainer(),
 
				NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0),
 
					NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_PREFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(0, 1),
 
					NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_PREFIX), SetDataTip(STR_CURRENCY_PREFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(1, 0),
 
				EndContainer(),
 
				NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0),
 
					NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_SUFFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP), SetFill(0, 1),
 
					NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_SUFFIX), SetDataTip(STR_CURRENCY_SUFFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP), SetFill(1, 0),
src/settings_table.cpp
Show inline comments
 
@@ -47,13 +47,12 @@
 
#include "roadveh_cmd.h"
 
#include "vehicle_func.h"
 
#include "viewport_func.h"
 
#include "void_map.h"
 
#include "station_func.h"
 
#include "station_base.h"
 
#include "language.h"
 

	
 
#include "table/strings.h"
 
#include "table/settings.h"
 

	
 
#include "safeguards.h"
 

	
src/settings_type.h
Show inline comments
 
@@ -219,16 +219,12 @@ struct GUISettings {
 
	uint8_t  settings_restriction_mode;        ///< selected restriction mode in adv. settings GUI. @see RestrictionMode
 
	bool   newgrf_show_old_versions;         ///< whether to show old versions in the NewGRF list
 
	uint8_t  newgrf_default_palette;           ///< default palette to use for NewGRFs without action 14 palette information
 

	
 
	bool   scale_bevels;                     ///< bevels are scaled with GUI scale.
 

	
 
	std::string number_format; ///< formatting string for numbers (like "thousands" grouping)
 
	std::string number_abbreviations; ///< mapping to number formats for different powers of ten/thresholds
 
	std::string digit_decimal_separator; ///< decimal separator
 

	
 
	/**
 
	 * Returns true when the user has sufficient privileges to edit newgrfs on a running game
 
	 * @return whether the user has sufficient privileges to edit newgrfs in an existing game
 
	 */
 
	bool UserIsAllowedToChangeNewGRFs() const
 
	{
 
@@ -266,12 +262,15 @@ struct LocaleSettings {
 
	byte        units_velocity_nautical;          ///< unit system for velocity of ships and aircraft
 
	byte        units_power;                      ///< unit system for power
 
	byte        units_weight;                     ///< unit system for weight
 
	byte        units_volume;                     ///< unit system for volume
 
	byte        units_force;                      ///< unit system for force
 
	byte        units_height;                     ///< unit system for height
 
	std::string digit_group_separator;            ///< thousand separator for non-currencies
 
	std::string digit_group_separator_currency;   ///< thousand separator for currencies
 
	std::string digit_decimal_separator;          ///< decimal separator
 
};
 

	
 
/** Settings related to news */
 
struct NewsSettings {
 
	uint8_t arrival_player;                                 ///< NewsDisplay of vehicles arriving at new stations of current player
 
	uint8_t arrival_other;                                  ///< NewsDisplay of vehicles arriving at new stations of other players
src/strgen/strgen.cpp
Show inline comments
 
@@ -118,28 +118,18 @@ void FileStringReader::HandlePragma(char
 
			_lang.text_dir = TD_LTR;
 
		} else if (!memcmp(str + 8, "rtl", 3)) {
 
			_lang.text_dir = TD_RTL;
 
		} else {
 
			FatalError("Invalid textdir {}", str + 8);
 
		}
 
	} else if (!memcmp(str, "numberformat ", 13)) {
 
		str += 13;
 

	
 
		NumberFormatSeparators separators;
 
		auto result = ParseNumberFormatSeparators(separators, str);
 
		if (result.has_value()) FatalError("Invalid number format: {}", *result);
 

	
 
		strecpy(_lang.number_format, str, lastof(_lang.number_format));
 
	} else if (!memcmp(str, "numberabbreviations ", 20)) {
 
		str += 20;
 

	
 
		NumberAbbreviations abbreviations;
 
		auto result = ParseNumberAbbreviations(abbreviations, str);
 
		if (result.has_value()) FatalError("Invalid number abbreviations: {}", *result);
 

	
 
		strecpy(_lang.number_abbreviations, str, lastof(_lang.number_abbreviations));
 
	} else if (!memcmp(str, "digitsep ", 9)) {
 
		str += 9;
 
		strecpy(_lang.digit_group_separator, strcmp(str, "{NBSP}") == 0 ? NBSP : str, lastof(_lang.digit_group_separator));
 
	} else if (!memcmp(str, "digitsepcur ", 12)) {
 
		str += 12;
 
		strecpy(_lang.digit_group_separator_currency, strcmp(str, "{NBSP}") == 0 ? NBSP : str, lastof(_lang.digit_group_separator_currency));
 
	} else if (!memcmp(str, "decimalsep ", 11)) {
 
		str += 11;
 
		strecpy(_lang.digit_decimal_separator, strcmp(str, "{NBSP}") == 0 ? NBSP : str, lastof(_lang.digit_decimal_separator));
 
	} else if (!memcmp(str, "winlangid ", 10)) {
 
		const char *buf = str + 10;
 
		long langid = std::strtol(buf, nullptr, 16);
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -13,13 +13,13 @@
 
#include "../core/mem_func.hpp"
 
#include "../error_func.h"
 
#include "../string_func.h"
 
#include "../table/control_codes.h"
 

	
 
#include "strgen.h"
 
#include <charconv>
 

	
 

	
 
#include "../table/strgen_tables.h"
 

	
 
#include "../safeguards.h"
 

	
 
/* Compiles a list of strings into a compiled string list */
 
@@ -753,14 +753,14 @@ void StringReader::ParseFile()
 
	/* Abusing _show_todo to replace "warning" with "info" for translations. */
 
	_show_todo &= 3;
 
	if (!this->translation) _show_todo |= 4;
 

	
 
	/* For each new file we parse, reset the genders, and language codes. */
 
	MemSetT(&_lang, 0);
 
	strecpy(_lang.number_format, "00,000,000,000,000,000,000", lastof(_lang.number_format));
 
	strecpy(_lang.number_abbreviations, "3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi", lastof(_lang.number_abbreviations));
 
	strecpy(_lang.digit_group_separator, ",", lastof(_lang.digit_group_separator));
 
	strecpy(_lang.digit_group_separator_currency, ",", lastof(_lang.digit_group_separator_currency));
 
	strecpy(_lang.digit_decimal_separator, ".", lastof(_lang.digit_decimal_separator));
 

	
 
	_cur_line = 1;
 
	while (this->data.next_string_id < this->data.max_strings) {
 
		std::optional<std::string> line = this->ReadLine();
 
		if (!line.has_value()) return;
 
@@ -977,116 +977,6 @@ void LanguageWriter::WriteLang(const Str
 
			this->WriteLength((uint)buffer.size());
 
			this->Write(buffer.data(), buffer.size());
 
			buffer.clear();
 
		}
 
	}
 
}
 

	
 
static const std::string_view NBSP_TOKEN = "{NBSP}";
 

	
 
static std::string ReplaceNBSP(std::string string)
 
{
 
	for (;;) {
 
		auto iter = string.find(NBSP_TOKEN);
 
		if (iter == std::string::npos) break;
 

	
 
		string.replace(iter, NBSP_TOKEN.size(), NBSP);
 
	}
 
	return string;
 
}
 

	
 
/**
 
 * Parse the \c NumberFormatSeparators out of the given format string, with the expected number of digits.
 
 *
 
 * Different cultures have different ways to separate their numbers when they get really big. In the Western world
 
 * these are often called thousands separators which come every three digits counted from the back. The actual
 
 * separator differs per language/country. In Chinese, Japanese and Korean they add a character every four digits
 
 * counted from the back, and this character differs for each spot as it denotes "ten thousand", "hundred million",
 
 * etc. In the Indic numbering system (Indian subcontinent), the first separator is after three digits counted
 
 * from the back, but the next separators are given every two digits.
 
 *
 
 * So, there's no simple single parameter that you can add to the digit grouping character that is already
 
 * configured. The simplest solution is just defining what character to place between each of the digits, i.e what
 
 * characters separate each of the digits. These are the \c NumberFormatSeparators.
 
 *
 
 * To define these, you simply write a string of \c length zeros and then add any characters in between at the right
 
 * locations so the digit grouping is correct. When formatting numbers, it will start at the appropriate digit and
 
 * continue from there with separators.
 
 *
 
 * Examples of formats are "00,000,000,000,000,000,000" and "0000{NBSP}0000{NBSP}0000{NBSP}0000{NBSP}0000".
 
 *
 
 * @param separators The separators to fill; it will be cleared first.
 
 * @param format The format that is going to be read.
 
 * @param length The number of digits that are expected in this format.
 
 * @return An \c std::optional with the error message, or \c std::nullopt when the parsing went without problems.
 
 */
 
std::optional<std::string> ParseNumberFormatSeparators(NumberFormatSeparators &separators, std::string_view format, size_t length)
 
{
 
	separators.fill({});
 
	size_t seen_zeros = 0;
 

	
 
	auto it_separator = separators.rbegin();
 
	auto iter = format.find_last_of('0');
 
	while (iter != std::string_view::npos && it_separator != separators.rend())  {
 
		seen_zeros++;
 

	
 
		*it_separator = ReplaceNBSP(std::string(format.substr(iter + 1)));
 
		++it_separator;
 

	
 
		format = format.substr(0, iter);
 
		iter = format.find_last_of('0');
 
	}
 

	
 
	if (seen_zeros != length) return fmt::format("Unexpected number of digits ({} vs {}) in format string: [{}]", seen_zeros, length, format);
 

	
 
	return std::nullopt;
 
}
 

	
 
/**
 
 * Parse the \c NumberAbbreviations out of the given input string.
 
 *
 
 * In some places in the UI numbers are getting really big yet their exact value is not that important. For example
 
 * in the graphs of company values. For this you want more compact number, e.g. 123 m for 123.456.789. However, due
 
 * to the grouping of digits differing in different cultures, see \c ParseNumberFormatSeparators, there are many
 
 * different ways of grouping digits.
 
 *
 
 * This function builds up a lookup table of these abbreviations by power of ten. The input will be a list of
 
 * definitions per power separator by a pipe character (|). Each definition is the power of ten and and the
 
 * associated number format with DIGITS_IN_UINT64_T - power digits, separated by the equals sign (=).
 
 *
 
 * For example, for English it defines every third power of ten with subsequently smaller number formats:
 
 * 3=00,000,000,000,000,000{NBSP}k|6=00,000,000,000,000{NBSP}m|9=00,000,000,000{NBSP}bn|12=00,000,000{NBSP}tn|15=00,000{NBSP}Qa|18=00{NBSP}Qi
 
 *
 
 * @param abbreviations The table to write the abbreviations in; is will be cleared before filling.
 
 * @param input The input format to parse.
 
 * @return An \c std::optional with the error message, or \c std::nullopt when the parsing went without problems.
 
 */
 
std::optional<std::string> ParseNumberAbbreviations(NumberAbbreviations &abbreviations, std::string_view input)
 
{
 
	abbreviations.clear();
 

	
 
	std::map<int, std::string_view> abbreviation_map;
 
	do {
 
		std::string_view part = input.substr(0, input.find_first_of('|'));
 
		input.remove_prefix(std::min(part.size() + 1, input.size()));
 

	
 
		auto equals = part.find_first_of('=');
 
		if (equals == std::string_view::npos) return fmt::format("Part [{}] does not have an '='", part);
 

	
 
		std::string_view power_sv = part.substr(0, equals);
 
		int power = 0;
 
		if (std::from_chars(power_sv.data(), power_sv.data() + power_sv.size(), power).ec != std::errc{}) return fmt::format("Power [{}] is not a number", power_sv);
 
		if (power >= DIGITS_IN_UINT64_T || power <= 0) return fmt::format("Power {} is not allowed", power_sv);
 

	
 
		abbreviation_map[power] = part.substr(equals + 1);
 
	} while (!input.empty());
 

	
 
	for (auto iter = abbreviation_map.rbegin(); iter != abbreviation_map.rend(); ++iter) {
 
		NumberFormatSeparators separators;
 
		auto result = ParseNumberFormatSeparators(separators, iter->second, DIGITS_IN_UINT64_T - iter->first);
 
		if (result.has_value()) return result;
 

	
 
		abbreviations.emplace_back(PowerOfTen(iter->first), separators);
 
	}
 

	
 
	return std::nullopt;
 
}
src/strings.cpp
Show inline comments
 
@@ -52,15 +52,12 @@
 
std::string _config_language_file;                ///< The file (name) stored in the configuration.
 
LanguageList _languages;                          ///< The actual list of language meta data.
 
const LanguageMetadata *_current_language = nullptr; ///< The currently loaded language.
 

	
 
TextDirection _current_text_dir; ///< Text direction of the currently selected language.
 

	
 
static NumberFormatSeparators _number_format_separators;
 
static NumberAbbreviations _number_abbreviations;
 

	
 
#ifdef WITH_ICU_I18N
 
std::unique_ptr<icu::Collator> _current_collator;    ///< Collator for the language currently in use.
 
#endif /* WITH_ICU_I18N */
 

	
 
ArrayStringParameters<20> _global_string_params;
 

	
 
@@ -379,68 +376,59 @@ void SetDParamStr(size_t n, std::string 
 
{
 
	_global_string_params.SetParam(n, std::move(str));
 
}
 

	
 
static const char *GetDecimalSeparator()
 
{
 
	const char *decimal_separator = _settings_client.gui.digit_decimal_separator.c_str();
 
	const char *decimal_separator = _settings_game.locale.digit_decimal_separator.c_str();
 
	if (StrEmpty(decimal_separator)) decimal_separator = _langpack.langpack->digit_decimal_separator;
 
	return decimal_separator;
 
}
 

	
 
void InitializeNumberFormats()
 
{
 
	bool loaded_number_format = false;
 
	if (!_settings_client.gui.number_format.empty()) {
 
		auto res = ParseNumberFormatSeparators(_number_format_separators, _settings_client.gui.number_format);
 
		if (res.has_value()) UserError("The setting 'number_format' under 'gui' is invalid: {}", *res);
 
		loaded_number_format = !res.has_value();
 
	}
 
	if (!loaded_number_format) ParseNumberFormatSeparators(_number_format_separators, _current_language->number_format);
 

	
 
	bool loaded_number_abbreviations = false;
 
	if (!_settings_client.gui.number_abbreviations.empty()) {
 
		auto res = ParseNumberAbbreviations(_number_abbreviations, _settings_client.gui.number_abbreviations);
 
		if (res.has_value()) UserError("The setting 'number_abbreviations' under 'gui' is invalid: {}", *res);
 
		loaded_number_abbreviations = !res.has_value();
 
	}
 
	if (!loaded_number_abbreviations) ParseNumberAbbreviations(_number_abbreviations, _current_language->number_abbreviations);
 
	_number_abbreviations.emplace_back(1, _number_format_separators);
 
}
 

	
 
/**
 
 * Format a number into a string.
 
 * @param builder The string builder to write to.
 
 * @param number The number to write down.
 
 * @param separators The separator to use between each of the digits.
 
 * @param builder   the string builder to write to
 
 * @param number    the number to write down
 
 * @param last      the last element in the buffer
 
 * @param separator the thousands-separator to use
 
 */
 
static void FormatNumber(StringBuilder &builder, int64_t number, const NumberFormatSeparators &separators)
 
static void FormatNumber(StringBuilder &builder, int64_t number, const char *separator)
 
{
 
	static const int max_digits = 20;
 
	uint64_t divisor = 10000000000000000000ULL;
 
	int thousands_offset = (max_digits - 1) % 3;
 

	
 
	if (number < 0) {
 
		builder += '-';
 
		number = -number;
 
	}
 

	
 
	uint64_t divisor = 10000000000000000000ULL;
 
	uint64_t num = number;
 
	uint64_t tot = 0;
 
	for (size_t i = 0; i < separators.size(); i++) {
 
	for (int i = 0; i < max_digits; i++) {
 
		uint64_t quot = 0;
 
		if (num >= divisor) {
 
			quot = num / divisor;
 
			num = num % divisor;
 
		}
 
		if ((tot |= quot) != 0 || i == separators.size() - 1) {
 
		if ((tot |= quot) || i == max_digits - 1) {
 
			builder += '0' + quot; // quot is a single digit
 
			builder += separators[i].data();
 
			if ((i % 3) == thousands_offset && i < max_digits - 1) builder += separator;
 
		}
 

	
 
		divisor /= 10;
 
	}
 
}
 

	
 
static void FormatCommaNumber(StringBuilder &builder, int64_t number)
 
{
 
	const char *separator = _settings_game.locale.digit_group_separator.c_str();
 
	if (StrEmpty(separator)) separator = _langpack.langpack->digit_group_separator;
 
	FormatNumber(builder, number, separator);
 
}
 

	
 
static void FormatNoCommaNumber(StringBuilder &builder, int64_t number)
 
{
 
	fmt::format_to(builder, "{}", number);
 
}
 

	
 
static void FormatZerofillNumber(StringBuilder &builder, int64_t number, int count)
 
@@ -529,35 +517,41 @@ static void FormatGenericCurrency(String
 

	
 
	/* Add prefix part, following symbol_pos specification.
 
	 * Here, it can can be either 0 (prefix) or 2 (both prefix and suffix).
 
	 * The only remaining value is 1 (suffix), so everything that is not 1 */
 
	if (spec->symbol_pos != 1) builder += spec->prefix;
 

	
 
	NumberFormatSeparators *format = &_number_format_separators;
 
	StringID number_str = STR_NULL;
 

	
 
	/* For huge numbers, compact the number. */
 
	if (compact) {
 
		auto it = _number_abbreviations.begin();
 
		for (;;) {
 
			int64_t threshold = it->threshold;
 
			++it;
 
			if (it == _number_abbreviations.end()) break;
 

	
 
			int64_t divisor = it->threshold;
 
			threshold -= divisor / 2;
 

	
 
			if ((int64_t)number > threshold) {
 
				format = &it->format;
 
				number += divisor / 2;
 
				number /= divisor;
 
				break;
 
			}
 
		/* Take care of the thousand rounding. Having 1 000 000 k
 
		 * and 1 000 M is inconsistent, so always use 1 000 M. */
 
		if (number >= Money(1'000'000'000'000'000) - 500'000'000) {
 
			number = (number + Money(500'000'000'000)) / Money(1'000'000'000'000);
 
			number_str = STR_CURRENCY_SHORT_TERA;
 
		} else if (number >= Money(1'000'000'000'000) - 500'000) {
 
			number = (number + 500'000'000) / 1'000'000'000;
 
			number_str = STR_CURRENCY_SHORT_GIGA;
 
		} else if (number >= 1'000'000'000 - 500) {
 
			number = (number + 500'000) / 1'000'000;
 
			number_str = STR_CURRENCY_SHORT_MEGA;
 
		} else if (number >= 1'000'000) {
 
			number = (number + 500) / 1'000;
 
			number_str = STR_CURRENCY_SHORT_KILO;
 
		}
 
	}
 

	
 
	FormatNumber(builder, number, *format);
 
	const char *separator = _settings_game.locale.digit_group_separator_currency.c_str();
 
	if (StrEmpty(separator)) separator = _currency->separator.c_str();
 
	if (StrEmpty(separator)) separator = _langpack.langpack->digit_group_separator_currency;
 
	FormatNumber(builder, number, separator);
 
	if (number_str != STR_NULL) {
 
		auto tmp_params = ArrayStringParameters<0>();
 
		FormatString(builder, GetStringPtr(number_str), tmp_params);
 
	}
 

	
 
	/* Add suffix part, following symbol_pos specification.
 
	 * Here, it can can be either 1 (suffix) or 2 (both prefix and suffix).
 
	 * The only remaining value is 1 (prefix), so everything that is not 0 */
 
	if (spec->symbol_pos != 0) builder += spec->suffix;
 

	
 
@@ -1192,27 +1186,27 @@ static void FormatString(StringBuilder &
 
					}
 
					next_substr_case_index = 0;
 
					break;
 
				}
 

	
 
				case SCC_COMMA: // {COMMA}
 
					FormatNumber(builder, args.GetNextParameter<int64_t>(), _number_format_separators);
 
					FormatCommaNumber(builder, args.GetNextParameter<int64_t>());
 
					break;
 

	
 
				case SCC_DECIMAL: { // {DECIMAL}
 
					int64_t number = args.GetNextParameter<int64_t>();
 
					int digits = args.GetNextParameter<int>();
 
					if (digits == 0) {
 
						FormatNumber(builder, number, _number_format_separators);
 
						FormatCommaNumber(builder, number);
 
						break;
 
					}
 

	
 
					int64_t divisor = PowerOfTen(digits);
 
					int64_t fractional = number % divisor;
 
					number /= divisor;
 
					FormatNumber(builder, number, _number_format_separators);
 
					FormatCommaNumber(builder, number);
 
					fmt::format_to(builder, "{}{:0{}d}", GetDecimalSeparator(), fractional, digits);
 
					break;
 
				}
 

	
 
				case SCC_NUM: // {NUM}
 
					FormatNoCommaNumber(builder, args.GetNextParameter<int64_t>());
 
@@ -1253,13 +1247,13 @@ static void FormatString(StringBuilder &
 
						default: {
 
							amount = args.GetNextParameter<int64_t>();
 
							break;
 
						}
 
					}
 

	
 
					FormatNumber(builder, amount, _number_format_separators);
 
					FormatCommaNumber(builder, amount);
 
					break;
 
				}
 

	
 
				case SCC_CARGO_SHORT: { // {CARGO_SHORT}
 
					/* Short description of cargotypes. Layout:
 
					 * param 1: cargo type
 
@@ -1891,14 +1885,14 @@ bool LanguagePackHeader::IsValid() const
 
	       this->newgrflangid < MAX_LANG &&
 
	       this->num_genders  < MAX_NUM_GENDERS &&
 
	       this->num_cases    < MAX_NUM_CASES &&
 
	       StrValid(this->name,                           lastof(this->name)) &&
 
	       StrValid(this->own_name,                       lastof(this->own_name)) &&
 
	       StrValid(this->isocode,                        lastof(this->isocode)) &&
 
	       StrValid(this->number_format,                  lastof(this->number_format)) &&
 
	       StrValid(this->number_abbreviations,           lastof(this->number_abbreviations)) &&
 
	       StrValid(this->digit_group_separator,          lastof(this->digit_group_separator)) &&
 
	       StrValid(this->digit_group_separator_currency, lastof(this->digit_group_separator_currency)) &&
 
	       StrValid(this->digit_decimal_separator,        lastof(this->digit_decimal_separator));
 
}
 

	
 
/**
 
 * Check whether a translation is sufficiently finished to offer it to the public.
 
 */
 
@@ -1988,14 +1982,12 @@ bool ReadLanguagePack(const LanguageMeta
 
	/* Avoid using the collator if it is not correctly set. */
 
	if (U_FAILURE(status)) {
 
		_current_collator.reset();
 
	}
 
#endif /* WITH_ICU_I18N */
 

	
 
	InitializeNumberFormats();
 

	
 
	Layouter::Initialize();
 

	
 
	/* Some lists need to be sorted again after a language change. */
 
	ReconsiderGameScriptLanguage();
 
	InitializeSortedCargoSpecs();
 
	SortIndustryTypes();
src/table/settings/currency_settings.ini
Show inline comments
 
@@ -40,12 +40,18 @@ startup  = false
 
var      = rate
 
type     = SLE_UINT16
 
def      = 1
 
min      = 0
 
max      = UINT16_MAX
 

	
 
[SDT_SSTR]
 
var      = separator
 
type     = SLE_STRQ
 
def      = "".""
 
cat      = SC_BASIC
 

	
 
[SDT_VAR]
 
var      = to_euro
 
type     = SLE_INT32
 
def      = 0
 
min      = CalendarTime::MIN_YEAR
 
max      = CalendarTime::MAX_YEAR
src/table/settings/gui_settings.ini
Show inline comments
 
@@ -13,26 +13,24 @@ static void v_PositionStatusbar(int32_t 
 
static void RedrawSmallmap(int32_t new_value);
 
static void UpdateLinkgraphColours(int32_t new_value);
 
static void InvalidateCompanyLiveryWindow(int32_t new_value);
 
static void InvalidateNewGRFChangeWindows(int32_t new_value);
 
static void ZoomMinMaxChanged(int32_t new_value);
 
static void SpriteZoomMinChanged(int32_t new_value);
 
void InitializeNumberFormats();
 

	
 
static constexpr std::initializer_list<const char*> _osk_activation{"disabled", "double", "single", "immediately"};
 
static constexpr std::initializer_list<const char*> _savegame_date{"long", "short", "iso"};
 
static constexpr std::initializer_list<const char*> _right_click_close{"no", "yes", "except sticky"};
 

	
 
static const SettingVariant _gui_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDTC_BOOL  =  SDTC_BOOL(              $var,        $flags, $def,                              $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_OMANY = SDTC_OMANY(              $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_VAR   =   SDTC_VAR(              $var, $type, $flags, $def,       $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_SSTR  =  SDTC_SSTR(              $var, $type, $flags, $def,             0,                                        $pre_cb, $post_cb,                             $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 
SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 

	
 
[defaults]
 
@@ -902,30 +900,6 @@ var      = gui.scale_bevels
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
def      = true
 
post_cb  = [](auto) { SetupWidgetDimensions(); ReInitAllWindows(true); }
 
cat      = SC_BASIC
 
startup  = true
 

	
 
[SDTC_SSTR]
 
var      = gui.number_format
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
type     = SLE_STRQ
 
def      = nullptr
 
pre_cb   = [](auto format) { NumberFormatSeparators separators; return !ParseNumberFormatSeparators(separators, format).has_value(); }
 
post_cb  = [](auto) { InitializeNumberFormats(); MarkWholeScreenDirty(); }
 
startup  = true
 

	
 
[SDTC_SSTR]
 
var      = gui.number_abbreviations
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
type     = SLE_STRQ
 
def      = nullptr
 
pre_cb   = [](auto format) { NumberAbbreviations abbreviations; return !ParseNumberAbbreviations(abbreviations, format).has_value(); }
 
post_cb  = [](auto) { InitializeNumberFormats(); MarkWholeScreenDirty(); }
 
startup  = true
 

	
 
[SDTC_SSTR]
 
var      = gui.digit_decimal_separator
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
type     = SLE_STRQ
 
def      = nullptr
 
post_cb  = [](auto) { MarkWholeScreenDirty(); }
src/table/settings/locale_settings.ini
Show inline comments
 
@@ -20,12 +20,13 @@ static_assert(_locale_currencies.size() 
 
static const SettingVariant _locale_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDTG_OMANY = SDTG_OMANY($name,              $type, $flags, $var, $def,       $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 
SDT_OMANY  =  SDT_OMANY(GameSettings, $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
 
SDT_SSTR   =   SDT_SSTR(GameSettings, $var, $type, $flags, $def,                                                       $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDTG_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 
SDT_OMANY = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
 

	
 
[defaults]
 
@@ -165,6 +166,33 @@ max      = 2
 
full     = _locale_units
 
post_cb  = [](auto) { MarkWholeScreenDirty(); }
 
cat      = SC_BASIC
 
str      = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT
 
strhelp  = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_HELPTEXT
 
strval   = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_IMPERIAL
 

	
 
[SDT_SSTR]
 
var      = locale.digit_group_separator
 
type     = SLE_STRQ
 
from     = SLV_118
 
flags    = SF_NO_NETWORK_SYNC
 
def      = nullptr
 
post_cb  = [](auto) { MarkWholeScreenDirty(); }
 
cat      = SC_BASIC
 

	
 
[SDT_SSTR]
 
var      = locale.digit_group_separator_currency
 
type     = SLE_STRQ
 
from     = SLV_118
 
flags    = SF_NO_NETWORK_SYNC
 
def      = nullptr
 
post_cb  = [](auto) { MarkWholeScreenDirty(); }
 
cat      = SC_BASIC
 

	
 
[SDT_SSTR]
 
var      = locale.digit_decimal_separator
 
type     = SLE_STRQ
 
from     = SLV_126
 
flags    = SF_NO_NETWORK_SYNC
 
def      = nullptr
 
post_cb  = [](auto) { MarkWholeScreenDirty(); }
 
cat      = SC_BASIC
src/table/settings/old_gameopt_settings.ini
Show inline comments
 
@@ -29,12 +29,13 @@ static const SettingVariant _old_gameopt
 
 * for savegames version 0 - though it is an array, it has to go through the byteswap process */
 
[post-amble]
 
};
 
[templates]
 
SDTG_LIST    =  SDTG_LIST($name,              $type, $flags, $var, $def, $length, $from, $to, $cat, $extra, $startup),
 
SDTG_VAR     =   SDTG_VAR($name,              $type, $flags, $var, $def, $min, $max, $interval,  $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
 
SDT_NULL     =   SDT_NULL(                                                          $length,                                                            $from, $to),
 
SDTC_OMANY   = SDTC_OMANY(              $var, $type, $flags, $def,       $max, $full,            $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 
SDTG_OMANY   = SDTG_OMANY($name,              $type, $flags, $var, $def, $max, $full,            $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 
SDT_OMANY    =  SDT_OMANY(GameSettings, $var, $type, $flags, $def,       $max, $full,            $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
 
SDT_VAR      =    SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max,        $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
src/widgets/settings_widget.h
Show inline comments
 
@@ -79,12 +79,14 @@ enum GameSettingsWidgets : WidgetID {
 

	
 
/** Widgets of the #CustomCurrencyWindow class. */
 
enum CustomCurrencyWidgets : WidgetID {
 
	WID_CC_RATE_DOWN,      ///< Down button.
 
	WID_CC_RATE_UP,        ///< Up button.
 
	WID_CC_RATE,           ///< Rate of currency.
 
	WID_CC_SEPARATOR_EDIT, ///< Separator edit button.
 
	WID_CC_SEPARATOR,      ///< Current separator.
 
	WID_CC_PREFIX_EDIT,    ///< Prefix edit button.
 
	WID_CC_PREFIX,         ///< Current prefix.
 
	WID_CC_SUFFIX_EDIT,    ///< Suffix edit button.
 
	WID_CC_SUFFIX,         ///< Current suffix.
 
	WID_CC_YEAR_DOWN,      ///< Down button.
 
	WID_CC_YEAR_UP,        ///< Up button.
0 comments (0 inline, 0 general)