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
 
@@ -21,55 +21,55 @@
 

	
 
#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 */
src/currency.h
Show inline comments
 
@@ -73,6 +73,7 @@ enum Currencies {
 
/** 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.
 
@@ -91,8 +92,8 @@ struct CurrencySpec {
 

	
 
	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)
 
	{
 
	}
 
};
src/lang/afrikaans.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/arabic_egypt.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/basque.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/belarusian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/brazilian_portuguese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/bulgarian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/catalan.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/chuvash.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/croatian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/czech.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/danish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/dutch.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/english.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
 
@@ -1117,6 +1117,9 @@ 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}
 
@@ -5807,6 +5810,11 @@ STR_TOWN_NAME                           
 
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}
src/lang/english_AU.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/english_US.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/esperanto.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/estonian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/faroese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/finnish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/french.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/frisian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/gaelic.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/galician.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/german.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/greek.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/hebrew.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/hindi.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/hungarian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/icelandic.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/ido.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/indonesian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/irish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/italian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/japanese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/korean.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/latin.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/latvian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/lithuanian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/luxembourgish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/macedonian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/malay.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/maltese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/marathi.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/norwegian_bokmal.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/norwegian_nynorsk.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/persian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/polish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/portuguese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/romanian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/russian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/serbian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/simplified_chinese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/slovak.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/slovenian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/spanish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/spanish_MX.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/swedish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/tamil.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/thai.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/traditional_chinese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/turkish.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/ukrainian.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/urdu.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/vietnamese.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/lang/welsh.txt
Show inline comments
 
@@ -3,8 +3,8 @@
 
##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
src/language.h
Show inline comments
 
@@ -31,10 +31,10 @@ struct LanguagePackHeader {
 
	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.
 
@@ -107,28 +107,7 @@ extern const LanguageMetadata *_current_
 
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
 
@@ -2746,7 +2746,8 @@ static ChangeInfoResult GlobalVarChangeI
 
				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);
src/saveload/compat/settings_sl_compat.h
Show inline comments
 
@@ -258,9 +258,9 @@ const SaveLoadCompat _settings_sl_compat
 
	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
 
@@ -2989,6 +2989,7 @@ struct CustomCurrencyWindow : Window {
 
	{
 
		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:
 
@@ -3014,6 +3015,7 @@ struct CustomCurrencyWindow : Window {
 
				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});
 
@@ -3056,6 +3058,14 @@ struct CustomCurrencyWindow : Window {
 
				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);
 
@@ -3111,6 +3121,10 @@ struct CustomCurrencyWindow : Window {
 
				_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;
 
@@ -3152,6 +3166,10 @@ static constexpr NWidgetPart _nested_cus
 
					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(),
src/settings_table.cpp
Show inline comments
 
@@ -50,7 +50,6 @@
 
#include "void_map.h"
 
#include "station_func.h"
 
#include "station_base.h"
 
#include "language.h"
 

	
 
#include "table/strings.h"
 
#include "table/settings.h"
src/settings_type.h
Show inline comments
 
@@ -222,10 +222,6 @@ struct GUISettings {
 

	
 
	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
 
@@ -269,6 +265,9 @@ struct LocaleSettings {
 
	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 */
src/strgen/strgen.cpp
Show inline comments
 
@@ -121,22 +121,12 @@ void FileStringReader::HandlePragma(char
 
		} 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));
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -16,7 +16,7 @@
 
#include "../table/control_codes.h"
 

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

	
 

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

	
 
@@ -756,8 +756,8 @@ void StringReader::ParseFile()
 

	
 
	/* 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;
 
@@ -980,113 +980,3 @@ void LanguageWriter::WriteLang(const Str
 
		}
 
	}
 
}
 

	
 
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
 
@@ -55,9 +55,6 @@ const LanguageMetadata *_current_languag
 

	
 
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 */
 
@@ -382,62 +379,53 @@ void SetDParamStr(size_t n, std::string 
 

	
 
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);
 
@@ -532,29 +520,35 @@ static void FormatGenericCurrency(String
 
	 * 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).
 
@@ -1195,21 +1189,21 @@ static void FormatString(StringBuilder &
 
				}
 

	
 
				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;
 
				}
 
@@ -1256,7 +1250,7 @@ static void FormatString(StringBuilder &
 
						}
 
					}
 

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

	
 
@@ -1894,8 +1888,8 @@ bool LanguagePackHeader::IsValid() const
 
	       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));
 
}
 

	
 
@@ -1991,8 +1985,6 @@ bool ReadLanguagePack(const LanguageMeta
 
	}
 
#endif /* WITH_ICU_I18N */
 

	
 
	InitializeNumberFormats();
 

	
 
	Layouter::Initialize();
 

	
 
	/* Some lists need to be sorted again after a language change. */
src/table/settings/currency_settings.ini
Show inline comments
 
@@ -43,6 +43,12 @@ 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
src/table/settings/gui_settings.ini
Show inline comments
 
@@ -16,7 +16,6 @@ static void InvalidateCompanyLiveryWindo
 
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"};
 
@@ -29,7 +28,6 @@ static const SettingVariant _gui_setting
 
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");
 
@@ -905,27 +903,3 @@ post_cb  = [](auto) { SetupWidgetDimensi
 
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
 
@@ -23,6 +23,7 @@ static const SettingVariant _locale_sett
 
[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");
 
@@ -168,3 +169,30 @@ 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
 
@@ -32,6 +32,7 @@ static const SettingVariant _old_gameopt
 
[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),
src/widgets/settings_widget.h
Show inline comments
 
@@ -82,6 +82,8 @@ 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.
0 comments (0 inline, 0 general)