mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r15696) -Codechange: move the NewGRF language ID into the language file instead of maintaining a table in the code.
This commit is contained in:
parent
f6e4bc765a
commit
eb0d43aadd
@ -2,6 +2,7 @@
|
|||||||
##ownname Jaybee
|
##ownname Jaybee
|
||||||
##isocode af_ZA
|
##isocode af_ZA
|
||||||
##winlangid 0x0436
|
##winlangid 0x0436
|
||||||
|
##grflangid 0x1b
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender male
|
##gender male
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Arabic (Egypt)
|
##ownname Arabic (Egypt)
|
||||||
##isocode ar_EG
|
##isocode ar_EG
|
||||||
##winlangid 0x0c01
|
##winlangid 0x0c01
|
||||||
|
##grflangid 0x14
|
||||||
##plural 1
|
##plural 1
|
||||||
##textdir rtl
|
##textdir rtl
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Português (BR)
|
##ownname Português (BR)
|
||||||
##isocode pt_BR
|
##isocode pt_BR
|
||||||
##winlangid 0x0416
|
##winlangid 0x0416
|
||||||
|
##grflangid 0x37
|
||||||
##plural 2
|
##plural 2
|
||||||
##gender m f
|
##gender m f
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Български
|
##ownname Български
|
||||||
##isocode bg_BG
|
##isocode bg_BG
|
||||||
##winlangid 0x0402
|
##winlangid 0x0402
|
||||||
|
##grflangid 0x18
|
||||||
##plural 0
|
##plural 0
|
||||||
##case m f n p
|
##case m f n p
|
||||||
##gender m f n p
|
##gender m f n p
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Català
|
##ownname Català
|
||||||
##isocode ca_ES
|
##isocode ca_ES
|
||||||
##winlangid 0x0403
|
##winlangid 0x0403
|
||||||
|
##grflangid 0x22
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Hrvatski
|
##ownname Hrvatski
|
||||||
##isocode hr_HR
|
##isocode hr_HR
|
||||||
##winlangid 0x041a
|
##winlangid 0x041a
|
||||||
|
##grflangid 0x38
|
||||||
##plural 6
|
##plural 6
|
||||||
##case nom gen dat aku vok lok ins
|
##case nom gen dat aku vok lok ins
|
||||||
##gender male female middle
|
##gender male female middle
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Čeština
|
##ownname Čeština
|
||||||
##isocode cs_CZ
|
##isocode cs_CZ
|
||||||
##winlangid 0x0405
|
##winlangid 0x0405
|
||||||
|
##grflangid 0x15
|
||||||
##plural 6
|
##plural 6
|
||||||
##case nom gen dat acc voc loc ins big small
|
##case nom gen dat acc voc loc ins big small
|
||||||
##gender m f n
|
##gender m f n
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Dansk
|
##ownname Dansk
|
||||||
##isocode da_DA
|
##isocode da_DA
|
||||||
##winlangid 0x0406
|
##winlangid 0x0406
|
||||||
|
##grflangid 0x2d
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Nederlands
|
##ownname Nederlands
|
||||||
##isocode nl_NL
|
##isocode nl_NL
|
||||||
##winlangid 0x0413
|
##winlangid 0x0413
|
||||||
|
##grflangid 0x1f
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname English (UK)
|
##ownname English (UK)
|
||||||
##isocode en_GB
|
##isocode en_GB
|
||||||
##winlangid 0x0809
|
##winlangid 0x0809
|
||||||
|
##grflangid 0x01
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname English (US)
|
##ownname English (US)
|
||||||
##isocode en_US
|
##isocode en_US
|
||||||
##winlangid 0x0409
|
##winlangid 0x0409
|
||||||
|
##grflangid 0x00
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Esperanto
|
##ownname Esperanto
|
||||||
##isocode eo_EO
|
##isocode eo_EO
|
||||||
##winlangid 0x0000
|
##winlangid 0x0000
|
||||||
|
##grflangid 0x05
|
||||||
##plural 0
|
##plural 0
|
||||||
##case n
|
##case n
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Eesti keel
|
##ownname Eesti keel
|
||||||
##isocode et_ET
|
##isocode et_ET
|
||||||
##winlangid 0x0425
|
##winlangid 0x0425
|
||||||
|
##grflangid 0x34
|
||||||
##plural 0
|
##plural 0
|
||||||
##case g in
|
##case g in
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Suomi
|
##ownname Suomi
|
||||||
##isocode fi_FI
|
##isocode fi_FI
|
||||||
##winlangid 0x040b
|
##winlangid 0x040b
|
||||||
|
##grflangid 0x35
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Français
|
##ownname Français
|
||||||
##isocode fr_FR
|
##isocode fr_FR
|
||||||
##winlangid 0x040c
|
##winlangid 0x040c
|
||||||
|
##grflangid 0x03
|
||||||
##plural 2
|
##plural 2
|
||||||
##gender m m2 f
|
##gender m m2 f
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Galego
|
##ownname Galego
|
||||||
##isocode gl_ES
|
##isocode gl_ES
|
||||||
##winlangid 0x0456
|
##winlangid 0x0456
|
||||||
|
##grflangid 0x31
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender m f n
|
##gender m f n
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Deutsch
|
##ownname Deutsch
|
||||||
##isocode de_DE
|
##isocode de_DE
|
||||||
##winlangid 0x0407
|
##winlangid 0x0407
|
||||||
|
##grflangid 0x02
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender m w n p
|
##gender m w n p
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname עברית
|
##ownname עברית
|
||||||
##isocode he_IL
|
##isocode he_IL
|
||||||
##winlangid 0x040d
|
##winlangid 0x040d
|
||||||
|
##grflangid 0x61
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender m f
|
##gender m f
|
||||||
##textdir rtl
|
##textdir rtl
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Magyar
|
##ownname Magyar
|
||||||
##isocode hu_HU
|
##isocode hu_HU
|
||||||
##winlangid 0x040e
|
##winlangid 0x040e
|
||||||
|
##grflangid 0x24
|
||||||
##plural 2
|
##plural 2
|
||||||
##case t ba
|
##case t ba
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Íslenska
|
##ownname Íslenska
|
||||||
##isocode is_IS
|
##isocode is_IS
|
||||||
##winlangid 0x040f
|
##winlangid 0x040f
|
||||||
|
##grflangid 0x29
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender karlkyn kvenkyn hvorugkyn
|
##gender karlkyn kvenkyn hvorugkyn
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Bahasa Indonesia
|
##ownname Bahasa Indonesia
|
||||||
##isocode id_ID
|
##isocode id_ID
|
||||||
##winlangid 0x0421
|
##winlangid 0x0421
|
||||||
|
##grflangid 0x5a
|
||||||
##plural 1
|
##plural 1
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Italiano
|
##ownname Italiano
|
||||||
##isocode it_IT
|
##isocode it_IT
|
||||||
##winlangid 0x0410
|
##winlangid 0x0410
|
||||||
|
##grflangid 0x27
|
||||||
##plural 0
|
##plural 0
|
||||||
##case ms mp fs fp
|
##case ms mp fs fp
|
||||||
##gender m f
|
##gender m f
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname 日本語
|
##ownname 日本語
|
||||||
##isocode ja_JP
|
##isocode ja_JP
|
||||||
##winlangid 0x0411
|
##winlangid 0x0411
|
||||||
|
##grflangid 0x39
|
||||||
##plural 1
|
##plural 1
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname 한국어
|
##ownname 한국어
|
||||||
##isocode ko_KR
|
##isocode ko_KR
|
||||||
##winlangid 0x0412
|
##winlangid 0x0412
|
||||||
|
##grflangid 0x3a
|
||||||
##plural 1
|
##plural 1
|
||||||
##gender m f
|
##gender m f
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Latviešu
|
##ownname Latviešu
|
||||||
##isocode lv_LV
|
##isocode lv_LV
|
||||||
##winlangid 0x0426
|
##winlangid 0x0426
|
||||||
|
##grflangid 0x2a
|
||||||
##plural 3
|
##plural 3
|
||||||
##case kas
|
##case kas
|
||||||
##gender m f
|
##gender m f
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Lietuvių
|
##ownname Lietuvių
|
||||||
##isocode lt_LT
|
##isocode lt_LT
|
||||||
##winlangid 0x0427
|
##winlangid 0x0427
|
||||||
|
##grflangid 0x2b
|
||||||
##plural 5
|
##plural 5
|
||||||
##case kas ko kam ka kuo kur kreip
|
##case kas ko kam ka kuo kur kreip
|
||||||
##gender vyr mot
|
##gender vyr mot
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Luxembourgish
|
##ownname Luxembourgish
|
||||||
##isocode lb_LU
|
##isocode lb_LU
|
||||||
##winlangid 0x046e
|
##winlangid 0x046e
|
||||||
|
##grflangid 0x23
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Norsk (bokmål)
|
##ownname Norsk (bokmål)
|
||||||
##isocode nb_NO
|
##isocode nb_NO
|
||||||
##winlangid 0x0414
|
##winlangid 0x0414
|
||||||
|
##grflangid 0x2f
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Norsk, Nynorsk
|
##ownname Norsk, Nynorsk
|
||||||
##isocode nn_NO
|
##isocode nn_NO
|
||||||
##winlangid 0x0814
|
##winlangid 0x0814
|
||||||
|
##grflangid 0x0e
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender masculine feminine neuter
|
##gender masculine feminine neuter
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Original vehicle names (ENG)
|
##ownname Original vehicle names (ENG)
|
||||||
##isocode xx_OV
|
##isocode xx_OV
|
||||||
##winlangid 0x0000
|
##winlangid 0x0000
|
||||||
|
##grflangid 0x01
|
||||||
|
|
||||||
##id 0x8000
|
##id 0x8000
|
||||||
STR_8000_KIRBY_PAUL_TANK_STEAM :Collett Pannier Tank (Steam)
|
STR_8000_KIRBY_PAUL_TANK_STEAM :Collett Pannier Tank (Steam)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Igpay atinlay
|
##ownname Igpay atinlay
|
||||||
##isocode xx_PL
|
##isocode xx_PL
|
||||||
##winlangid 0x0000
|
##winlangid 0x0000
|
||||||
|
##grflangid 0x01
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Polski
|
##ownname Polski
|
||||||
##isocode pl_PL
|
##isocode pl_PL
|
||||||
##winlangid 0x0415
|
##winlangid 0x0415
|
||||||
|
##grflangid 0x30
|
||||||
##plural 7
|
##plural 7
|
||||||
##case d c b n m w
|
##case d c b n m w
|
||||||
##gender m f n
|
##gender m f n
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Português
|
##ownname Português
|
||||||
##isocode pt_PT
|
##isocode pt_PT
|
||||||
##winlangid 0x0816
|
##winlangid 0x0816
|
||||||
|
##grflangid 0x36
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Românã
|
##ownname Românã
|
||||||
##isocode ro_RO
|
##isocode ro_RO
|
||||||
##winlangid 0x0418
|
##winlangid 0x0418
|
||||||
|
##grflangid 0x28
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Русский
|
##ownname Русский
|
||||||
##isocode ru_RU
|
##isocode ru_RU
|
||||||
##winlangid 0x0419
|
##winlangid 0x0419
|
||||||
|
##grflangid 0x07
|
||||||
##plural 6
|
##plural 6
|
||||||
##case m f n p
|
##case m f n p
|
||||||
##gender m f n p
|
##gender m f n p
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname 简体中文
|
##ownname 简体中文
|
||||||
##isocode zh_CN
|
##isocode zh_CN
|
||||||
##winlangid 0x0804
|
##winlangid 0x0804
|
||||||
|
##grflangid 0x56
|
||||||
##plural 1
|
##plural 1
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Slovensky
|
##ownname Slovensky
|
||||||
##isocode sk_SK
|
##isocode sk_SK
|
||||||
##winlangid 0x041b
|
##winlangid 0x041b
|
||||||
|
##grflangid 0x16
|
||||||
##plural 6
|
##plural 6
|
||||||
##case g
|
##case g
|
||||||
##gender m z s
|
##gender m z s
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Slovenščina
|
##ownname Slovenščina
|
||||||
##isocode sl_SL
|
##isocode sl_SL
|
||||||
##winlangid 0x0424
|
##winlangid 0x0424
|
||||||
|
##grflangid 0x2c
|
||||||
##plural 8
|
##plural 8
|
||||||
##case r d t
|
##case r d t
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Español (ES)
|
##ownname Español (ES)
|
||||||
##isocode es_ES
|
##isocode es_ES
|
||||||
##winlangid 0x0c0a
|
##winlangid 0x0c0a
|
||||||
|
##grflangid 0x04
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender masculino femenino
|
##gender masculino femenino
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Svenska
|
##ownname Svenska
|
||||||
##isocode sv_SE
|
##isocode sv_SE
|
||||||
##winlangid 0x081d
|
##winlangid 0x081d
|
||||||
|
##grflangid 0x2e
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname 繁體中文
|
##ownname 繁體中文
|
||||||
##isocode zh_TW
|
##isocode zh_TW
|
||||||
##winlangid 0x0404
|
##winlangid 0x0404
|
||||||
|
##grflangid 0x0c
|
||||||
##plural 1
|
##plural 1
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Türkçe
|
##ownname Türkçe
|
||||||
##isocode tr_TR
|
##isocode tr_TR
|
||||||
##winlangid 0x041f
|
##winlangid 0x041f
|
||||||
|
##grflangid 0x3e
|
||||||
##plural 1
|
##plural 1
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Українська
|
##ownname Українська
|
||||||
##isocode uk_UA
|
##isocode uk_UA
|
||||||
##winlangid 0x0422
|
##winlangid 0x0422
|
||||||
|
##grflangid 0x33
|
||||||
##plural 6
|
##plural 6
|
||||||
##gender m f s mn
|
##gender m f s mn
|
||||||
##case r d z
|
##case r d z
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Frysk
|
##ownname Frysk
|
||||||
##isocode fy_NL
|
##isocode fy_NL
|
||||||
##winlangid 0x0462
|
##winlangid 0x0462
|
||||||
|
##grflangid 0x32
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Ελληνικά
|
##ownname Ελληνικά
|
||||||
##isocode el_GR
|
##isocode el_GR
|
||||||
##winlangid 0x0408
|
##winlangid 0x0408
|
||||||
|
##grflangid 0x1e
|
||||||
##plural 0
|
##plural 0
|
||||||
##gender m f n
|
##gender m f n
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
##name Ido
|
##name Ido
|
||||||
##ownname Ido
|
##ownname Ido
|
||||||
##isocode io_XX
|
##isocode io_IO
|
||||||
##winlangid 0x0000
|
##winlangid 0x0000
|
||||||
|
##grflangid 0x06
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Македонски
|
##ownname Македонски
|
||||||
##isocode mk_MK
|
##isocode mk_MK
|
||||||
##winlangid 0x042f
|
##winlangid 0x042f
|
||||||
|
##grflangid 0x26
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Melayu
|
##ownname Melayu
|
||||||
##isocode ms_MY
|
##isocode ms_MY
|
||||||
##winlangid 0x043a
|
##winlangid 0x043a
|
||||||
|
##grflangid 0x3c
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname فارسی
|
##ownname فارسی
|
||||||
##isocode fa_IR
|
##isocode fa_IR
|
||||||
##winlangid 0x0429
|
##winlangid 0x0429
|
||||||
|
##grflangid 0x62
|
||||||
##plural 0
|
##plural 0
|
||||||
##textdir rtl
|
##textdir rtl
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
##name Serbian
|
##name Serbian
|
||||||
##ownname Srpski
|
##ownname Srpski
|
||||||
##isocode srp
|
##isocode sr_RS
|
||||||
##winlangid 0x7c1a
|
##winlangid 0x7c1a
|
||||||
|
##grflangid 0x0d
|
||||||
##plural 6
|
##plural 6
|
||||||
##case nom big gen dat aku vok lok ins
|
##case nom big gen dat aku vok lok ins
|
||||||
##gender muški ženski srednji
|
##gender muški ženski srednji
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Thai
|
##ownname Thai
|
||||||
##isocode th_TH
|
##isocode th_TH
|
||||||
##winlangid 0x041e
|
##winlangid 0x041e
|
||||||
|
##grflangid 0x42
|
||||||
##plural 1
|
##plural 1
|
||||||
##textdir ltr
|
##textdir ltr
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Urdu
|
##ownname Urdu
|
||||||
##isocode ur_PK
|
##isocode ur_PK
|
||||||
##winlangid 0x0420
|
##winlangid 0x0420
|
||||||
|
##grflangid 0x5c
|
||||||
##plural 0
|
##plural 0
|
||||||
##textdir rtl
|
##textdir rtl
|
||||||
##gender m f
|
##gender m f
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
##ownname Cymraeg
|
##ownname Cymraeg
|
||||||
##isocode cy_GB
|
##isocode cy_GB
|
||||||
##winlangid 0x0452
|
##winlangid 0x0452
|
||||||
|
##grflangid 0x0f
|
||||||
##plural 0
|
##plural 0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* the grf base will not be used in order to find the string, but rather for
|
* the grf base will not be used in order to find the string, but rather for
|
||||||
* jumping from standard langID scheme to the new one.
|
* jumping from standard langID scheme to the new one.
|
||||||
*/
|
*/
|
||||||
enum grf_base_languages {
|
enum GRFBaseLanguages {
|
||||||
GRFLB_AMERICAN = 0x01,
|
GRFLB_AMERICAN = 0x01,
|
||||||
GRFLB_ENGLISH = 0x02,
|
GRFLB_ENGLISH = 0x02,
|
||||||
GRFLB_GERMAN = 0x04,
|
GRFLB_GERMAN = 0x04,
|
||||||
@ -36,101 +36,15 @@ enum grf_base_languages {
|
|||||||
GRFLB_GENERIC = 0x80,
|
GRFLB_GENERIC = 0x80,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum grf_extended_languages {
|
enum GRFExtendedLanguages {
|
||||||
GRFLX_AMERICAN = 0x00,
|
GRFLX_AMERICAN = 0x00,
|
||||||
GRFLX_ENGLISH = 0x01,
|
GRFLX_ENGLISH = 0x01,
|
||||||
GRFLX_GERMAN = 0x02,
|
GRFLX_GERMAN = 0x02,
|
||||||
GRFLX_FRENCH = 0x03,
|
GRFLX_FRENCH = 0x03,
|
||||||
GRFLX_SPANISH = 0x04,
|
GRFLX_SPANISH = 0x04,
|
||||||
GRFLX_ESPERANTO = 0x05,
|
|
||||||
GRFLX_RUSSIAN = 0x07,
|
|
||||||
GRFLX_CZECH = 0x15,
|
|
||||||
GRFLX_SLOVAK = 0x16,
|
|
||||||
GRFLX_BULGARIAN = 0x18,
|
|
||||||
GRFLX_AFRIKAANS = 0x1B,
|
|
||||||
GRFLX_GREEK = 0x1E,
|
|
||||||
GRFLX_DUTCH = 0x1F,
|
|
||||||
GRFLX_CATALAN = 0x22,
|
|
||||||
GRFLX_HUNGARIAN = 0x24,
|
|
||||||
GRFLX_ITALIAN = 0x27,
|
|
||||||
GRFLX_ROMANIAN = 0x28,
|
|
||||||
GRFLX_ICELANDIC = 0x29,
|
|
||||||
GRFLX_LATVIAN = 0x2A,
|
|
||||||
GRFLX_LITHUANIAN = 0x2B,
|
|
||||||
GRFLX_SLOVENIAN = 0x2C,
|
|
||||||
GRFLX_DANISH = 0x2D,
|
|
||||||
GRFLX_SWEDISH = 0x2E,
|
|
||||||
GRFLX_NORWEGIAN = 0x2F,
|
|
||||||
GRFLX_POLISH = 0x30,
|
|
||||||
GRFLX_GALICIAN = 0x31,
|
|
||||||
GRFLX_FRISIAN = 0x32,
|
|
||||||
GRFLX_UKRAINIAN = 0x33,
|
|
||||||
GRFLX_ESTONIAN = 0x34,
|
|
||||||
GRFLX_FINNISH = 0x35,
|
|
||||||
GRFLX_PORTUGUESE = 0x36,
|
|
||||||
GRFLX_BRAZILIAN = 0x37,
|
|
||||||
GRFLX_CROATIAN = 0x38,
|
|
||||||
GRFLX_JAPANESE = 0x39,
|
|
||||||
GRFLX_KOREAN = 0x3A,
|
|
||||||
GRFLX_TURKISH = 0x3E,
|
|
||||||
GRFLX_UNSPECIFIED = 0x7F,
|
GRFLX_UNSPECIFIED = 0x7F,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct iso_grf {
|
|
||||||
char code[6];
|
|
||||||
byte grfLangID;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ISO code VS NewGrf langID conversion array.
|
|
||||||
* This array is used in two ways:
|
|
||||||
* 1-its ISO part is matching OpenTTD dynamic language id
|
|
||||||
* with newgrf bit positionning language id
|
|
||||||
* 2-its shift part is used to know what is the shift to
|
|
||||||
* watch for when inserting new strings, hence analysing newgrf langid
|
|
||||||
*/
|
|
||||||
const iso_grf iso_codes[] = {
|
|
||||||
{"en_US", GRFLX_AMERICAN},
|
|
||||||
{"en_GB", GRFLX_ENGLISH},
|
|
||||||
{"de_DE", GRFLX_GERMAN},
|
|
||||||
{"fr_FR", GRFLX_FRENCH},
|
|
||||||
{"es_ES", GRFLX_SPANISH},
|
|
||||||
{"af_ZA", GRFLX_AFRIKAANS},
|
|
||||||
{"hr_HR", GRFLX_CROATIAN},
|
|
||||||
{"cs_CZ", GRFLX_CZECH},
|
|
||||||
{"ca_ES", GRFLX_CATALAN},
|
|
||||||
{"da_DA", GRFLX_DANISH},
|
|
||||||
{"nl_NL", GRFLX_DUTCH},
|
|
||||||
{"et_ET", GRFLX_ESTONIAN},
|
|
||||||
{"fi_FI", GRFLX_FINNISH},
|
|
||||||
{"fy_NL", GRFLX_FRISIAN},
|
|
||||||
{"gl_ES", GRFLX_GALICIAN},
|
|
||||||
{"el_GR", GRFLX_GREEK},
|
|
||||||
{"hu_HU", GRFLX_HUNGARIAN},
|
|
||||||
{"is_IS", GRFLX_ICELANDIC},
|
|
||||||
{"it_IT", GRFLX_ITALIAN},
|
|
||||||
{"lv_LV", GRFLX_LATVIAN},
|
|
||||||
{"lt_LT", GRFLX_LITHUANIAN},
|
|
||||||
{"nb_NO", GRFLX_NORWEGIAN},
|
|
||||||
{"pl_PL", GRFLX_POLISH},
|
|
||||||
{"pt_PT", GRFLX_PORTUGUESE},
|
|
||||||
{"pt_BR", GRFLX_BRAZILIAN},
|
|
||||||
{"ro_RO", GRFLX_ROMANIAN},
|
|
||||||
{"ru_RU", GRFLX_RUSSIAN},
|
|
||||||
{"sk_SK", GRFLX_SLOVAK},
|
|
||||||
{"sl_SL", GRFLX_SLOVENIAN},
|
|
||||||
{"sv_SE", GRFLX_SWEDISH},
|
|
||||||
{"tr_TR", GRFLX_TURKISH},
|
|
||||||
{"uk_UA", GRFLX_UKRAINIAN},
|
|
||||||
{"eo_EO", GRFLX_ESPERANTO},
|
|
||||||
{"bg_BG", GRFLX_BULGARIAN},
|
|
||||||
{"ja_JP", GRFLX_JAPANESE},
|
|
||||||
{"ko_KR", GRFLX_KOREAN},
|
|
||||||
{"gen", GRFLB_GENERIC} ///< this is not iso code, but there has to be something...
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Element of the linked list.
|
* Element of the linked list.
|
||||||
* Each of those elements represent the string,
|
* Each of those elements represent the string,
|
||||||
@ -453,26 +367,13 @@ const char *GetGRFStringPtr(uint16 stringid)
|
|||||||
* Equivalence Setter function between game and newgrf langID.
|
* Equivalence Setter function between game and newgrf langID.
|
||||||
* This function will adjust _currentLangID as to what is the LangID
|
* This function will adjust _currentLangID as to what is the LangID
|
||||||
* of the current language set by the user.
|
* of the current language set by the user.
|
||||||
* The array iso_codes will be used to find that match.
|
|
||||||
* If not found, it will have to be standard english
|
|
||||||
* This function is called after the user changed language,
|
* This function is called after the user changed language,
|
||||||
* from strings.cpp:ReadLanguagePack
|
* from strings.cpp:ReadLanguagePack
|
||||||
* @param iso_name iso code of current selection
|
* @param langauge_id iso code of current selection
|
||||||
*/
|
*/
|
||||||
void SetCurrentGrfLangID(const char *iso_name)
|
void SetCurrentGrfLangID(byte language_id)
|
||||||
{
|
{
|
||||||
/* Use English by default, if we can't match up the iso_code. */
|
_currentLangID = language_id;
|
||||||
byte ret = GRFLX_ENGLISH;
|
|
||||||
byte i;
|
|
||||||
|
|
||||||
for (i=0; i < lengthof(iso_codes); i++) {
|
|
||||||
if (strncmp(iso_codes[i].code, iso_name, strlen(iso_codes[i].code)) == 0) {
|
|
||||||
/* We found a match, so let's use it. */
|
|
||||||
ret = iso_codes[i].grfLangID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_currentLangID = ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckGrfLangID(byte lang_id, byte grf_version)
|
bool CheckGrfLangID(byte lang_id, byte grf_version)
|
||||||
|
@ -9,7 +9,7 @@ StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, bool new_schem
|
|||||||
StringID GetGRFStringID(uint32 grfid, uint16 stringid);
|
StringID GetGRFStringID(uint32 grfid, uint16 stringid);
|
||||||
const char *GetGRFStringPtr(uint16 stringid);
|
const char *GetGRFStringPtr(uint16 stringid);
|
||||||
void CleanUpStrings();
|
void CleanUpStrings();
|
||||||
void SetCurrentGrfLangID(const char *iso_name);
|
void SetCurrentGrfLangID(byte language_id);
|
||||||
char *TranslateTTDPatchCodes(uint32 grfid, const char *str);
|
char *TranslateTTDPatchCodes(uint32 grfid, const char *str);
|
||||||
|
|
||||||
bool CheckGrfLangID(byte lang_id, byte grf_version);
|
bool CheckGrfLangID(byte lang_id, byte grf_version);
|
||||||
|
@ -88,6 +88,7 @@ static char _lang_name[32], _lang_ownname[32], _lang_isocode[16];
|
|||||||
static byte _lang_pluralform;
|
static byte _lang_pluralform;
|
||||||
static byte _lang_textdir;
|
static byte _lang_textdir;
|
||||||
static uint16 _lang_winlangid;
|
static uint16 _lang_winlangid;
|
||||||
|
static uint8 _lang_newgrflangid;
|
||||||
#define MAX_NUM_GENDER 8
|
#define MAX_NUM_GENDER 8
|
||||||
static char _genders[MAX_NUM_GENDER][16];
|
static char _genders[MAX_NUM_GENDER][16];
|
||||||
static uint _numgenders;
|
static uint _numgenders;
|
||||||
@ -663,12 +664,19 @@ static void HandlePragma(char *str)
|
|||||||
error("Invalid textdir %s", str + 8);
|
error("Invalid textdir %s", str + 8);
|
||||||
}
|
}
|
||||||
} else if (!memcmp(str, "winlangid ", 10)) {
|
} else if (!memcmp(str, "winlangid ", 10)) {
|
||||||
char *buf = str + 10;
|
const char *buf = str + 10;
|
||||||
long langid = strtol(buf, NULL, 16);
|
long langid = strtol(buf, NULL, 16);
|
||||||
if (langid > UINT16_MAX || langid < 0) {
|
if (langid > UINT16_MAX || langid < 0) {
|
||||||
error("Invalid winlangid %s", buf);
|
error("Invalid winlangid %s", buf);
|
||||||
}
|
}
|
||||||
_lang_winlangid = (uint16)langid;
|
_lang_winlangid = (uint16)langid;
|
||||||
|
} else if (!memcmp(str, "grflangid ", 10)) {
|
||||||
|
const char *buf = str + 10;
|
||||||
|
long langid = strtol(buf, NULL, 16);
|
||||||
|
if (langid >= 0x7F || langid < 0) {
|
||||||
|
error("Invalid grflangid %s", buf);
|
||||||
|
}
|
||||||
|
_lang_newgrflangid = (uint8)langid;
|
||||||
} else if (!memcmp(str, "gender ", 7)) {
|
} else if (!memcmp(str, "gender ", 7)) {
|
||||||
char *buf = str + 7;
|
char *buf = str + 7;
|
||||||
|
|
||||||
@ -933,6 +941,7 @@ static void ParseFile(const char *file, bool english)
|
|||||||
_lang_name[0] = _lang_ownname[0] = _lang_isocode[0] = '\0';
|
_lang_name[0] = _lang_ownname[0] = _lang_isocode[0] = '\0';
|
||||||
_lang_textdir = TD_LTR;
|
_lang_textdir = TD_LTR;
|
||||||
_lang_winlangid = 0x0000; // neutral language code
|
_lang_winlangid = 0x0000; // neutral language code
|
||||||
|
_lang_newgrflangid = 0; // standard english
|
||||||
// TODO:!! We can't reset the cases. In case the translated strings
|
// TODO:!! We can't reset the cases. In case the translated strings
|
||||||
// derive some strings from english....
|
// derive some strings from english....
|
||||||
|
|
||||||
@ -1183,6 +1192,7 @@ static void WriteLangfile(const char *filename)
|
|||||||
hdr.plural_form = _lang_pluralform;
|
hdr.plural_form = _lang_pluralform;
|
||||||
hdr.text_dir = _lang_textdir;
|
hdr.text_dir = _lang_textdir;
|
||||||
hdr.winlangid = TO_LE16(_lang_winlangid);
|
hdr.winlangid = TO_LE16(_lang_winlangid);
|
||||||
|
hdr.newgrflangid = _lang_newgrflangid;
|
||||||
strcpy(hdr.name, _lang_name);
|
strcpy(hdr.name, _lang_name);
|
||||||
strcpy(hdr.own_name, _lang_ownname);
|
strcpy(hdr.own_name, _lang_ownname);
|
||||||
strcpy(hdr.isocode, _lang_isocode);
|
strcpy(hdr.isocode, _lang_isocode);
|
||||||
|
@ -23,7 +23,8 @@ struct LanguagePackHeader {
|
|||||||
* http://msdn.microsoft.com/en-us/library/ms776294.aspx
|
* http://msdn.microsoft.com/en-us/library/ms776294.aspx
|
||||||
*/
|
*/
|
||||||
uint16 winlangid; // windows language id
|
uint16 winlangid; // windows language id
|
||||||
/* byte pad[0]; // pad header to be a multiple of 4 */
|
uint8 newgrflangid; // newgrf language id
|
||||||
|
byte pad[3]; // pad header to be a multiple of 4
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_compile(sizeof(LanguagePackHeader) % 4 == 0);
|
assert_compile(sizeof(LanguagePackHeader) % 4 == 0);
|
||||||
|
@ -1315,7 +1315,7 @@ bool ReadLanguagePack(int lang_index)
|
|||||||
|
|
||||||
_dynlang.curr = lang_index;
|
_dynlang.curr = lang_index;
|
||||||
_dynlang.text_dir = (TextDirection)lang_pack->text_dir;
|
_dynlang.text_dir = (TextDirection)lang_pack->text_dir;
|
||||||
SetCurrentGrfLangID(_langpack->isocode);
|
SetCurrentGrfLangID(_langpack->newgrflangid);
|
||||||
SortNetworkLanguages();
|
SortNetworkLanguages();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user