diff --git a/src/currency.cpp b/src/currency.cpp --- a/src/currency.cpp +++ b/src/currency.cpp @@ -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 */ diff --git a/src/currency.h b/src/currency.h --- a/src/currency.h +++ b/src/currency.h @@ -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) { } }; diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -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 diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -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 diff --git a/src/lang/basque.txt b/src/lang/basque.txt --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -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 diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -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 diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -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 diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -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 diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -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 diff --git a/src/lang/chuvash.txt b/src/lang/chuvash.txt --- a/src/lang/chuvash.txt +++ b/src/lang/chuvash.txt @@ -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 diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -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 diff --git a/src/lang/czech.txt b/src/lang/czech.txt --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -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 diff --git a/src/lang/danish.txt b/src/lang/danish.txt --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -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 diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -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 diff --git a/src/lang/english.txt b/src/lang/english.txt --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -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} diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -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 diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -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 diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -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 diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -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 diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -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 diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -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 diff --git a/src/lang/french.txt b/src/lang/french.txt --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -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 diff --git a/src/lang/frisian.txt b/src/lang/frisian.txt --- a/src/lang/frisian.txt +++ b/src/lang/frisian.txt @@ -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 diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -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 diff --git a/src/lang/galician.txt b/src/lang/galician.txt --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -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 diff --git a/src/lang/german.txt b/src/lang/german.txt --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -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 diff --git a/src/lang/greek.txt b/src/lang/greek.txt --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -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 diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -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 diff --git a/src/lang/hindi.txt b/src/lang/hindi.txt --- a/src/lang/hindi.txt +++ b/src/lang/hindi.txt @@ -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 diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -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 diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -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 diff --git a/src/lang/ido.txt b/src/lang/ido.txt --- a/src/lang/ido.txt +++ b/src/lang/ido.txt @@ -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 diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -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 diff --git a/src/lang/irish.txt b/src/lang/irish.txt --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -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 diff --git a/src/lang/italian.txt b/src/lang/italian.txt --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -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 diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -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 diff --git a/src/lang/korean.txt b/src/lang/korean.txt --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -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 diff --git a/src/lang/latin.txt b/src/lang/latin.txt --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -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 diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -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 diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -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 diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -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 diff --git a/src/lang/macedonian.txt b/src/lang/macedonian.txt --- a/src/lang/macedonian.txt +++ b/src/lang/macedonian.txt @@ -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 diff --git a/src/lang/malay.txt b/src/lang/malay.txt --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -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 diff --git a/src/lang/maltese.txt b/src/lang/maltese.txt --- a/src/lang/maltese.txt +++ b/src/lang/maltese.txt @@ -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 diff --git a/src/lang/marathi.txt b/src/lang/marathi.txt --- a/src/lang/marathi.txt +++ b/src/lang/marathi.txt @@ -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 diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -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 diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -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 diff --git a/src/lang/persian.txt b/src/lang/persian.txt --- a/src/lang/persian.txt +++ b/src/lang/persian.txt @@ -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 diff --git a/src/lang/polish.txt b/src/lang/polish.txt --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -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 diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -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 diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -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 diff --git a/src/lang/russian.txt b/src/lang/russian.txt --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -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 diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -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 diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -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 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -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 diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -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 diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -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 diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -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 diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -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 diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -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 diff --git a/src/lang/thai.txt b/src/lang/thai.txt --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -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 diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -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 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -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 diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -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 diff --git a/src/lang/urdu.txt b/src/lang/urdu.txt --- a/src/lang/urdu.txt +++ b/src/lang/urdu.txt @@ -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 diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -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 diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -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 diff --git a/src/language.h b/src/language.h --- a/src/language.h +++ b/src/language.h @@ -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 _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; -/** 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; - bool ReadLanguagePack(const LanguageMetadata *lang); const LanguageMetadata *GetLanguage(byte newgrflangid); -std::optional ParseNumberFormatSeparators(NumberFormatSeparators &separators, std::string_view format, size_t length = DIGITS_IN_UINT64_T); -std::optional ParseNumberAbbreviations(NumberAbbreviations &abbreviations, std::string_view input); - #endif /* LANGUAGE_H */ diff --git a/src/newgrf.cpp b/src/newgrf.cpp --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -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); diff --git a/src/saveload/compat/settings_sl_compat.h b/src/saveload/compat/settings_sl_compat.h --- a/src/saveload/compat/settings_sl_compat.h +++ b/src/saveload/compat/settings_sl_compat.h @@ -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 */ diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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(), diff --git a/src/settings_table.cpp b/src/settings_table.cpp --- a/src/settings_table.cpp +++ b/src/settings_table.cpp @@ -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" diff --git a/src/settings_type.h b/src/settings_type.h --- a/src/settings_type.h +++ b/src/settings_type.h @@ -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 */ diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -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)); diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -16,7 +16,7 @@ #include "../table/control_codes.h" #include "strgen.h" -#include + #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 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 ParseNumberAbbreviations(NumberAbbreviations &abbreviations, std::string_view input) -{ - abbreviations.clear(); - - std::map 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; -} diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -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 _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(), _number_format_separators); + FormatCommaNumber(builder, args.GetNextParameter()); break; case SCC_DECIMAL: { // {DECIMAL} int64_t number = args.GetNextParameter(); int digits = args.GetNextParameter(); 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. */ diff --git a/src/table/settings/currency_settings.ini b/src/table/settings/currency_settings.ini --- a/src/table/settings/currency_settings.ini +++ b/src/table/settings/currency_settings.ini @@ -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 diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini --- a/src/table/settings/gui_settings.ini +++ b/src/table/settings/gui_settings.ini @@ -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 _osk_activation{"disabled", "double", "single", "immediately"}; static constexpr std::initializer_list _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(); } diff --git a/src/table/settings/locale_settings.ini b/src/table/settings/locale_settings.ini --- a/src/table/settings/locale_settings.ini +++ b/src/table/settings/locale_settings.ini @@ -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 diff --git a/src/table/settings/old_gameopt_settings.ini b/src/table/settings/old_gameopt_settings.ini --- a/src/table/settings/old_gameopt_settings.ini +++ b/src/table/settings/old_gameopt_settings.ini @@ -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), diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h --- a/src/widgets/settings_widget.h +++ b/src/widgets/settings_widget.h @@ -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.