Files
@ r27636:dd08900a2d5c
Branch filter:
Location: cpp/openttd-patchpack/source/src/strings.cpp - annotation
r27636:dd08900a2d5c
73.2 KiB
text/x-c
Fix #11054: Prevent translation of currency codes.
Most languages stick with the 3-letter latin currency codes in the name
string, however some translations are... clever... and use the currency
symbol instead. Whilst this may look nice, it can cause issues with fonts
as some scripts have a specific limited set of fonts which do not include
these symbols.
Instead, hard code the currency code list and add it when drawing the
currency name.
Most languages stick with the 3-letter latin currency codes in the name
string, however some translations are... clever... and use the currency
symbol instead. Whilst this may look nice, it can cause issues with fonts
as some scripts have a specific limited set of fonts which do not include
these symbols.
Instead, hard code the currency code list and add it when drawing the
currency name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 | r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r9111:983de9c5a848 r6420:01087f989fd1 r5584:545d748cc681 r5584:545d748cc681 r8785:8312063c5ee4 r5584:545d748cc681 r12465:c1b760a56db7 r15157:bb076a01b6d6 r5584:545d748cc681 r5584:545d748cc681 r10039:727fb45b0424 r8790:550c9960067a r20421:689b79ec796e r18617:524f2e0f54dc r27160:192bc991c2e6 r8114:866ed489ed98 r9085:bfc6f61fcf0c r8120:549bf30c619d r27166:64e04a3ef9b1 r8144:1432edd15267 r9070:e059c65164f3 r16434:88fcbcadb08e r13100:30174268a209 r14248:a9050881acd7 r14248:a9050881acd7 r14913:cb843fd1989e r16602:e5643090f513 r16406:0ff6f2834109 r18776:45400817a6df r23483:3733e6b8ff17 r26839:2bed12525c08 r27071:f789dd1be6d7 r17137:72e8c9d27bc6 r27172:6984e50a4df8 r5584:545d748cc681 r8264:d493cb51fe8a r8264:d493cb51fe8a r27557:50ad62a8825a r5584:545d748cc681 r27491:3efcd928d306 r27491:3efcd928d306 r21383:942c32fb8b0e r21383:942c32fb8b0e r24527:d7a4b00784e2 r16438:4a3128e4430d r23607:36c15679007d r16435:9850e423b4f5 r16436:93f10edaf6ec r5584:545d748cc681 r23455:c7e625a5235a r24527:d7a4b00784e2 r23455:c7e625a5235a r16603:771c410131a7 r27625:92c3a572df6d r17490:7d4057a9ce66 r27617:d4fc0012887c r27617:d4fc0012887c r27617:d4fc0012887c r27617:d4fc0012887c r27617:d4fc0012887c r17490:7d4057a9ce66 r27629:2110d3d16bdc r27617:d4fc0012887c r17490:7d4057a9ce66 r17490:7d4057a9ce66 r19662:414ec865eab6 r19662:414ec865eab6 r19662:414ec865eab6 r19662:414ec865eab6 r19662:414ec865eab6 r27592:36866a8e7c46 r19662:414ec865eab6 r27592:36866a8e7c46 r27629:2110d3d16bdc r25655:1030dcb7eb52 r19662:414ec865eab6 r19662:414ec865eab6 r27629:2110d3d16bdc r27629:2110d3d16bdc r27629:2110d3d16bdc r27629:2110d3d16bdc r27592:36866a8e7c46 r27629:2110d3d16bdc r19662:414ec865eab6 r27629:2110d3d16bdc r27629:2110d3d16bdc r27629:2110d3d16bdc r19662:414ec865eab6 r19662:414ec865eab6 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27599:5759b29a5967 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27599:5759b29a5967 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r27593:06cdc72f3f62 r17490:7d4057a9ce66 r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19944:25a78576fb5e r20303:6adbc75a1297 r19846:75a27628493b r27599:5759b29a5967 r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r24597:afde5721a3b6 r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r20303:6adbc75a1297 r19846:75a27628493b r27599:5759b29a5967 r19846:75a27628493b r23541:5e71f67eca51 r23541:5e71f67eca51 r20304:8660c225f9a8 r20304:8660c225f9a8 r19846:75a27628493b r20304:8660c225f9a8 r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r19846:75a27628493b r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r27566:7ad5909aff24 r17490:7d4057a9ce66 r27628:28ccca9de1b0 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r27566:7ad5909aff24 r17490:7d4057a9ce66 r27628:28ccca9de1b0 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r27413:b706f5407370 r27413:b706f5407370 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r27626:6332790590d7 r21410:ae5961f02724 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r23607:36c15679007d r27628:28ccca9de1b0 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r18621:f8aeddca4c06 r27495:7d6763cdf898 r27506:5d6fb3346eaa r27578:3946659e01ee r5584:545d748cc681 r27578:3946659e01ee r5584:545d748cc681 r10366:7caaeb65e529 r12078:20df2dd76e0c r6248:b940b09d7ab8 r5584:545d748cc681 r25103:79e816f12199 r25103:79e816f12199 r25103:79e816f12199 r25103:79e816f12199 r25103:79e816f12199 r25103:79e816f12199 r25103:79e816f12199 r25103:79e816f12199 r24527:d7a4b00784e2 r25103:79e816f12199 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r19591:422fc6c19821 r5584:545d748cc681 r5584:545d748cc681 r8445:07810e0b20bf r5584:545d748cc681 r22547:90170a724532 r22551:c6bc232b7c99 r21156:d014c518c978 r22549:21c2f1153122 r22551:c6bc232b7c99 r24527:d7a4b00784e2 r8445:07810e0b20bf r5584:545d748cc681 r5584:545d748cc681 r15610:623a23fb6560 r18203:d1d1a9814251 r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r18203:d1d1a9814251 r18786:ebe90ae93ff8 r6420:01087f989fd1 r27578:3946659e01ee r5584:545d748cc681 r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r7810:36ef334ff30e r22547:90170a724532 r22549:21c2f1153122 r5584:545d748cc681 r5584:545d748cc681 r22549:21c2f1153122 r18786:ebe90ae93ff8 r27578:3946659e01ee r27506:5d6fb3346eaa r15542:f6c6d0f8689e r5584:545d748cc681 r5584:545d748cc681 r22549:21c2f1153122 r18786:ebe90ae93ff8 r27506:5d6fb3346eaa r27506:5d6fb3346eaa r15542:f6c6d0f8689e r5584:545d748cc681 r5584:545d748cc681 r22549:21c2f1153122 r8445:07810e0b20bf r20942:272286f1ddfb r27160:192bc991c2e6 r20942:272286f1ddfb r20942:272286f1ddfb r5584:545d748cc681 r27495:7d6763cdf898 r27495:7d6763cdf898 r27506:5d6fb3346eaa r27495:7d6763cdf898 r18776:45400817a6df r22549:21c2f1153122 r21156:d014c518c978 r5584:545d748cc681 r27495:7d6763cdf898 r27495:7d6763cdf898 r27506:5d6fb3346eaa r27495:7d6763cdf898 r5584:545d748cc681 r22549:21c2f1153122 r22549:21c2f1153122 r5584:545d748cc681 r5584:545d748cc681 r24527:d7a4b00784e2 r18786:ebe90ae93ff8 r27506:5d6fb3346eaa r18786:ebe90ae93ff8 r27160:192bc991c2e6 r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r27495:7d6763cdf898 r25486:ca7a2cc7b166 r25486:ca7a2cc7b166 r25486:ca7a2cc7b166 r25486:ca7a2cc7b166 r25486:ca7a2cc7b166 r25486:ca7a2cc7b166 r25486:ca7a2cc7b166 r27617:d4fc0012887c r27578:3946659e01ee r25486:ca7a2cc7b166 r5584:545d748cc681 r15610:623a23fb6560 r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27578:3946659e01ee r27506:5d6fb3346eaa r27531:d2b4a9aaf60a r27531:d2b4a9aaf60a r27506:5d6fb3346eaa r27531:d2b4a9aaf60a r27506:5d6fb3346eaa r27506:5d6fb3346eaa r27506:5d6fb3346eaa r15610:623a23fb6560 r6420:01087f989fd1 r6420:01087f989fd1 r6420:01087f989fd1 r27599:5759b29a5967 r5584:545d748cc681 r27615:4608ed940341 r5584:545d748cc681 r5584:545d748cc681 r12499:2e177e6e0453 r25394:5a394214a73a r25394:5a394214a73a r25394:5a394214a73a r25394:5a394214a73a r25394:5a394214a73a r27599:5759b29a5967 r25394:5a394214a73a r27615:4608ed940341 r25394:5a394214a73a r25394:5a394214a73a r25394:5a394214a73a r17529:5c15129f0667 r27491:3efcd928d306 r17529:5c15129f0667 r17529:5c15129f0667 r17529:5c15129f0667 r17530:880c12534a46 r17530:880c12534a46 r17530:880c12534a46 r17529:5c15129f0667 r27491:3efcd928d306 r5584:545d748cc681 r17529:5c15129f0667 r7356:28c8d6256776 r17530:880c12534a46 r17530:880c12534a46 r5584:545d748cc681 r5584:545d748cc681 r27491:3efcd928d306 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r13647:3cbfb3297757 r13647:3cbfb3297757 r17529:5c15129f0667 r17530:880c12534a46 r25465:00b2c6cd44ad r25465:00b2c6cd44ad r27491:3efcd928d306 r17530:880c12534a46 r17530:880c12534a46 r13647:3cbfb3297757 r7356:28c8d6256776 r7356:28c8d6256776 r7356:28c8d6256776 r5584:545d748cc681 r19073:8fe02d56e14c r27491:3efcd928d306 r27491:3efcd928d306 r5584:545d748cc681 r7356:28c8d6256776 r7356:28c8d6256776 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27491:3efcd928d306 r11729:438ae5889eb8 r25465:00b2c6cd44ad r25465:00b2c6cd44ad r27491:3efcd928d306 r11729:438ae5889eb8 r11729:438ae5889eb8 r27491:3efcd928d306 r5584:545d748cc681 r27491:3efcd928d306 r5584:545d748cc681 r5584:545d748cc681 r27491:3efcd928d306 r13647:3cbfb3297757 r27491:3efcd928d306 r13647:3cbfb3297757 r13647:3cbfb3297757 r27491:3efcd928d306 r10135:de3b4e59727f r27491:3efcd928d306 r10135:de3b4e59727f r5584:545d748cc681 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r27491:3efcd928d306 r27491:3efcd928d306 r10771:bbad5384e0a7 r27491:3efcd928d306 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r17499:4799198e4e5c r17499:4799198e4e5c r10772:b7f438513abc r10771:bbad5384e0a7 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r25465:00b2c6cd44ad r25465:00b2c6cd44ad r12687:28f71c3eb732 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r27491:3efcd928d306 r10771:bbad5384e0a7 r27491:3efcd928d306 r10771:bbad5384e0a7 r27491:3efcd928d306 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r27491:3efcd928d306 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r12620:f524f9555096 r27491:3efcd928d306 r10771:bbad5384e0a7 r10771:bbad5384e0a7 r27495:7d6763cdf898 r5584:545d748cc681 r27229:662da0bb155f r27229:662da0bb155f r5584:545d748cc681 r27615:4608ed940341 r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r5584:545d748cc681 r27229:662da0bb155f r27229:662da0bb155f r5584:545d748cc681 r27615:4608ed940341 r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r5584:545d748cc681 r27229:662da0bb155f r27229:662da0bb155f r5584:545d748cc681 r27107:55e64c4c827b r27615:4608ed940341 r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r27491:3efcd928d306 r5584:545d748cc681 r7763:878d494b5f57 r7763:878d494b5f57 r7763:878d494b5f57 r7763:878d494b5f57 r5584:545d748cc681 r7763:878d494b5f57 r5584:545d748cc681 r6420:01087f989fd1 r5584:545d748cc681 r27532:a404cf8fb798 r27532:a404cf8fb798 r27491:3efcd928d306 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r18845:66bf168f1100 r18845:66bf168f1100 r5584:545d748cc681 r27491:3efcd928d306 r5584:545d748cc681 r6420:01087f989fd1 r5584:545d748cc681 r16291:e11d1bc654e8 r16291:e11d1bc654e8 r16291:e11d1bc654e8 r5584:545d748cc681 r21603:f73dce494722 r5584:545d748cc681 r5584:545d748cc681 r21603:f73dce494722 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r25465:00b2c6cd44ad r25466:831c10b429e5 r25465:00b2c6cd44ad r27491:3efcd928d306 r27491:3efcd928d306 r5584:545d748cc681 r18845:66bf168f1100 r18845:66bf168f1100 r5584:545d748cc681 r27491:3efcd928d306 r5584:545d748cc681 r7763:878d494b5f57 r27491:3efcd928d306 r7422:40d741b970bf r5584:545d748cc681 r5584:545d748cc681 r16480:b531763d125c r16480:b531763d125c r16480:b531763d125c r16480:b531763d125c r16480:b531763d125c r16480:b531763d125c r16480:b531763d125c r5584:545d748cc681 r6420:01087f989fd1 r8735:54d170351a85 r5584:545d748cc681 r16480:b531763d125c r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r19953:b132b7dde65f r5584:545d748cc681 r19456:aeef462b3ea5 r8735:54d170351a85 r25158:ac2118adeff0 r8735:54d170351a85 r8735:54d170351a85 r5584:545d748cc681 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r19953:b132b7dde65f r5584:545d748cc681 r19456:aeef462b3ea5 r19954:1583a34819a9 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r5584:545d748cc681 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r15023:b5ed4df055c0 r5584:545d748cc681 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r5584:545d748cc681 r19944:25a78576fb5e r8735:54d170351a85 r14846:043d6c473c1a r8735:54d170351a85 r8735:54d170351a85 r5584:545d748cc681 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r5584:545d748cc681 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8733:46dfc2fe0147 r19456:aeef462b3ea5 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r8735:54d170351a85 r11587:432650b1bb06 r19456:aeef462b3ea5 r11587:432650b1bb06 r14846:043d6c473c1a r11587:432650b1bb06 r11587:432650b1bb06 r12372:db29caf51ece r19456:aeef462b3ea5 r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r12372:db29caf51ece r15023:b5ed4df055c0 r19456:aeef462b3ea5 r15023:b5ed4df055c0 r15023:b5ed4df055c0 r15023:b5ed4df055c0 r15023:b5ed4df055c0 r20110:dda7f04e11d8 r20110:dda7f04e11d8 r20110:dda7f04e11d8 r20110:dda7f04e11d8 r20110:dda7f04e11d8 r25151:65c3f29d0dd5 r25151:65c3f29d0dd5 r25151:65c3f29d0dd5 r25151:65c3f29d0dd5 r25151:65c3f29d0dd5 r25151:65c3f29d0dd5 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r5584:545d748cc681 r11363:6906c490a00e r5584:545d748cc681 r12633:918a66e99f38 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r12633:918a66e99f38 r5584:545d748cc681 r5584:545d748cc681 r12633:918a66e99f38 r27495:7d6763cdf898 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r17285:5c0704de0647 r17285:5c0704de0647 r27297:7606e4982c9b r17285:5c0704de0647 r17285:5c0704de0647 r17285:5c0704de0647 r17285:5c0704de0647 r17304:14d56df41aec r17285:5c0704de0647 r17285:5c0704de0647 r17304:14d56df41aec r17285:5c0704de0647 r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r17285:5c0704de0647 r17285:5c0704de0647 r17285:5c0704de0647 r17285:5c0704de0647 r17285:5c0704de0647 r19124:71b70b38b457 r19124:71b70b38b457 r17285:5c0704de0647 r17285:5c0704de0647 r19124:71b70b38b457 r17285:5c0704de0647 r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r17285:5c0704de0647 r17285:5c0704de0647 r17285:5c0704de0647 r20487:e38d6b6e9445 r6248:b940b09d7ab8 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r24435:88d8770a33ea r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r27298:d394892a4719 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r20487:e38d6b6e9445 r20487:e38d6b6e9445 r26526:c817c3792857 r20487:e38d6b6e9445 r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r6248:b940b09d7ab8 r5584:545d748cc681 r26526:c817c3792857 r26526:c817c3792857 r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r26526:c817c3792857 r26526:c817c3792857 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r27298:d394892a4719 r27298:d394892a4719 r27298:d394892a4719 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r27298:d394892a4719 r27298:d394892a4719 r27298:d394892a4719 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r27299:7b81a5510ce8 r27299:7b81a5510ce8 r27299:7b81a5510ce8 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r20487:e38d6b6e9445 r27297:7606e4982c9b r27297:7606e4982c9b r27297:7606e4982c9b r5584:545d748cc681 r5584:545d748cc681 r8898:2a6a3b21c679 r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r27050:d85c65824c1e r8898:2a6a3b21c679 r17304:14d56df41aec r17304:14d56df41aec r17304:14d56df41aec r27050:d85c65824c1e r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r8898:2a6a3b21c679 r27050:d85c65824c1e r8898:2a6a3b21c679 r27050:d85c65824c1e r8898:2a6a3b21c679 r8898:2a6a3b21c679 r16703:12605bde7bc2 r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r27050:d85c65824c1e r19077:678a82402d65 r27050:d85c65824c1e r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r19077:678a82402d65 r27050:d85c65824c1e r19077:678a82402d65 r27050:d85c65824c1e r19077:678a82402d65 r27048:0ed975e7fe6d r27048:0ed975e7fe6d r27048:0ed975e7fe6d r19077:678a82402d65 r16703:12605bde7bc2 r27495:7d6763cdf898 r23023:7b8669afd1db r23023:7b8669afd1db r27495:7d6763cdf898 r16703:12605bde7bc2 r27578:3946659e01ee r5584:545d748cc681 r27618:165906b1b23e r17490:7d4057a9ce66 r27626:6332790590d7 r27495:7d6763cdf898 r27626:6332790590d7 r27626:6332790590d7 r27626:6332790590d7 r27626:6332790590d7 r27626:6332790590d7 r27626:6332790590d7 r27495:7d6763cdf898 r27531:d2b4a9aaf60a r27531:d2b4a9aaf60a r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r27495:7d6763cdf898 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r27495:7d6763cdf898 r17490:7d4057a9ce66 r17490:7d4057a9ce66 r27618:165906b1b23e r16692:f5d38cba4303 r20967:091f0485c05f r18203:d1d1a9814251 r23375:ca293b1be7a0 r17137:72e8c9d27bc6 r5584:545d748cc681 r17388:4c1f53028687 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r7616:d6611d4fd004 r25484:c5af4712cb7f r27578:3946659e01ee r27574:c90aa6815e53 r7616:d6611d4fd004 r7616:d6611d4fd004 r7616:d6611d4fd004 r27592:36866a8e7c46 r27592:36866a8e7c46 r27592:36866a8e7c46 r27592:36866a8e7c46 r27592:36866a8e7c46 r27616:ad311a7be358 r5584:545d748cc681 r18777:cf24fc430b51 r18777:cf24fc430b51 r27625:92c3a572df6d r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r27168:197e090a03f4 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r27495:7d6763cdf898 r18777:cf24fc430b51 r18777:cf24fc430b51 r22551:c6bc232b7c99 r18777:cf24fc430b51 r18777:cf24fc430b51 r27495:7d6763cdf898 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r19662:414ec865eab6 r18777:cf24fc430b51 r23024:29d5f833c1b9 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r27168:197e090a03f4 r18777:cf24fc430b51 r18777:cf24fc430b51 r22551:c6bc232b7c99 r18777:cf24fc430b51 r18777:cf24fc430b51 r27495:7d6763cdf898 r18777:cf24fc430b51 r18777:cf24fc430b51 r22551:c6bc232b7c99 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r26938:599b41e0c2f0 r21410:ae5961f02724 r26938:599b41e0c2f0 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r27048:0ed975e7fe6d r18777:cf24fc430b51 r18777:cf24fc430b51 r20023:61e99ef9e469 r20023:61e99ef9e469 r20023:61e99ef9e469 r27578:3946659e01ee r20023:61e99ef9e469 r18777:cf24fc430b51 r26829:f1ebd010c392 r27048:0ed975e7fe6d r27048:0ed975e7fe6d r27048:0ed975e7fe6d r27048:0ed975e7fe6d r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r18777:cf24fc430b51 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17957:225ed72957fa r27592:36866a8e7c46 r17137:72e8c9d27bc6 r18203:d1d1a9814251 r18203:d1d1a9814251 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r17137:72e8c9d27bc6 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27599:5759b29a5967 r18417:d063e7cb7d51 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27531:d2b4a9aaf60a r19591:422fc6c19821 r19591:422fc6c19821 r27531:d2b4a9aaf60a r27531:d2b4a9aaf60a r27597:0f4621fd90d7 r27578:3946659e01ee r19591:422fc6c19821 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27531:d2b4a9aaf60a r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27495:7d6763cdf898 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r19591:422fc6c19821 r27495:7d6763cdf898 r27495:7d6763cdf898 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27599:5759b29a5967 r27598:e222bd3be19f r27495:7d6763cdf898 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27618:165906b1b23e r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27495:7d6763cdf898 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r9648:996b8efd5c66 r27592:36866a8e7c46 r27573:8b812bfbb882 r27573:8b812bfbb882 r27573:8b812bfbb882 r27495:7d6763cdf898 r27048:0ed975e7fe6d r27048:0ed975e7fe6d r27495:7d6763cdf898 r9648:996b8efd5c66 r9648:996b8efd5c66 r9648:996b8efd5c66 r18417:d063e7cb7d51 r27592:36866a8e7c46 r26829:f1ebd010c392 r27576:b346340fe4e3 r27578:3946659e01ee r27578:3946659e01ee r18204:c19fd396fd9c r5584:545d748cc681 r15608:7b580ec7448a r5584:545d748cc681 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r18941:8b8e5486e2f8 r27592:36866a8e7c46 r26829:f1ebd010c392 r20024:67c8ed4ab50d r27578:3946659e01ee r27495:7d6763cdf898 r20024:67c8ed4ab50d r27578:3946659e01ee r27578:3946659e01ee r20024:67c8ed4ab50d r18203:d1d1a9814251 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r27592:36866a8e7c46 r5584:545d748cc681 r5584:545d748cc681 r27491:3efcd928d306 r27592:36866a8e7c46 r27592:36866a8e7c46 r27491:3efcd928d306 r17530:880c12534a46 r17530:880c12534a46 r17530:880c12534a46 r27495:7d6763cdf898 r27592:36866a8e7c46 r5584:545d748cc681 r5584:545d748cc681 r13647:3cbfb3297757 r27578:3946659e01ee r27578:3946659e01ee r15608:7b580ec7448a r15608:7b580ec7448a r13647:3cbfb3297757 r27495:7d6763cdf898 r27592:36866a8e7c46 r10135:de3b4e59727f r10135:de3b4e59727f r27495:7d6763cdf898 r27578:3946659e01ee r10771:bbad5384e0a7 r10771:bbad5384e0a7 r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r27592:36866a8e7c46 r18740:dd5dfff8593c r18740:dd5dfff8593c r18740:dd5dfff8593c r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r27578:3946659e01ee r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r27578:3946659e01ee r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r27578:3946659e01ee r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r27491:3efcd928d306 r18443:ceff9a227677 r18443:ceff9a227677 r18443:ceff9a227677 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r18740:dd5dfff8593c r18740:dd5dfff8593c r18740:dd5dfff8593c r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r27421:e8c2cdc1e8e6 r18740:dd5dfff8593c r27421:e8c2cdc1e8e6 r27578:3946659e01ee r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r19142:e5c38d8d6bba r27592:36866a8e7c46 r19142:e5c38d8d6bba r19142:e5c38d8d6bba r25301:13cfd266320c r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r27495:7d6763cdf898 r19142:e5c38d8d6bba r19142:e5c38d8d6bba r27495:7d6763cdf898 r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r27495:7d6763cdf898 r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r19142:e5c38d8d6bba r27495:7d6763cdf898 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27495:7d6763cdf898 r27592:36866a8e7c46 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r26526:c817c3792857 r26526:c817c3792857 r26526:c817c3792857 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r26526:c817c3792857 r26526:c817c3792857 r26526:c817c3792857 r18417:d063e7cb7d51 r27592:36866a8e7c46 r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27050:d85c65824c1e r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r8258:08100da56269 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r20487:e38d6b6e9445 r27298:d394892a4719 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r23607:36c15679007d r18417:d063e7cb7d51 r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r10112:2f23a128407f r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r18417:d063e7cb7d51 r27625:92c3a572df6d r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r26839:2bed12525c08 r23607:36c15679007d r18417:d063e7cb7d51 r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r26839:2bed12525c08 r18417:d063e7cb7d51 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r27625:92c3a572df6d r27578:3946659e01ee r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r26839:2bed12525c08 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27578:3946659e01ee r23607:36c15679007d r18417:d063e7cb7d51 r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r23607:36c15679007d r18417:d063e7cb7d51 r27071:f789dd1be6d7 r27071:f789dd1be6d7 r27071:f789dd1be6d7 r27495:7d6763cdf898 r27071:f789dd1be6d7 r19592:f239a6dce8ea r19592:f239a6dce8ea r27615:4608ed940341 r27578:3946659e01ee r19592:f239a6dce8ea r19592:f239a6dce8ea r27615:4608ed940341 r27578:3946659e01ee r19592:f239a6dce8ea r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r18417:d063e7cb7d51 r27592:36866a8e7c46 r23607:36c15679007d r18417:d063e7cb7d51 r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r18417:d063e7cb7d51 r27615:4608ed940341 r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27592:36866a8e7c46 r11944:3b8f9f948e8d r5584:545d748cc681 r23607:36c15679007d r10113:5b9768ca1d87 r10113:5b9768ca1d87 r10113:5b9768ca1d87 r27615:4608ed940341 r27578:3946659e01ee r10113:5b9768ca1d87 r10113:5b9768ca1d87 r10113:5b9768ca1d87 r27071:f789dd1be6d7 r27071:f789dd1be6d7 r27071:f789dd1be6d7 r27495:7d6763cdf898 r27071:f789dd1be6d7 r27615:4608ed940341 r27578:3946659e01ee r5584:545d748cc681 r26829:f1ebd010c392 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r26829:f1ebd010c392 r10347:928beddeea17 r10347:928beddeea17 r10347:928beddeea17 r27625:92c3a572df6d r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27592:36866a8e7c46 r23607:36c15679007d r5584:545d748cc681 r27071:f789dd1be6d7 r27071:f789dd1be6d7 r27071:f789dd1be6d7 r27495:7d6763cdf898 r27071:f789dd1be6d7 r27615:4608ed940341 r27578:3946659e01ee r6956:6398843f1341 r27506:5d6fb3346eaa r6956:6398843f1341 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r18417:d063e7cb7d51 r27592:36866a8e7c46 r23607:36c15679007d r6643:fa000ce7441e r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r8258:08100da56269 r27615:4608ed940341 r26829:f1ebd010c392 r26829:f1ebd010c392 r27578:3946659e01ee r8258:08100da56269 r7059:0c2dc932a6ae r7059:0c2dc932a6ae r7059:0c2dc932a6ae r7049:0c15b0ef5319 r27592:36866a8e7c46 r23607:36c15679007d r11967:df0600d2c7e7 r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r24445:3cdfd9b40e1a r24445:3cdfd9b40e1a r27615:4608ed940341 r27578:3946659e01ee r8258:08100da56269 r27615:4608ed940341 r7049:0c15b0ef5319 r26829:f1ebd010c392 r8258:08100da56269 r26829:f1ebd010c392 r26829:f1ebd010c392 r26829:f1ebd010c392 r26829:f1ebd010c392 r26829:f1ebd010c392 r8258:08100da56269 r8258:08100da56269 r27578:3946659e01ee r8258:08100da56269 r7049:0c15b0ef5319 r7049:0c15b0ef5319 r7049:0c15b0ef5319 r7056:100d5cd282bd r27578:3946659e01ee r23607:36c15679007d r18740:dd5dfff8593c r24214:a65c412aafcc r27615:4608ed940341 r27578:3946659e01ee r8258:08100da56269 r27615:4608ed940341 r27578:3946659e01ee r8258:08100da56269 r7056:100d5cd282bd r7056:100d5cd282bd r7056:100d5cd282bd r18417:d063e7cb7d51 r27592:36866a8e7c46 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27619:aebf183cadb5 r27622:94b160e52976 r27619:aebf183cadb5 r27619:aebf183cadb5 r27619:aebf183cadb5 r27619:aebf183cadb5 r5584:545d748cc681 r27495:7d6763cdf898 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27495:7d6763cdf898 r5584:545d748cc681 r27495:7d6763cdf898 r27495:7d6763cdf898 r27495:7d6763cdf898 r27495:7d6763cdf898 r27495:7d6763cdf898 r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r5584:545d748cc681 r27515:e1259c76535d r5584:545d748cc681 r5584:545d748cc681 r10372:521f8a57d439 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r10372:521f8a57d439 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r10372:521f8a57d439 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r5584:545d748cc681 r10372:521f8a57d439 r5584:545d748cc681 r5584:545d748cc681 r9413:fcf267325763 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r10372:521f8a57d439 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r9413:fcf267325763 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r27578:3946659e01ee r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r27578:3946659e01ee r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r27578:3946659e01ee r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r27578:3946659e01ee r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r6420:01087f989fd1 r8969:a12996f56447 r27578:3946659e01ee r27506:5d6fb3346eaa r27506:5d6fb3346eaa r5584:545d748cc681 r5584:545d748cc681 r12553:f443d44dbd97 r5584:545d748cc681 r5584:545d748cc681 r17098:afa706d65a49 r17098:afa706d65a49 r17098:afa706d65a49 r17098:afa706d65a49 r16406:0ff6f2834109 r16406:0ff6f2834109 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16537:b136370bd3c2 r16406:0ff6f2834109 r16406:0ff6f2834109 r17630:7d818445376d r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r17630:7d818445376d r17630:7d818445376d r17630:7d818445376d r17630:7d818445376d r16437:4ee0753a14ec r5584:545d748cc681 r14531:bb0051b4e7d1 r24527:d7a4b00784e2 r27557:50ad62a8825a r24527:d7a4b00784e2 r5584:545d748cc681 r14531:bb0051b4e7d1 r24527:d7a4b00784e2 r6320:13e912591069 r14531:bb0051b4e7d1 r16406:0ff6f2834109 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r9543:54a9c0376831 r22549:21c2f1153122 r5584:545d748cc681 r5584:545d748cc681 r9543:54a9c0376831 r5584:545d748cc681 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r14531:bb0051b4e7d1 r22549:21c2f1153122 r20988:f8c9190d880e r24527:d7a4b00784e2 r20988:f8c9190d880e r24527:d7a4b00784e2 r24527:d7a4b00784e2 r14531:bb0051b4e7d1 r5584:545d748cc681 r5584:545d748cc681 r6420:01087f989fd1 r24527:d7a4b00784e2 r5584:545d748cc681 r6420:01087f989fd1 r14531:bb0051b4e7d1 r14531:bb0051b4e7d1 r14531:bb0051b4e7d1 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r14531:bb0051b4e7d1 r14531:bb0051b4e7d1 r24527:d7a4b00784e2 r14531:bb0051b4e7d1 r24527:d7a4b00784e2 r5584:545d748cc681 r14531:bb0051b4e7d1 r14531:bb0051b4e7d1 r5584:545d748cc681 r5584:545d748cc681 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r24527:d7a4b00784e2 r5584:545d748cc681 r16437:4ee0753a14ec r16435:9850e423b4f5 r27557:50ad62a8825a r16435:9850e423b4f5 r5584:545d748cc681 r23088:6710c4c79ac6 r27548:f07a388cf8d7 r22895:325a6acc542b r22895:325a6acc542b r22895:325a6acc542b r23075:bed1a8fa17ea r23075:bed1a8fa17ea r23075:bed1a8fa17ea r23075:bed1a8fa17ea r23075:bed1a8fa17ea r23455:c7e625a5235a r16603:771c410131a7 r16603:771c410131a7 r24527:d7a4b00784e2 r16603:771c410131a7 r24527:d7a4b00784e2 r16603:771c410131a7 r16603:771c410131a7 r24527:d7a4b00784e2 r16603:771c410131a7 r23455:c7e625a5235a r16603:771c410131a7 r16602:e5643090f513 r18776:45400817a6df r14922:51cba7fe7b9b r14913:cb843fd1989e r14913:cb843fd1989e r22117:1e553607d20b r16602:e5643090f513 r16602:e5643090f513 r16602:e5643090f513 r16602:e5643090f513 r16602:e5643090f513 r16602:e5643090f513 r16602:e5643090f513 r16602:e5643090f513 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r11363:6906c490a00e r11363:6906c490a00e r23088:6710c4c79ac6 r15610:623a23fb6560 r15610:623a23fb6560 r5584:545d748cc681 r5584:545d748cc681 r6420:01087f989fd1 r23607:36c15679007d r23607:36c15679007d r15613:193c12018337 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r25807:f7b79aca19d1 r23607:36c15679007d r5584:545d748cc681 r25807:f7b79aca19d1 r23607:36c15679007d r5584:545d748cc681 r23607:36c15679007d r25807:f7b79aca19d1 r23607:36c15679007d r5584:545d748cc681 r5584:545d748cc681 r25807:f7b79aca19d1 r5584:545d748cc681 r8991:307769f11fee r8991:307769f11fee r23088:6710c4c79ac6 r5584:545d748cc681 r23631:f1d3190f874f r6793:8878760b0aca r27193:e816892ba57b r27193:e816892ba57b r6793:8878760b0aca r27193:e816892ba57b r6793:8878760b0aca r6793:8878760b0aca r6320:13e912591069 r16451:22dc35cde747 r16451:22dc35cde747 r23607:36c15679007d r6320:13e912591069 r16451:22dc35cde747 r6320:13e912591069 r23536:ce42deb0b32d r23536:ce42deb0b32d r6320:13e912591069 r6320:13e912591069 r23607:36c15679007d r5584:545d748cc681 r5584:545d748cc681 r6320:13e912591069 r18845:66bf168f1100 r6320:13e912591069 r6320:13e912591069 r6320:13e912591069 r6320:13e912591069 r16434:88fcbcadb08e r5584:545d748cc681 r6320:13e912591069 r23607:36c15679007d r6320:13e912591069 r6320:13e912591069 r6320:13e912591069 r6320:13e912591069 r16406:0ff6f2834109 r10367:2521c24ffcf6 r10367:2521c24ffcf6 r17987:d1baeaddc56a r17987:d1baeaddc56a r17987:d1baeaddc56a r17987:d1baeaddc56a r10367:2521c24ffcf6 r6320:13e912591069 r5584:545d748cc681 r6320:13e912591069 r27559:04296b142c50 r27559:04296b142c50 r6320:13e912591069 r27559:04296b142c50 r6320:13e912591069 r27557:50ad62a8825a r23607:36c15679007d r6320:13e912591069 r23607:36c15679007d r25127:b131dacb88fa r25127:b131dacb88fa r6320:13e912591069 r6320:13e912591069 r23607:36c15679007d r6320:13e912591069 r16438:4a3128e4430d r27557:50ad62a8825a r6320:13e912591069 r6320:13e912591069 r27557:50ad62a8825a r25655:1030dcb7eb52 r23607:36c15679007d r25655:1030dcb7eb52 r16438:4a3128e4430d r23532:dc91fcd293f5 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r6320:13e912591069 r18845:66bf168f1100 r18845:66bf168f1100 r6320:13e912591069 r6247:96e840dbefcc r5584:545d748cc681 r25378:49a072fb8b4d r27559:04296b142c50 r6929:4d44d44b9df2 r27160:192bc991c2e6 r5584:545d748cc681 r6320:13e912591069 r6320:13e912591069 r23607:36c15679007d r5584:545d748cc681 r23607:36c15679007d r23607:36c15679007d r23536:ce42deb0b32d r5584:545d748cc681 r16438:4a3128e4430d r23536:ce42deb0b32d r6320:13e912591069 r6320:13e912591069 r18845:66bf168f1100 r27557:50ad62a8825a r23536:ce42deb0b32d r16437:4ee0753a14ec r16437:4ee0753a14ec r6320:13e912591069 r23536:ce42deb0b32d r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r25223:b4d967fcf4cb r23536:ce42deb0b32d r23536:ce42deb0b32d r6320:13e912591069 r5584:545d748cc681 r6320:13e912591069 r6320:13e912591069 r23607:36c15679007d r23607:36c15679007d r6320:13e912591069 r5584:545d748cc681 r27160:192bc991c2e6 r5584:545d748cc681 r8085:1bbb83a278de r8085:1bbb83a278de r13271:4bcd60b30aeb r13271:4bcd60b30aeb r13271:4bcd60b30aeb r13271:4bcd60b30aeb r13271:4bcd60b30aeb r24527:d7a4b00784e2 r13271:4bcd60b30aeb r13271:4bcd60b30aeb r13271:4bcd60b30aeb r15622:c2778abdd3fd r18847:c72a2915657e r15622:c2778abdd3fd r24651:d256fd14817f r15622:c2778abdd3fd r26399:db15b808f86d r16581:435bf682ce73 r16581:435bf682ce73 r18615:58609f373bce r16581:435bf682ce73 r16581:435bf682ce73 r16581:435bf682ce73 r18413:e892ae4942df r27295:4dfa0d5adc00 r27295:4dfa0d5adc00 r27295:4dfa0d5adc00 r18413:e892ae4942df r27295:4dfa0d5adc00 r27295:4dfa0d5adc00 r27295:4dfa0d5adc00 r22816:fb91bcdce3b1 r22816:fb91bcdce3b1 r18413:e892ae4942df r18413:e892ae4942df r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r26399:db15b808f86d r18413:e892ae4942df r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r23497:a0ab44ebd2fa r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r23497:a0ab44ebd2fa r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r27295:4dfa0d5adc00 r18413:e892ae4942df r27295:4dfa0d5adc00 r18413:e892ae4942df r24527:d7a4b00784e2 r18413:e892ae4942df r18413:e892ae4942df r24527:d7a4b00784e2 r19959:9e9a0d36d946 r19959:9e9a0d36d946 r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18413:e892ae4942df r18415:6464fa585e60 r23497:a0ab44ebd2fa r18424:91195beac0ac r18424:91195beac0ac r18424:91195beac0ac r18424:91195beac0ac r26399:db15b808f86d r18415:6464fa585e60 r24787:198b505805b2 r25467:609489b9053a r25467:609489b9053a r25467:609489b9053a r23737:64ab3885eee6 r23737:64ab3885eee6 r23737:64ab3885eee6 r23737:64ab3885eee6 r23737:64ab3885eee6 r18415:6464fa585e60 r18413:e892ae4942df r18413:e892ae4942df r15622:c2778abdd3fd r8085:1bbb83a278de r8085:1bbb83a278de r8085:1bbb83a278de r8085:1bbb83a278de r8085:1bbb83a278de r8085:1bbb83a278de r8085:1bbb83a278de r8085:1bbb83a278de r18396:32c4522595fa r18421:2b1f62e977e7 r23607:36c15679007d r8085:1bbb83a278de r18421:2b1f62e977e7 r8085:1bbb83a278de r18421:2b1f62e977e7 r23607:36c15679007d r24651:d256fd14817f r24787:198b505805b2 r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r26399:db15b808f86d r26399:db15b808f86d r10367:2521c24ffcf6 r26399:db15b808f86d r26399:db15b808f86d r23737:64ab3885eee6 r26399:db15b808f86d r15622:c2778abdd3fd r26399:db15b808f86d r10367:2521c24ffcf6 r26068:680a9b9b1ab0 r26068:680a9b9b1ab0 r26068:680a9b9b1ab0 r26068:680a9b9b1ab0 r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r27214:65cf255516f2 r27214:65cf255516f2 r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r24652:1e2c1f8dac4c r18396:32c4522595fa r16560:73269894b72b r17127:fe5262df76e1 r17127:fe5262df76e1 r26399:db15b808f86d r8085:1bbb83a278de r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r19944:25a78576fb5e r15622:c2778abdd3fd r15622:c2778abdd3fd r27214:65cf255516f2 r27214:65cf255516f2 r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r15622:c2778abdd3fd r18615:58609f373bce r15622:c2778abdd3fd r8085:1bbb83a278de r10249:a19adec3c686 r11204:2dafdebe5650 r18615:58609f373bce r11204:2dafdebe5650 r27221:3735cc2cef6b r10249:a19adec3c686 r10249:a19adec3c686 r10249:a19adec3c686 r10249:a19adec3c686 r10249:a19adec3c686 r10249:a19adec3c686 r11085:c87a330fb4c2 r19944:25a78576fb5e r10249:a19adec3c686 r10249:a19adec3c686 r10249:a19adec3c686 r11085:c87a330fb4c2 r10249:a19adec3c686 r16431:ec558deca9d7 r27221:3735cc2cef6b r27214:65cf255516f2 r10249:a19adec3c686 r14635:a75264d517b7 r10249:a19adec3c686 r27221:3735cc2cef6b r8085:1bbb83a278de | /*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file strings.cpp Handling of translated strings. */
#include "stdafx.h"
#include "currency.h"
#include "station_base.h"
#include "town.h"
#include "waypoint_base.h"
#include "depot_base.h"
#include "industry.h"
#include "newgrf_text.h"
#include "fileio_func.h"
#include "signs_base.h"
#include "fontdetection.h"
#include "error.h"
#include "error_func.h"
#include "strings_func.h"
#include "rev.h"
#include "core/endian_func.hpp"
#include "timer/timer_game_calendar.h"
#include "vehicle_base.h"
#include "engine_base.h"
#include "language.h"
#include "townname_func.h"
#include "string_func.h"
#include "company_base.h"
#include "smallmap_gui.h"
#include "window_func.h"
#include "debug.h"
#include "game/game_text.hpp"
#include "network/network_content_gui.h"
#include "newgrf_engine.h"
#include "core/backup_type.hpp"
#include <stack>
#include <charconv>
#include "table/strings.h"
#include "table/control_codes.h"
#include "3rdparty/fmt/std.h"
#include "strings_internal.h"
#include "safeguards.h"
std::string _config_language_file; ///< The file (name) stored in the configuration.
LanguageList _languages; ///< The actual list of language meta data.
const LanguageMetadata *_current_language = nullptr; ///< The currently loaded language.
TextDirection _current_text_dir; ///< Text direction of the currently selected language.
#ifdef WITH_ICU_I18N
std::unique_ptr<icu::Collator> _current_collator; ///< Collator for the language currently in use.
#endif /* WITH_ICU_I18N */
AllocatedStringParameters _global_string_params(20);
/**
* Prepare the string parameters for the next formatting run. This means
* resetting the type information and resetting the offset to the begin.
*/
void StringParameters::PrepareForNextRun()
{
for (auto ¶m : this->parameters) param.type = 0;
this->offset = 0;
}
/**
* Read an int64 from the argument array. The offset is increased
* so the next time GetInt64 is called the next value is read.
*/
int64 StringParameters::GetInt64()
{
assert(this->next_type == 0 || (SCC_CONTROL_START <= this->next_type && this->next_type <= SCC_CONTROL_END));
if (this->offset >= this->parameters.size()) {
Debug(misc, 0, "Trying to read invalid string parameter");
return 0;
}
auto ¶m = this->parameters[this->offset++];
if (param.type != 0 && param.type != this->next_type) {
Debug(misc, 0, "Trying to read string parameter with wrong type");
this->next_type = 0;
return 0;
}
param.type = next_type;
this->next_type = 0;
return param.data;
}
/**
* Set a string parameter \a v at index \a n in the global string parameter array.
* @param n Index of the string parameter.
* @param v Value of the string parameter.
*/
void SetDParam(size_t n, uint64_t v)
{
_global_string_params.SetParam(n, v);
}
/**
* Get the current string parameter at index \a n from the global string parameter array.
* @param n Index of the string parameter.
* @return Value of the requested string parameter.
*/
uint64_t GetDParam(size_t n)
{
return _global_string_params.GetParam(n);
}
/**
* Set DParam n to some number that is suitable for string size computations.
* @param n Index of the string parameter.
* @param max_value The biggest value which shall be displayed.
* For the result only the number of digits of \a max_value matter.
* @param min_count Minimum number of digits independent of \a max.
* @param size Font of the number
*/
void SetDParamMaxValue(size_t n, uint64_t max_value, uint min_count, FontSize size)
{
uint num_digits = 1;
while (max_value >= 10) {
num_digits++;
max_value /= 10;
}
SetDParamMaxDigits(n, std::max(min_count, num_digits), size);
}
/**
* Set DParam n to some number that is suitable for string size computations.
* @param n Index of the string parameter.
* @param count Number of digits which shall be displayable.
* @param size Font of the number
*/
void SetDParamMaxDigits(size_t n, uint count, FontSize size)
{
uint front = 0;
uint next = 0;
GetBroadestDigit(&front, &next, size);
uint64 val = count > 1 ? front : next;
for (; count > 1; count--) {
val = 10 * val + next;
}
SetDParam(n, val);
}
/**
* Copy \a num string parameters from array \a src into the global string parameter array.
* @param src Source array of string parameters.
* @param num Number of string parameters to copy.
*/
void CopyInDParam(const uint64 *src, int num)
{
for (int i = 0; i < num; i++) SetDParam(i, src[i]);
}
/**
* Copy \a num string parameters from the global string parameter array to the \a dst array.
* @param dst Destination array of string parameters.
* @param num Number of string parameters to copy.
*/
void CopyOutDParam(uint64 *dst, int num)
{
for (int i = 0; i < num; i++) dst[i] = GetDParam(i);
}
/**
* Copy \a num string parameters from the global string parameter array to the \a dst array.
* Furthermore clone raw string parameters into \a strings and amend the data in \a dst.
* @param dst Destination array of string parameters.
* @param strings Destination array for clone of the raw strings. Must be of same length as dst. Deallocation left to the caller.
* @param string The string used to determine where raw strings are and where there are no raw strings.
* @param num Number of string parameters to copy.
*/
void CopyOutDParam(uint64 *dst, const char **strings, StringID string, int num)
{
/* Just get the string to extract the type information. */
GetString(string);
for (int i = 0; i < num; i++) {
if (_global_string_params.GetTypeAtOffset(i) == SCC_RAW_STRING_POINTER) {
strings[i] = stredup((const char *)(size_t)_global_string_params.GetParam(i));
dst[i] = (size_t)strings[i];
} else {
strings[i] = nullptr;
dst[i] = _global_string_params.GetParam(i);
}
}
}
static void StationGetSpecialString(StringBuilder &builder, int x);
static void GetSpecialTownNameString(StringBuilder &builder, int ind, uint32 seed);
static void GetSpecialNameString(StringBuilder &builder, int ind, StringParameters &args);
static void FormatString(StringBuilder &builder, const char *str, StringParameters &args, uint case_index = 0, bool game_script = false, bool dry_run = false);
struct LanguagePack : public LanguagePackHeader {
char data[]; // list of strings
};
struct LanguagePackDeleter {
void operator()(LanguagePack *langpack)
{
/* LanguagePack is in fact reinterpreted char[], we need to reinterpret it back to free it properly. */
delete[] reinterpret_cast<char*>(langpack);
}
};
struct LoadedLanguagePack {
std::unique_ptr<LanguagePack, LanguagePackDeleter> langpack;
std::vector<char *> offsets;
std::array<uint, TEXT_TAB_END> langtab_num; ///< Offset into langpack offs
std::array<uint, TEXT_TAB_END> langtab_start; ///< Offset into langpack offs
};
static LoadedLanguagePack _langpack;
static bool _scan_for_gender_data = false; ///< Are we scanning for the gender of the current string? (instead of formatting it)
const char *GetStringPtr(StringID string)
{
switch (GetStringTab(string)) {
case TEXT_TAB_GAMESCRIPT_START: return GetGameStringPtr(GetStringIndex(string));
/* 0xD0xx and 0xD4xx IDs have been converted earlier. */
case TEXT_TAB_OLD_NEWGRF: NOT_REACHED();
case TEXT_TAB_NEWGRF_START: return GetGRFStringPtr(GetStringIndex(string));
default: return _langpack.offsets[_langpack.langtab_start[GetStringTab(string)] + GetStringIndex(string)];
}
}
/**
* Get a parsed string with most special stringcodes replaced by the string parameters.
* @param builder The builder of the string.
* @param string The ID of the string to parse.
* @param args Arguments for the string.
* @param case_index The "case index". This will only be set when FormatString wants to print the string in a different case.
* @param game_script The string is coming directly from a game script.
*/
void GetStringWithArgs(StringBuilder &builder, StringID string, StringParameters &args, uint case_index, bool game_script)
{
if (string == 0) {
GetStringWithArgs(builder, STR_UNDEFINED, args);
return;
}
uint index = GetStringIndex(string);
StringTab tab = GetStringTab(string);
switch (tab) {
case TEXT_TAB_TOWN:
if (index >= 0xC0 && !game_script) {
GetSpecialTownNameString(builder, index - 0xC0, args.GetInt32());
return;
}
break;
case TEXT_TAB_SPECIAL:
if (index >= 0xE4 && !game_script) {
GetSpecialNameString(builder, index - 0xE4, args);
return;
}
break;
case TEXT_TAB_OLD_CUSTOM:
/* Old table for custom names. This is no longer used */
if (!game_script) {
FatalError("Incorrect conversion of custom name string.");
}
break;
case TEXT_TAB_GAMESCRIPT_START: {
FormatString(builder, GetGameStringPtr(index), args, case_index, true);
return;
}
case TEXT_TAB_OLD_NEWGRF:
NOT_REACHED();
case TEXT_TAB_NEWGRF_START: {
FormatString(builder, GetGRFStringPtr(index), args, case_index);
return;
}
default:
break;
}
if (index >= _langpack.langtab_num[tab]) {
if (game_script) {
return GetStringWithArgs(builder, STR_UNDEFINED, args);
}
FatalError("String 0x{:X} is invalid. You are probably using an old version of the .lng file.\n", string);
}
FormatString(builder, GetStringPtr(string), args, case_index);
}
/**
* Resolve the given StringID into a std::string with all the associated
* DParam lookups and formatting.
* @param string The unique identifier of the translatable string.
* @return The std::string of the translated string.
*/
std::string GetString(StringID string)
{
_global_string_params.PrepareForNextRun();
return GetStringWithArgs(string, _global_string_params);
}
/**
* Get a parsed string with most special stringcodes replaced by the string parameters.
* @param string The ID of the string to parse.
* @param args Arguments for the string.
* @return The parsed string.
*/
std::string GetStringWithArgs(StringID string, StringParameters &args)
{
std::string result;
StringBuilder builder(result);
GetStringWithArgs(builder, string, args);
return result;
}
/**
* This function is used to "bind" a C string to a OpenTTD dparam slot.
* @param n slot of the string
* @param str string to bind
*/
void SetDParamStr(size_t n, const char *str)
{
_global_string_params.SetParam(n, str);
}
/**
* This function is used to "bind" the C string of a std::string to a OpenTTD dparam slot.
* The caller has to ensure that the std::string reference remains valid while the string is shown.
* @param n slot of the string
* @param str string to bind
*/
void SetDParamStr(size_t n, const std::string &str)
{
_global_string_params.SetParam(n, str);
}
/**
* Format a number into a string.
* @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
* @param zerofill minimum number of digits to print for the integer part. The number will be filled with zeros at the front if necessary.
* @param fractional_digits number of fractional digits to display after a decimal separator. The decimal separator is inserted
* in front of the \a fractional_digits last digit of \a number.
*/
static void FormatNumber(StringBuilder &builder, int64 number, const char *separator, int zerofill = 1, int fractional_digits = 0)
{
static const int max_digits = 20;
uint64 divisor = 10000000000000000000ULL;
zerofill += fractional_digits;
int thousands_offset = (max_digits - fractional_digits - 1) % 3;
if (number < 0) {
builder += '-';
number = -number;
}
uint64 num = number;
uint64 tot = 0;
for (int i = 0; i < max_digits; i++) {
if (i == max_digits - fractional_digits) {
const char *decimal_separator = _settings_game.locale.digit_decimal_separator.c_str();
if (StrEmpty(decimal_separator)) decimal_separator = _langpack.langpack->digit_decimal_separator;
builder += decimal_separator;
}
uint64 quot = 0;
if (num >= divisor) {
quot = num / divisor;
num = num % divisor;
}
if ((tot |= quot) || i >= max_digits - zerofill) {
builder += '0' + quot; // quot is a single digit
if ((i % 3) == thousands_offset && i < max_digits - 1 - fractional_digits) builder += separator;
}
divisor /= 10;
}
}
static void FormatCommaNumber(StringBuilder &builder, int64 number, int fractional_digits = 0)
{
const char *separator = _settings_game.locale.digit_group_separator.c_str();
if (StrEmpty(separator)) separator = _langpack.langpack->digit_group_separator;
FormatNumber(builder, number, separator, 1, fractional_digits);
}
static void FormatNoCommaNumber(StringBuilder &builder, int64 number)
{
FormatNumber(builder, number, "");
}
static void FormatZerofillNumber(StringBuilder &builder, int64 number, int64 count)
{
FormatNumber(builder, number, "", count);
}
static void FormatHexNumber(StringBuilder &builder, uint64 number)
{
fmt::format_to(builder, "0x{:X}", number);
}
/**
* Format a given number as a number of bytes with the SI prefix.
* @param builder the string builder to write to
* @param number the number of bytes to write down
*/
static void FormatBytes(StringBuilder &builder, int64 number)
{
assert(number >= 0);
/* 1 2^10 2^20 2^30 2^40 2^50 2^60 */
const char * const iec_prefixes[] = {"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei"};
uint id = 1;
while (number >= 1024 * 1024) {
number /= 1024;
id++;
}
const char *decimal_separator = _settings_game.locale.digit_decimal_separator.c_str();
if (StrEmpty(decimal_separator)) decimal_separator = _langpack.langpack->digit_decimal_separator;
if (number < 1024) {
id = 0;
fmt::format_to(builder, "{}", number);
} else if (number < 1024 * 10) {
fmt::format_to(builder, "{}{}{:02}", number / 1024, decimal_separator, (number % 1024) * 100 / 1024);
} else if (number < 1024 * 100) {
fmt::format_to(builder, "{}{}{:01}", number / 1024, decimal_separator, (number % 1024) * 10 / 1024);
} else {
assert(number < 1024 * 1024);
fmt::format_to(builder, "{}", number / 1024);
}
assert(id < lengthof(iec_prefixes));
fmt::format_to(builder, NBSP "{}B", iec_prefixes[id]);
}
static void FormatYmdString(StringBuilder &builder, TimerGameCalendar::Date date, uint case_index)
{
TimerGameCalendar::YearMonthDay ymd;
TimerGameCalendar::ConvertDateToYMD(date, &ymd);
auto tmp_params = MakeParameters(ymd.day + STR_DAY_NUMBER_1ST - 1, STR_MONTH_ABBREV_JAN + ymd.month, ymd.year);
FormatString(builder, GetStringPtr(STR_FORMAT_DATE_LONG), tmp_params, case_index);
}
static void FormatMonthAndYear(StringBuilder &builder, TimerGameCalendar::Date date, uint case_index)
{
TimerGameCalendar::YearMonthDay ymd;
TimerGameCalendar::ConvertDateToYMD(date, &ymd);
auto tmp_params = MakeParameters(STR_MONTH_JAN + ymd.month, ymd.year);
FormatString(builder, GetStringPtr(STR_FORMAT_DATE_SHORT), tmp_params, case_index);
}
static void FormatTinyOrISODate(StringBuilder &builder, TimerGameCalendar::Date date, StringID str)
{
TimerGameCalendar::YearMonthDay ymd;
TimerGameCalendar::ConvertDateToYMD(date, &ymd);
/* Day and month are zero-padded with ZEROFILL_NUM, hence the two 2s. */
auto tmp_params = MakeParameters(ymd.day, 2, ymd.month + 1, 2, ymd.year);
FormatString(builder, GetStringPtr(str), tmp_params);
}
static void FormatGenericCurrency(StringBuilder &builder, const CurrencySpec *spec, Money number, bool compact)
{
/* We are going to make number absolute for printing, so
* keep this piece of data as we need it later on */
bool negative = number < 0;
const char *multiplier = "";
number *= spec->rate;
/* convert from negative */
if (number < 0) {
builder.Utf8Encode(SCC_PUSH_COLOUR);
builder.Utf8Encode(SCC_RED);
builder += '-';
number = -number;
}
/* Add prefix part, following symbol_pos specification.
* Here, it can can be either 0 (prefix) or 2 (both prefix and suffix).
* The only remaining value is 1 (suffix), so everything that is not 1 */
if (spec->symbol_pos != 1) builder += spec->prefix;
/* for huge numbers, compact the number into k or M */
if (compact) {
/* Take care of the 'k' rounding. Having 1 000 000 k
* and 1 000 M is inconsistent, so always use 1 000 M. */
if (number >= 1000000000 - 500) {
number = (number + 500000) / 1000000;
multiplier = NBSP "M";
} else if (number >= 1000000) {
number = (number + 500) / 1000;
multiplier = NBSP "k";
}
}
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);
builder += multiplier;
/* Add suffix part, following symbol_pos specification.
* Here, it can can be either 1 (suffix) or 2 (both prefix and suffix).
* The only remaining value is 1 (prefix), so everything that is not 0 */
if (spec->symbol_pos != 0) builder += spec->suffix;
if (negative) {
builder.Utf8Encode(SCC_POP_COLOUR);
}
}
/**
* Determine the "plural" index given a plural form and a number.
* @param count The number to get the plural index of.
* @param plural_form The plural form we want an index for.
* @return The plural index for the given form.
*/
static int DeterminePluralForm(int64 count, int plural_form)
{
/* The absolute value determines plurality */
uint64 n = abs(count);
switch (plural_form) {
default:
NOT_REACHED();
/* Two forms: singular used for one only.
* Used in:
* Danish, Dutch, English, German, Norwegian, Swedish, Estonian, Finnish,
* Greek, Hebrew, Italian, Portuguese, Spanish, Esperanto */
case 0:
return n != 1 ? 1 : 0;
/* Only one form.
* Used in:
* Hungarian, Japanese, Turkish */
case 1:
return 0;
/* Two forms: singular used for 0 and 1.
* Used in:
* French, Brazilian Portuguese */
case 2:
return n > 1 ? 1 : 0;
/* Three forms: special cases for 0, and numbers ending in 1 except when ending in 11.
* Note: Cases are out of order for hysterical reasons. '0' is last.
* Used in:
* Latvian */
case 3:
return n % 10 == 1 && n % 100 != 11 ? 0 : n != 0 ? 1 : 2;
/* Five forms: special cases for 1, 2, 3 to 6, and 7 to 10.
* Used in:
* Gaelige (Irish) */
case 4:
return n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4;
/* Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 9 except when ending in 12 to 19.
* Used in:
* Lithuanian */
case 5:
return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2;
/* Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 4 except when ending in 12 to 14.
* Used in:
* Croatian, Russian, Ukrainian */
case 6:
return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2;
/* Three forms: special cases for 1, and numbers ending in 2 to 4 except when ending in 12 to 14.
* Used in:
* Polish */
case 7:
return n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2;
/* Four forms: special cases for numbers ending in 01, 02, and 03 to 04.
* Used in:
* Slovenian */
case 8:
return n % 100 == 1 ? 0 : n % 100 == 2 ? 1 : n % 100 == 3 || n % 100 == 4 ? 2 : 3;
/* Two forms: singular used for numbers ending in 1 except when ending in 11.
* Used in:
* Icelandic */
case 9:
return n % 10 == 1 && n % 100 != 11 ? 0 : 1;
/* Three forms: special cases for 1, and 2 to 4
* Used in:
* Czech, Slovak */
case 10:
return n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2;
/* Two forms: cases for numbers ending with a consonant, and with a vowel.
* Korean doesn't have the concept of plural, but depending on how a
* number is pronounced it needs another version of a particle.
* As such the plural system is misused to give this distinction.
*/
case 11:
switch (n % 10) {
case 0: // yeong
case 1: // il
case 3: // sam
case 6: // yuk
case 7: // chil
case 8: // pal
return 0;
case 2: // i
case 4: // sa
case 5: // o
case 9: // gu
return 1;
default:
NOT_REACHED();
}
/* Four forms: special cases for 1, 0 and numbers ending in 02 to 10, and numbers ending in 11 to 19.
* Used in:
* Maltese */
case 12:
return (n == 1 ? 0 : n == 0 || (n % 100 > 1 && n % 100 < 11) ? 1 : (n % 100 > 10 && n % 100 < 20) ? 2 : 3);
/* Four forms: special cases for 1 and 11, 2 and 12, 3 .. 10 and 13 .. 19, other
* Used in:
* Scottish Gaelic */
case 13:
return ((n == 1 || n == 11) ? 0 : (n == 2 || n == 12) ? 1 : ((n > 2 && n < 11) || (n > 12 && n < 20)) ? 2 : 3);
/* Three forms: special cases for 1, 0 and numbers ending in 01 to 19.
* Used in:
* Romanian */
case 14:
return n == 1 ? 0 : (n == 0 || (n % 100 > 0 && n % 100 < 20)) ? 1 : 2;
}
}
static const char *ParseStringChoice(const char *b, uint form, StringBuilder &builder)
{
/* <NUM> {Length of each string} {each string} */
uint n = (byte)*b++;
uint pos, i, mypos = 0;
for (i = pos = 0; i != n; i++) {
uint len = (byte)*b++;
if (i == form) mypos = pos;
pos += len;
}
builder += b + mypos;
return b + pos;
}
/** Helper for unit conversion. */
struct UnitConversion {
double factor; ///< Amount to multiply or divide upon conversion.
/**
* Convert value from OpenTTD's internal unit into the displayed value.
* @param input The input to convert.
* @param round Whether to round the value or not.
* @return The converted value.
*/
int64 ToDisplay(int64 input, bool round = true) const
{
return round
? (int64_t)std::round(input * this->factor)
: (int64_t)(input * this->factor);
}
/**
* Convert the displayed value back into a value of OpenTTD's internal unit.
* @param input The input to convert.
* @param round Whether to round the value up or not.
* @param divider Divide the return value by this.
* @return The converted value.
*/
int64 FromDisplay(int64 input, bool round = true, int64 divider = 1) const
{
return round
? (int64_t)std::round(input / this->factor / divider)
: (int64_t)(input / this->factor / divider);
}
};
/** Information about a specific unit system. */
struct Units {
UnitConversion c; ///< Conversion
StringID s; ///< String for the unit
unsigned int decimal_places; ///< Number of decimal places embedded in the value. For example, 1 if the value is in tenths, and 3 if the value is in thousandths.
};
/** Information about a specific unit system with a long variant. */
struct UnitsLong {
UnitConversion c; ///< Conversion
StringID s; ///< String for the short variant of the unit
StringID l; ///< String for the long variant of the unit
unsigned int decimal_places; ///< Number of decimal places embedded in the value. For example, 1 if the value is in tenths, and 3 if the value is in thousandths.
};
/** Unit conversions for velocity. */
static const Units _units_velocity[] = {
{ { 1.0 }, STR_UNITS_VELOCITY_IMPERIAL, 0 },
{ { 1.609344 }, STR_UNITS_VELOCITY_METRIC, 0 },
{ { 0.44704 }, STR_UNITS_VELOCITY_SI, 0 },
{ { 0.578125 }, STR_UNITS_VELOCITY_GAMEUNITS, 1 },
{ { 0.868976 }, STR_UNITS_VELOCITY_KNOTS, 0 },
};
/** Unit conversions for power. */
static const Units _units_power[] = {
{ { 1.0 }, STR_UNITS_POWER_IMPERIAL, 0 },
{ { 1.01387 }, STR_UNITS_POWER_METRIC, 0 },
{ { 0.745699 }, STR_UNITS_POWER_SI, 0 },
};
/** Unit conversions for power to weight. */
static const Units _units_power_to_weight[] = {
{ { 0.907185 }, STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL, 1 },
{ { 1.0 }, STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC, 1 },
{ { 1.0 }, STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI, 1 },
{ { 0.919768 }, STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL, 1 },
{ { 1.01387 }, STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC, 1 },
{ { 1.01387 }, STR_UNITS_POWER_METRIC_TO_WEIGHT_SI, 1 },
{ { 0.676487 }, STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL, 1 },
{ { 0.745699 }, STR_UNITS_POWER_SI_TO_WEIGHT_METRIC, 1 },
{ { 0.745699 }, STR_UNITS_POWER_SI_TO_WEIGHT_SI, 1 },
};
/** Unit conversions for weight. */
static const UnitsLong _units_weight[] = {
{ { 1.102311 }, STR_UNITS_WEIGHT_SHORT_IMPERIAL, STR_UNITS_WEIGHT_LONG_IMPERIAL, 0 },
{ { 1.0 }, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC, 0 },
{ { 1000.0 }, STR_UNITS_WEIGHT_SHORT_SI, STR_UNITS_WEIGHT_LONG_SI, 0 },
};
/** Unit conversions for volume. */
static const UnitsLong _units_volume[] = {
{ { 264.172 }, STR_UNITS_VOLUME_SHORT_IMPERIAL, STR_UNITS_VOLUME_LONG_IMPERIAL, 0 },
{ { 1000.0 }, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC, 0 },
{ { 1.0 }, STR_UNITS_VOLUME_SHORT_SI, STR_UNITS_VOLUME_LONG_SI, 0 },
};
/** Unit conversions for force. */
static const Units _units_force[] = {
{ { 0.224809 }, STR_UNITS_FORCE_IMPERIAL, 0 },
{ { 0.101972 }, STR_UNITS_FORCE_METRIC, 0 },
{ { 0.001 }, STR_UNITS_FORCE_SI, 0 },
};
/** Unit conversions for height. */
static const Units _units_height[] = {
{ { 3.0 }, STR_UNITS_HEIGHT_IMPERIAL, 0 }, // "Wrong" conversion factor for more nicer GUI values
{ { 1.0 }, STR_UNITS_HEIGHT_METRIC, 0 },
{ { 1.0 }, STR_UNITS_HEIGHT_SI, 0 },
};
/**
* Get index for velocity conversion units for a vehicle type.
* @param type VehicleType to convert velocity for.
* @return Index within velocity conversion units for vehicle type.
*/
static byte GetVelocityUnits(VehicleType type)
{
if (type == VEH_SHIP || type == VEH_AIRCRAFT) return _settings_game.locale.units_velocity_nautical;
return _settings_game.locale.units_velocity;
}
/**
* Convert the given (internal) speed to the display speed.
* @param speed the speed to convert
* @return the converted speed.
*/
uint ConvertSpeedToDisplaySpeed(uint speed, VehicleType type)
{
/* For historical reasons we don't want to mess with the
* conversion for speed. So, don't round it and keep the
* original conversion factors instead of the real ones. */
return _units_velocity[GetVelocityUnits(type)].c.ToDisplay(speed, false);
}
/**
* Convert the given display speed to the (internal) speed.
* @param speed the speed to convert
* @return the converted speed.
*/
uint ConvertDisplaySpeedToSpeed(uint speed, VehicleType type)
{
return _units_velocity[GetVelocityUnits(type)].c.FromDisplay(speed);
}
/**
* Convert the given km/h-ish speed to the display speed.
* @param speed the speed to convert
* @return the converted speed.
*/
uint ConvertKmhishSpeedToDisplaySpeed(uint speed, VehicleType type)
{
return _units_velocity[GetVelocityUnits(type)].c.ToDisplay(speed * 10, false) / 16;
}
/**
* Convert the given display speed to the km/h-ish speed.
* @param speed the speed to convert
* @return the converted speed.
*/
uint ConvertDisplaySpeedToKmhishSpeed(uint speed, VehicleType type)
{
return _units_velocity[GetVelocityUnits(type)].c.FromDisplay(speed * 16, true, 10);
}
static std::vector<const char *> _game_script_raw_strings;
/**
* Parse most format codes within a string and write the result to a buffer.
* @param builder The string builder to write the final string to.
* @param str_arg The original string with format codes.
* @param args Pointer to extra arguments used by various string codes.
* @param dry_run True when the args' type data is not yet initialized.
*/
static void FormatString(StringBuilder &builder, const char *str_arg, StringParameters &args, uint case_index, bool game_script, bool dry_run)
{
size_t orig_offset = args.GetOffset();
if (!dry_run) {
/*
* This function is normally called with `dry_run` false, then we call this function again
* with `dry_run` being true. The dry run is required for the gender formatting. For the
* gender determination we need to format a sub string to get the gender, but for that we
* need to know as what string control code type the specific parameter is encoded. Since
* gendered words can be before the "parameter" words, this needs to be determined before
* the actual formatting.
*/
std::string buffer;
StringBuilder dry_run_builder(buffer);
if (UsingNewGRFTextStack()) {
/* Values from the NewGRF text stack are only copied to the normal
* argv array at the time they are encountered. That means that if
* another string command references a value later in the string it
* would fail. We solve that by running FormatString twice. The first
* pass makes sure the argv array is correctly filled and the second
* pass can reference later values without problems. */
struct TextRefStack *backup = CreateTextRefStackBackup();
FormatString(dry_run_builder, str_arg, args, case_index, game_script, true);
RestoreTextRefStackBackup(backup);
} else {
FormatString(dry_run_builder, str_arg, args, case_index, game_script, true);
}
/* We have to restore the original offset here to to read the correct values. */
args.SetOffset(orig_offset);
}
WChar b = '\0';
uint next_substr_case_index = 0;
std::stack<const char *, std::vector<const char *>> str_stack;
str_stack.push(str_arg);
for (;;) {
while (!str_stack.empty() && (b = Utf8Consume(&str_stack.top())) == '\0') {
str_stack.pop();
}
if (str_stack.empty()) break;
const char *&str = str_stack.top();
if (SCC_NEWGRF_FIRST <= b && b <= SCC_NEWGRF_LAST) {
/* We need to pass some stuff as it might be modified. */
StringParameters remaining = args.GetRemainingParameters();
b = RemapNewGRFStringControlCode(b, &str, remaining, dry_run);
if (b == 0) continue;
}
if (b < SCC_CONTROL_START || b > SCC_CONTROL_END) {
builder.Utf8Encode(b);
continue;
}
args.SetTypeOfNextParameter(b);
switch (b) {
case SCC_ENCODED: {
bool sub_args_need_free[20];
AllocatedStringParameters sub_args(20);
memset(sub_args_need_free, 0, sizeof(sub_args_need_free));
char *p;
uint32 stringid = std::strtoul(str, &p, 16);
if (*p != ':' && *p != '\0') {
while (*p != '\0') p++;
str = p;
builder += "(invalid SCC_ENCODED)";
break;
}
if (stringid >= TAB_SIZE_GAMESCRIPT) {
while (*p != '\0') p++;
str = p;
builder += "(invalid StringID)";
break;
}
int i = 0;
while (*p != '\0' && i < 20) {
uint64 param;
const char *s = ++p;
/* Find the next value */
bool instring = false;
bool escape = false;
for (;; p++) {
if (*p == '\\') {
escape = true;
continue;
}
if (*p == '"' && escape) {
escape = false;
continue;
}
escape = false;
if (*p == '"') {
instring = !instring;
continue;
}
if (instring) {
continue;
}
if (*p == ':') break;
if (*p == '\0') break;
}
if (*s != '"') {
/* Check if we want to look up another string */
WChar l;
size_t len = Utf8Decode(&l, s);
bool lookup = (l == SCC_ENCODED);
if (lookup) s += len;
param = std::strtoull(s, &p, 16);
if (lookup) {
if (param >= TAB_SIZE_GAMESCRIPT) {
while (*p != '\0') p++;
str = p;
builder += "(invalid sub-StringID)";
break;
}
param = MakeStringID(TEXT_TAB_GAMESCRIPT_START, param);
}
sub_args.SetParam(i++, param);
} else {
s++; // skip the leading \"
char *g = stredup(s);
g[p - s - 1] = '\0'; // skip the trailing \"
sub_args_need_free[i] = true;
sub_args.SetParam(i++, (uint64)(size_t)g);
_game_script_raw_strings.push_back(g);
}
}
/* If we didn't error out, we can actually print the string. */
if (*str != '\0') {
str = p;
GetStringWithArgs(builder, MakeStringID(TEXT_TAB_GAMESCRIPT_START, stringid), sub_args, true);
}
for (i = 0; i < 20; i++) {
if (sub_args_need_free[i]) {
free((void *)sub_args.GetParam(i));
_game_script_raw_strings.pop_back();
}
}
break;
}
case SCC_NEWGRF_STRINL: {
StringID substr = Utf8Consume(&str);
str_stack.push(GetStringPtr(substr));
break;
}
case SCC_NEWGRF_PRINT_WORD_STRING_ID: {
StringID substr = args.GetInt32();
str_stack.push(GetStringPtr(substr));
case_index = next_substr_case_index;
next_substr_case_index = 0;
break;
}
case SCC_GENDER_LIST: { // {G 0 Der Die Das}
/* First read the meta data from the language file. */
size_t offset = orig_offset + (byte)*str++;
int gender = 0;
if (!dry_run && args.GetTypeAtOffset(offset) != 0) {
/* Now we need to figure out what text to resolve, i.e.
* what do we need to draw? So get the actual raw string
* first using the control code to get said string. */
char input[4 + 1];
char *p = input + Utf8Encode(input, args.GetTypeAtOffset(offset));
*p = '\0';
/* The gender is stored at the start of the formatted string. */
bool old_sgd = _scan_for_gender_data;
_scan_for_gender_data = true;
std::string buffer;
StringBuilder tmp_builder(buffer);
StringParameters tmp_params = args.GetRemainingParameters(offset);
FormatString(tmp_builder, input, tmp_params);
_scan_for_gender_data = old_sgd;
/* And determine the string. */
const char *s = buffer.c_str();
WChar c = Utf8Consume(&s);
/* Does this string have a gender, if so, set it */
if (c == SCC_GENDER_INDEX) gender = (byte)s[0];
}
str = ParseStringChoice(str, gender, builder);
break;
}
/* This sets up the gender for the string.
* We just ignore this one. It's used in {G 0 Der Die Das} to determine the case. */
case SCC_GENDER_INDEX: // {GENDER 0}
if (_scan_for_gender_data) {
builder.Utf8Encode(SCC_GENDER_INDEX);
builder += *str++;
} else {
str++;
}
break;
case SCC_PLURAL_LIST: { // {P}
int plural_form = *str++; // contains the plural form for this string
size_t offset = orig_offset + (byte)*str++;
int64 v = args.GetParam(offset); // contains the number that determines plural
str = ParseStringChoice(str, DeterminePluralForm(v, plural_form), builder);
break;
}
case SCC_ARG_INDEX: { // Move argument pointer
args.SetOffset(orig_offset + (byte)*str++);
break;
}
case SCC_SET_CASE: { // {SET_CASE}
/* This is a pseudo command, it's outputted when someone does {STRING.ack}
* The modifier is added to all subsequent GetStringWithArgs that accept the modifier. */
next_substr_case_index = (byte)*str++;
break;
}
case SCC_SWITCH_CASE: { // {Used to implement case switching}
/* <0x9E> <NUM CASES> <CASE1> <LEN1> <STRING1> <CASE2> <LEN2> <STRING2> <CASE3> <LEN3> <STRING3> <STRINGDEFAULT>
* Each LEN is printed using 2 bytes in big endian order. */
uint num = (byte)*str++;
while (num) {
if ((byte)str[0] == case_index) {
/* Found the case, adjust str pointer and continue */
str += 3;
break;
}
/* Otherwise skip to the next case */
str += 3 + (str[1] << 8) + str[2];
num--;
}
break;
}
case SCC_REVISION: // {REV}
builder += _openttd_revision;
break;
case SCC_RAW_STRING_POINTER: { // {RAW_STRING}
const char *raw_string = (const char *)(size_t)args.GetInt64();
/* raw_string can be(come) nullptr when the parameter is out of range and 0 is returned instead. */
if (raw_string == nullptr ||
(game_script && std::find(_game_script_raw_strings.begin(), _game_script_raw_strings.end(), raw_string) == _game_script_raw_strings.end())) {
builder += "(invalid RAW_STRING parameter)";
break;
}
FormatString(builder, raw_string, args);
break;
}
case SCC_STRING: {// {STRING}
StringID string_id = args.GetInt32();
if (game_script && GetStringTab(string_id) != TEXT_TAB_GAMESCRIPT_START) break;
/* It's prohibited for the included string to consume any arguments. */
StringParameters tmp_params(args, 0);
GetStringWithArgs(builder, string_id, tmp_params, next_substr_case_index, game_script);
next_substr_case_index = 0;
break;
}
case SCC_STRING1:
case SCC_STRING2:
case SCC_STRING3:
case SCC_STRING4:
case SCC_STRING5:
case SCC_STRING6:
case SCC_STRING7: { // {STRING1..7}
/* Strings that consume arguments */
StringID string_id = args.GetInt32();
if (game_script && GetStringTab(string_id) != TEXT_TAB_GAMESCRIPT_START) break;
uint size = b - SCC_STRING1 + 1;
if (game_script && size > args.GetDataLeft()) {
builder += "(too many parameters)";
} else {
StringParameters sub_args(args, size);
GetStringWithArgs(builder, string_id, sub_args, next_substr_case_index, game_script);
}
next_substr_case_index = 0;
break;
}
case SCC_COMMA: // {COMMA}
FormatCommaNumber(builder, args.GetInt64());
break;
case SCC_DECIMAL: { // {DECIMAL}
int64 number = args.GetInt64();
int digits = args.GetInt32();
FormatCommaNumber(builder, number, digits);
break;
}
case SCC_NUM: // {NUM}
FormatNoCommaNumber(builder, args.GetInt64());
break;
case SCC_ZEROFILL_NUM: { // {ZEROFILL_NUM}
int64 num = args.GetInt64();
FormatZerofillNumber(builder, num, args.GetInt64());
break;
}
case SCC_HEX: // {HEX}
FormatHexNumber(builder, (uint64)args.GetInt64());
break;
case SCC_BYTES: // {BYTES}
FormatBytes(builder, args.GetInt64());
break;
case SCC_CARGO_TINY: { // {CARGO_TINY}
/* Tiny description of cargotypes. Layout:
* param 1: cargo type
* param 2: cargo count */
CargoID cargo = args.GetInt32();
if (cargo >= CargoSpec::GetArraySize()) break;
StringID cargo_str = CargoSpec::Get(cargo)->units_volume;
int64 amount = 0;
switch (cargo_str) {
case STR_TONS:
amount = _units_weight[_settings_game.locale.units_weight].c.ToDisplay(args.GetInt64());
break;
case STR_LITERS:
amount = _units_volume[_settings_game.locale.units_volume].c.ToDisplay(args.GetInt64());
break;
default: {
amount = args.GetInt64();
break;
}
}
FormatCommaNumber(builder, amount);
break;
}
case SCC_CARGO_SHORT: { // {CARGO_SHORT}
/* Short description of cargotypes. Layout:
* param 1: cargo type
* param 2: cargo count */
CargoID cargo = args.GetInt32();
if (cargo >= CargoSpec::GetArraySize()) break;
StringID cargo_str = CargoSpec::Get(cargo)->units_volume;
switch (cargo_str) {
case STR_TONS: {
assert(_settings_game.locale.units_weight < lengthof(_units_weight));
auto tmp_params = MakeParameters(_units_weight[_settings_game.locale.units_weight].c.ToDisplay(args.GetInt64()));
FormatString(builder, GetStringPtr(_units_weight[_settings_game.locale.units_weight].l), tmp_params);
break;
}
case STR_LITERS: {
assert(_settings_game.locale.units_volume < lengthof(_units_volume));
auto tmp_params = MakeParameters(_units_volume[_settings_game.locale.units_volume].c.ToDisplay(args.GetInt64()));
FormatString(builder, GetStringPtr(_units_volume[_settings_game.locale.units_volume].l), tmp_params);
break;
}
default: {
StringParameters tmp_params(args, 1);
GetStringWithArgs(builder, cargo_str, tmp_params);
break;
}
}
break;
}
case SCC_CARGO_LONG: { // {CARGO_LONG}
/* First parameter is cargo type, second parameter is cargo count */
CargoID cargo = args.GetInt32();
if (IsValidCargoID(cargo) && cargo >= CargoSpec::GetArraySize()) break;
StringID cargo_str = !IsValidCargoID(cargo) ? STR_QUANTITY_N_A : CargoSpec::Get(cargo)->quantifier;
StringParameters tmp_args(args, 1);
GetStringWithArgs(builder, cargo_str, tmp_args);
break;
}
case SCC_CARGO_LIST: { // {CARGO_LIST}
CargoTypes cmask = args.GetInt64();
bool first = true;
for (const auto &cs : _sorted_cargo_specs) {
if (!HasBit(cmask, cs->Index())) continue;
if (first) {
first = false;
} else {
/* Add a comma if this is not the first item */
builder += ", ";
}
GetStringWithArgs(builder, cs->name, args, next_substr_case_index, game_script);
}
/* If first is still true then no cargo is accepted */
if (first) GetStringWithArgs(builder, STR_JUST_NOTHING, args, next_substr_case_index, game_script);
next_substr_case_index = 0;
break;
}
case SCC_CURRENCY_SHORT: // {CURRENCY_SHORT}
FormatGenericCurrency(builder, _currency, args.GetInt64(), true);
break;
case SCC_CURRENCY_LONG: // {CURRENCY_LONG}
FormatGenericCurrency(builder, _currency, args.GetInt64(), false);
break;
case SCC_DATE_TINY: // {DATE_TINY}
FormatTinyOrISODate(builder, args.GetInt32(), STR_FORMAT_DATE_TINY);
break;
case SCC_DATE_SHORT: // {DATE_SHORT}
FormatMonthAndYear(builder, args.GetInt32(), next_substr_case_index);
next_substr_case_index = 0;
break;
case SCC_DATE_LONG: // {DATE_LONG}
FormatYmdString(builder, args.GetInt32(), next_substr_case_index);
next_substr_case_index = 0;
break;
case SCC_DATE_ISO: // {DATE_ISO}
FormatTinyOrISODate(builder, args.GetInt32(), STR_FORMAT_DATE_ISO);
break;
case SCC_FORCE: { // {FORCE}
assert(_settings_game.locale.units_force < lengthof(_units_force));
const auto &x = _units_force[_settings_game.locale.units_force];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_HEIGHT: { // {HEIGHT}
assert(_settings_game.locale.units_height < lengthof(_units_height));
const auto &x = _units_height[_settings_game.locale.units_height];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_POWER: { // {POWER}
assert(_settings_game.locale.units_power < lengthof(_units_power));
const auto &x = _units_power[_settings_game.locale.units_power];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_POWER_TO_WEIGHT: { // {POWER_TO_WEIGHT}
auto setting = _settings_game.locale.units_power * 3u + _settings_game.locale.units_weight;
assert(setting < lengthof(_units_power_to_weight));
const auto &x = _units_power_to_weight[setting];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_VELOCITY: { // {VELOCITY}
int64 arg = args.GetInt64();
// Unpack vehicle type from packed argument to get desired units.
VehicleType vt = static_cast<VehicleType>(GB(arg, 56, 8));
byte units = GetVelocityUnits(vt);
assert(units < lengthof(_units_velocity));
const auto &x = _units_velocity[units];
auto tmp_params = MakeParameters(ConvertKmhishSpeedToDisplaySpeed(GB(arg, 0, 56), vt), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_VOLUME_SHORT: { // {VOLUME_SHORT}
assert(_settings_game.locale.units_volume < lengthof(_units_volume));
const auto &x = _units_volume[_settings_game.locale.units_volume];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_VOLUME_LONG: { // {VOLUME_LONG}
assert(_settings_game.locale.units_volume < lengthof(_units_volume));
const auto &x = _units_volume[_settings_game.locale.units_volume];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.l), tmp_params);
break;
}
case SCC_WEIGHT_SHORT: { // {WEIGHT_SHORT}
assert(_settings_game.locale.units_weight < lengthof(_units_weight));
const auto &x = _units_weight[_settings_game.locale.units_weight];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.s), tmp_params);
break;
}
case SCC_WEIGHT_LONG: { // {WEIGHT_LONG}
assert(_settings_game.locale.units_weight < lengthof(_units_weight));
const auto &x = _units_weight[_settings_game.locale.units_weight];
auto tmp_params = MakeParameters(x.c.ToDisplay(args.GetInt64()), x.decimal_places);
FormatString(builder, GetStringPtr(x.l), tmp_params);
break;
}
case SCC_COMPANY_NAME: { // {COMPANY}
const Company *c = Company::GetIfValid(args.GetInt32());
if (c == nullptr) break;
if (!c->name.empty()) {
auto tmp_params = MakeParameters(c->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
auto tmp_params = MakeParameters(c->name_2);
GetStringWithArgs(builder, c->name_1, tmp_params);
}
break;
}
case SCC_COMPANY_NUM: { // {COMPANY_NUM}
CompanyID company = (CompanyID)args.GetInt32();
/* Nothing is added for AI or inactive companies */
if (Company::IsValidHumanID(company)) {
auto tmp_params = MakeParameters(company + 1);
GetStringWithArgs(builder, STR_FORMAT_COMPANY_NUM, tmp_params);
}
break;
}
case SCC_DEPOT_NAME: { // {DEPOT}
VehicleType vt = (VehicleType)args.GetInt32();
if (vt == VEH_AIRCRAFT) {
StringParameters tmp_params = StringParameters(args, 1);
GetStringWithArgs(builder, STR_FORMAT_DEPOT_NAME_AIRCRAFT, tmp_params);
break;
}
const Depot *d = Depot::Get(args.GetInt32());
if (!d->name.empty()) {
auto tmp_params = MakeParameters(d->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
auto tmp_params = MakeParameters(d->town->index, d->town_cn + 1);
GetStringWithArgs(builder, STR_FORMAT_DEPOT_NAME_TRAIN + 2 * vt + (d->town_cn == 0 ? 0 : 1), tmp_params);
}
break;
}
case SCC_ENGINE_NAME: { // {ENGINE}
int64 arg = args.GetInt64();
const Engine *e = Engine::GetIfValid(static_cast<EngineID>(arg));
if (e == nullptr) break;
if (!e->name.empty() && e->IsEnabled()) {
auto tmp_params = MakeParameters(e->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
break;
}
if (HasBit(e->info.callback_mask, CBM_VEHICLE_NAME)) {
uint16 callback = GetVehicleCallback(CBID_VEHICLE_NAME, static_cast<uint32>(arg >> 32), 0, e->index, nullptr);
/* Not calling ErrorUnknownCallbackResult due to being inside string processing. */
if (callback != CALLBACK_FAILED && callback < 0x400) {
const GRFFile *grffile = e->GetGRF();
assert(grffile != nullptr);
StartTextRefStackUsage(grffile, 6);
AllocatedStringParameters tmp_params(6);
GetStringWithArgs(builder, GetGRFStringID(grffile->grfid, 0xD000 + callback), tmp_params);
StopTextRefStackUsage();
break;
}
}
auto tmp_params = AllocatedStringParameters();
GetStringWithArgs(builder, e->info.string_id, tmp_params);
break;
}
case SCC_GROUP_NAME: { // {GROUP}
const Group *g = Group::GetIfValid(args.GetInt32());
if (g == nullptr) break;
if (!g->name.empty()) {
auto tmp_params = MakeParameters(g->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
auto tmp_params = MakeParameters(g->index);
GetStringWithArgs(builder, STR_FORMAT_GROUP_NAME, tmp_params);
}
break;
}
case SCC_INDUSTRY_NAME: { // {INDUSTRY}
const Industry *i = Industry::GetIfValid(args.GetInt32());
if (i == nullptr) break;
static bool use_cache = true;
if (use_cache) { // Use cached version if first call
AutoRestoreBackup cache_backup(use_cache, false);
builder += i->GetCachedName();
} else if (_scan_for_gender_data) {
/* Gender is defined by the industry type.
* STR_FORMAT_INDUSTRY_NAME may have the town first, so it would result in the gender of the town name */
auto tmp_params = AllocatedStringParameters();
FormatString(builder, GetStringPtr(GetIndustrySpec(i->type)->name), tmp_params, next_substr_case_index);
} else {
/* First print the town name and the industry type name. */
auto tmp_params = MakeParameters(i->town->index, GetIndustrySpec(i->type)->name);
FormatString(builder, GetStringPtr(STR_FORMAT_INDUSTRY_NAME), tmp_params, next_substr_case_index);
}
next_substr_case_index = 0;
break;
}
case SCC_PRESIDENT_NAME: { // {PRESIDENT_NAME}
const Company *c = Company::GetIfValid(args.GetInt32());
if (c == nullptr) break;
if (!c->president_name.empty()) {
auto tmp_params = MakeParameters(c->president_name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
auto tmp_params = MakeParameters(c->president_name_2);
GetStringWithArgs(builder, c->president_name_1, tmp_params);
}
break;
}
case SCC_STATION_NAME: { // {STATION}
StationID sid = args.GetInt32();
const Station *st = Station::GetIfValid(sid);
if (st == nullptr) {
/* The station doesn't exist anymore. The only place where we might
* be "drawing" an invalid station is in the case of cargo that is
* in transit. */
auto tmp_params = AllocatedStringParameters();
GetStringWithArgs(builder, STR_UNKNOWN_STATION, tmp_params);
break;
}
static bool use_cache = true;
if (use_cache) { // Use cached version if first call
AutoRestoreBackup cache_backup(use_cache, false);
builder += st->GetCachedName();
} else if (!st->name.empty()) {
auto tmp_params = MakeParameters(st->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
StringID string_id = st->string_id;
if (st->indtype != IT_INVALID) {
/* Special case where the industry provides the name for the station */
const IndustrySpec *indsp = GetIndustrySpec(st->indtype);
/* Industry GRFs can change which might remove the station name and
* thus cause very strange things. Here we check for that before we
* actually set the station name. */
if (indsp->station_name != STR_NULL && indsp->station_name != STR_UNDEFINED) {
string_id = indsp->station_name;
}
}
auto tmp_params = MakeParameters(STR_TOWN_NAME, st->town->index, st->index);
GetStringWithArgs(builder, string_id, tmp_params);
}
break;
}
case SCC_TOWN_NAME: { // {TOWN}
const Town *t = Town::GetIfValid(args.GetInt32());
if (t == nullptr) break;
static bool use_cache = true;
if (use_cache) { // Use cached version if first call
AutoRestoreBackup cache_backup(use_cache, false);
builder += t->GetCachedName();
} else if (!t->name.empty()) {
auto tmp_params = MakeParameters(t->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
GetTownName(builder, t);
}
break;
}
case SCC_WAYPOINT_NAME: { // {WAYPOINT}
Waypoint *wp = Waypoint::GetIfValid(args.GetInt32());
if (wp == nullptr) break;
if (!wp->name.empty()) {
auto tmp_params = MakeParameters(wp->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
auto tmp_params = MakeParameters(wp->town->index, wp->town_cn + 1);
StringID string_id = ((wp->string_id == STR_SV_STNAME_BUOY) ? STR_FORMAT_BUOY_NAME : STR_FORMAT_WAYPOINT_NAME);
if (wp->town_cn != 0) string_id++;
GetStringWithArgs(builder, string_id, tmp_params);
}
break;
}
case SCC_VEHICLE_NAME: { // {VEHICLE}
const Vehicle *v = Vehicle::GetIfValid(args.GetInt32());
if (v == nullptr) break;
if (!v->name.empty()) {
auto tmp_params = MakeParameters(v->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else if (v->group_id != DEFAULT_GROUP) {
/* The vehicle has no name, but is member of a group, so print group name */
auto tmp_params = MakeParameters(v->group_id, v->unitnumber);
GetStringWithArgs(builder, STR_FORMAT_GROUP_VEHICLE_NAME, tmp_params);
} else {
auto tmp_params = MakeParameters(v->unitnumber);
StringID string_id;
switch (v->type) {
default: string_id = STR_INVALID_VEHICLE; break;
case VEH_TRAIN: string_id = STR_SV_TRAIN_NAME; break;
case VEH_ROAD: string_id = STR_SV_ROAD_VEHICLE_NAME; break;
case VEH_SHIP: string_id = STR_SV_SHIP_NAME; break;
case VEH_AIRCRAFT: string_id = STR_SV_AIRCRAFT_NAME; break;
}
GetStringWithArgs(builder, string_id, tmp_params);
}
break;
}
case SCC_SIGN_NAME: { // {SIGN}
const Sign *si = Sign::GetIfValid(args.GetInt32());
if (si == nullptr) break;
if (!si->name.empty()) {
auto tmp_params = MakeParameters(si->name);
GetStringWithArgs(builder, STR_JUST_RAW_STRING, tmp_params);
} else {
auto tmp_params = AllocatedStringParameters();
GetStringWithArgs(builder, STR_DEFAULT_SIGN_NAME, tmp_params);
}
break;
}
case SCC_STATION_FEATURES: { // {STATIONFEATURES}
StationGetSpecialString(builder, args.GetInt32());
break;
}
case SCC_COLOUR: { // {COLOUR}
StringControlCode scc = (StringControlCode)(SCC_BLUE + args.GetInt32());
if (IsInsideMM(scc, SCC_BLUE, SCC_COLOUR)) builder.Utf8Encode(scc);
break;
}
default:
builder.Utf8Encode(b);
break;
}
}
}
static void StationGetSpecialString(StringBuilder &builder, int x)
{
if ((x & FACIL_TRAIN) != 0) builder.Utf8Encode(SCC_TRAIN);
if ((x & FACIL_TRUCK_STOP) != 0) builder.Utf8Encode(SCC_LORRY);
if ((x & FACIL_BUS_STOP) != 0) builder.Utf8Encode(SCC_BUS);
if ((x & FACIL_DOCK) != 0) builder.Utf8Encode(SCC_SHIP);
if ((x & FACIL_AIRPORT) != 0) builder.Utf8Encode(SCC_PLANE);
}
static void GetSpecialTownNameString(StringBuilder &builder, int ind, uint32 seed)
{
GenerateTownNameString(builder, ind, seed);
}
static const char * const _silly_company_names[] = {
"Bloggs Brothers",
"Tiny Transport Ltd.",
"Express Travel",
"Comfy-Coach & Co.",
"Crush & Bump Ltd.",
"Broken & Late Ltd.",
"Sam Speedy & Son",
"Supersonic Travel",
"Mike's Motors",
"Lightning International",
"Pannik & Loozit Ltd.",
"Inter-City Transport",
"Getout & Pushit Ltd."
};
static const char * const _surname_list[] = {
"Adams",
"Allan",
"Baker",
"Bigwig",
"Black",
"Bloggs",
"Brown",
"Campbell",
"Gordon",
"Hamilton",
"Hawthorn",
"Higgins",
"Green",
"Gribble",
"Jones",
"McAlpine",
"MacDonald",
"McIntosh",
"Muir",
"Murphy",
"Nelson",
"O'Donnell",
"Parker",
"Phillips",
"Pilkington",
"Quigley",
"Sharkey",
"Thomson",
"Watkins"
};
static const char * const _silly_surname_list[] = {
"Grumpy",
"Dozy",
"Speedy",
"Nosey",
"Dribble",
"Mushroom",
"Cabbage",
"Sniffle",
"Fishy",
"Swindle",
"Sneaky",
"Nutkins"
};
static const char _initial_name_letters[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W',
};
static void GenAndCoName(StringBuilder &builder, uint32 arg)
{
const char * const *base;
uint num;
if (_settings_game.game_creation.landscape == LT_TOYLAND) {
base = _silly_surname_list;
num = lengthof(_silly_surname_list);
} else {
base = _surname_list;
num = lengthof(_surname_list);
}
builder += base[num * GB(arg, 16, 8) >> 8];
builder += " & Co.";
}
static void GenPresidentName(StringBuilder &builder, uint32 x)
{
char initial[] = "?. ";
const char * const *base;
uint num;
uint i;
initial[0] = _initial_name_letters[sizeof(_initial_name_letters) * GB(x, 0, 8) >> 8];
builder += initial;
i = (sizeof(_initial_name_letters) + 35) * GB(x, 8, 8) >> 8;
if (i < sizeof(_initial_name_letters)) {
initial[0] = _initial_name_letters[i];
builder += initial;
}
if (_settings_game.game_creation.landscape == LT_TOYLAND) {
base = _silly_surname_list;
num = lengthof(_silly_surname_list);
} else {
base = _surname_list;
num = lengthof(_surname_list);
}
builder += base[num * GB(x, 16, 8) >> 8];
}
static void GetSpecialNameString(StringBuilder &builder, int ind, StringParameters &args)
{
switch (ind) {
case 1: // not used
builder += _silly_company_names[std::min<uint>(args.GetInt32() & 0xFFFF, lengthof(_silly_company_names) - 1)];
return;
case 2: // used for Foobar & Co company names
GenAndCoName(builder, args.GetInt32());
return;
case 3: // President name
GenPresidentName(builder, args.GetInt32());
return;
}
/* town name? */
if (IsInsideMM(ind - 6, 0, SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START + 1)) {
GetSpecialTownNameString(builder, ind - 6, args.GetInt32());
builder += " Transport";
return;
}
NOT_REACHED();
}
/**
* Check whether the header is a valid header for OpenTTD.
* @return true iff the header is deemed valid.
*/
bool LanguagePackHeader::IsValid() const
{
return this->ident == TO_LE32(LanguagePackHeader::IDENT) &&
this->version == TO_LE32(LANGUAGE_PACK_VERSION) &&
this->plural_form < LANGUAGE_MAX_PLURAL &&
this->text_dir <= 1 &&
this->newgrflangid < MAX_LANG &&
this->num_genders < MAX_NUM_GENDERS &&
this->num_cases < MAX_NUM_CASES &&
StrValid(this->name, lastof(this->name)) &&
StrValid(this->own_name, lastof(this->own_name)) &&
StrValid(this->isocode, lastof(this->isocode)) &&
StrValid(this->digit_group_separator, lastof(this->digit_group_separator)) &&
StrValid(this->digit_group_separator_currency, lastof(this->digit_group_separator_currency)) &&
StrValid(this->digit_decimal_separator, lastof(this->digit_decimal_separator));
}
/**
* Check whether a translation is sufficiently finished to offer it to the public.
*/
bool LanguagePackHeader::IsReasonablyFinished() const
{
/* "Less than 25% missing" is "sufficiently finished". */
return 4 * this->missing < LANGUAGE_TOTAL_STRINGS;
}
/**
* Read a particular language.
* @param lang The metadata about the language.
* @return Whether the loading went okay or not.
*/
bool ReadLanguagePack(const LanguageMetadata *lang)
{
/* Current language pack */
size_t len = 0;
std::unique_ptr<LanguagePack, LanguagePackDeleter> lang_pack(reinterpret_cast<LanguagePack *>(ReadFileToMem(lang->file.string(), len, 1U << 20).release()));
if (!lang_pack) return false;
/* End of read data (+ terminating zero added in ReadFileToMem()) */
const char *end = (char *)lang_pack.get() + len + 1;
/* We need at least one byte of lang_pack->data */
if (end <= lang_pack->data || !lang_pack->IsValid()) {
return false;
}
#if TTD_ENDIAN == TTD_BIG_ENDIAN
for (uint i = 0; i < TEXT_TAB_END; i++) {
lang_pack->offsets[i] = ReadLE16Aligned(&lang_pack->offsets[i]);
}
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
std::array<uint, TEXT_TAB_END> tab_start, tab_num;
uint count = 0;
for (uint i = 0; i < TEXT_TAB_END; i++) {
uint16 num = lang_pack->offsets[i];
if (num > TAB_SIZE) return false;
tab_start[i] = count;
tab_num[i] = num;
count += num;
}
/* Allocate offsets */
std::vector<char *> offs(count);
/* Fill offsets */
char *s = lang_pack->data;
len = (byte)*s++;
for (uint i = 0; i < count; i++) {
if (s + len >= end) return false;
if (len >= 0xC0) {
len = ((len & 0x3F) << 8) + (byte)*s++;
if (s + len >= end) return false;
}
offs[i] = s;
s += len;
len = (byte)*s;
*s++ = '\0'; // zero terminate the string
}
_langpack.langpack = std::move(lang_pack);
_langpack.offsets = std::move(offs);
_langpack.langtab_num = tab_num;
_langpack.langtab_start = tab_start;
_current_language = lang;
_current_text_dir = (TextDirection)_current_language->text_dir;
_config_language_file = _current_language->file.filename().string();
SetCurrentGrfLangID(_current_language->newgrflangid);
#ifdef _WIN32
extern void Win32SetCurrentLocaleName(std::string iso_code);
Win32SetCurrentLocaleName(_current_language->isocode);
#endif
#ifdef WITH_COCOA
extern void MacOSSetCurrentLocaleName(const char *iso_code);
MacOSSetCurrentLocaleName(_current_language->isocode);
#endif
#ifdef WITH_ICU_I18N
/* Create a collator instance for our current locale. */
UErrorCode status = U_ZERO_ERROR;
_current_collator.reset(icu::Collator::createInstance(icu::Locale(_current_language->isocode), status));
/* Sort number substrings by their numerical value. */
if (_current_collator) _current_collator->setAttribute(UCOL_NUMERIC_COLLATION, UCOL_ON, status);
/* Avoid using the collator if it is not correctly set. */
if (U_FAILURE(status)) {
_current_collator.reset();
}
#endif /* WITH_ICU_I18N */
/* Some lists need to be sorted again after a language change. */
ReconsiderGameScriptLanguage();
InitializeSortedCargoSpecs();
SortIndustryTypes();
BuildIndustriesLegend();
BuildContentTypeStringList();
InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window.
InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window.
InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window.
InvalidateWindowClassesData(WC_SHIPS_LIST); // Ship group window.
InvalidateWindowClassesData(WC_AIRCRAFT_LIST); // Aircraft group window.
InvalidateWindowClassesData(WC_INDUSTRY_DIRECTORY); // Industry directory window.
InvalidateWindowClassesData(WC_STATION_LIST); // Station list window.
return true;
}
/* Win32 implementation in win32.cpp.
* OS X implementation in os/macosx/macos.mm. */
#if !(defined(_WIN32) || defined(__APPLE__))
/**
* Determine the current charset based on the environment
* First check some default values, after this one we passed ourselves
* and if none exist return the value for $LANG
* @param param environment variable to check conditionally if default ones are not
* set. Pass nullptr if you don't want additional checks.
* @return return string containing current charset, or nullptr if not-determinable
*/
const char *GetCurrentLocale(const char *param)
{
const char *env;
env = std::getenv("LANGUAGE");
if (env != nullptr) return env;
env = std::getenv("LC_ALL");
if (env != nullptr) return env;
if (param != nullptr) {
env = std::getenv(param);
if (env != nullptr) return env;
}
return std::getenv("LANG");
}
#else
const char *GetCurrentLocale(const char *param);
#endif /* !(defined(_WIN32) || defined(__APPLE__)) */
bool StringIDSorter(const StringID &a, const StringID &b)
{
std::string stra = GetString(a);
std::string strb = GetString(b);
return StrNaturalCompare(stra, strb) < 0;
}
/**
* Get the language with the given NewGRF language ID.
* @param newgrflangid NewGRF languages ID to check.
* @return The language's metadata, or nullptr if it is not known.
*/
const LanguageMetadata *GetLanguage(byte newgrflangid)
{
for (const LanguageMetadata &lang : _languages) {
if (newgrflangid == lang.newgrflangid) return ⟨
}
return nullptr;
}
/**
* Reads the language file header and checks compatibility.
* @param file the file to read
* @param hdr the place to write the header information to
* @return true if and only if the language file is of a compatible version
*/
static bool GetLanguageFileHeader(const char *file, LanguagePackHeader *hdr)
{
FILE *f = fopen(file, "rb");
if (f == nullptr) return false;
size_t read = fread(hdr, sizeof(*hdr), 1, f);
fclose(f);
bool ret = read == 1 && hdr->IsValid();
/* Convert endianness for the windows language ID */
if (ret) {
hdr->missing = FROM_LE16(hdr->missing);
hdr->winlangid = FROM_LE16(hdr->winlangid);
}
return ret;
}
/**
* Search for the languages in the given directory and add them to the #_languages list.
* @param path the base directory to search in
*/
static void FillLanguageList(const std::string &path)
{
DIR *dir = ttd_opendir(path.c_str());
if (dir != nullptr) {
struct dirent *dirent;
while ((dirent = readdir(dir)) != nullptr) {
std::string d_name = FS2OTTD(dirent->d_name);
const char *extension = strrchr(d_name.c_str(), '.');
/* Not a language file */
if (extension == nullptr || strcmp(extension, ".lng") != 0) continue;
LanguageMetadata lmd;
lmd.file = path + d_name;
/* Check whether the file is of the correct version */
if (!GetLanguageFileHeader(lmd.file.string().c_str(), &lmd)) {
Debug(misc, 3, "{} is not a valid language file", lmd.file);
} else if (GetLanguage(lmd.newgrflangid) != nullptr) {
Debug(misc, 3, "{}'s language ID is already known", lmd.file);
} else {
_languages.push_back(lmd);
}
}
closedir(dir);
}
}
/**
* Make a list of the available language packs. Put the data in
* #_languages list.
*/
void InitializeLanguagePacks()
{
for (Searchpath sp : _valid_searchpaths) {
FillLanguageList(FioGetDirectory(sp, LANG_DIR));
}
if (_languages.size() == 0) UserError("No available language packs (invalid versions?)");
/* Acquire the locale of the current system */
const char *lang = GetCurrentLocale("LC_MESSAGES");
if (lang == nullptr) lang = "en_GB";
const LanguageMetadata *chosen_language = nullptr; ///< Matching the language in the configuration file or the current locale
const LanguageMetadata *language_fallback = nullptr; ///< Using pt_PT for pt_BR locale when pt_BR is not available
const LanguageMetadata *en_GB_fallback = _languages.data(); ///< Fallback when no locale-matching language has been found
/* Find a proper language. */
for (const LanguageMetadata &lng : _languages) {
/* We are trying to find a default language. The priority is by
* configuration file, local environment and last, if nothing found,
* English. */
if (_config_language_file == lng.file.filename()) {
chosen_language = &lng;
break;
}
if (strcmp (lng.isocode, "en_GB") == 0) en_GB_fallback = &lng;
/* Only auto-pick finished translations */
if (!lng.IsReasonablyFinished()) continue;
if (strncmp(lng.isocode, lang, 5) == 0) chosen_language = &lng;
if (strncmp(lng.isocode, lang, 2) == 0) language_fallback = &lng;
}
/* We haven't found the language in the config nor the one in the locale.
* Now we set it to one of the fallback languages */
if (chosen_language == nullptr) {
chosen_language = (language_fallback != nullptr) ? language_fallback : en_GB_fallback;
}
if (!ReadLanguagePack(chosen_language)) UserError("Can't read language pack '{}'", chosen_language->file);
}
/**
* Get the ISO language code of the currently loaded language.
* @return the ISO code.
*/
const char *GetCurrentLanguageIsoCode()
{
return _langpack.langpack->isocode;
}
/**
* Check whether there are glyphs missing in the current language.
* @return If glyphs are missing, return \c true, else return \c false.
*/
bool MissingGlyphSearcher::FindMissingGlyphs()
{
InitFontCache(this->Monospace());
const Sprite *question_mark[FS_END];
for (FontSize size = this->Monospace() ? FS_MONO : FS_BEGIN; size < (this->Monospace() ? FS_END : FS_MONO); size++) {
question_mark[size] = GetGlyph(size, '?');
}
this->Reset();
for (auto text = this->NextString(); text.has_value(); text = this->NextString()) {
auto src = text->cbegin();
FontSize size = this->DefaultSize();
while (src != text->cend()) {
WChar c = Utf8Consume(src);
if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
size = (FontSize)(c - SCC_FIRST_FONT);
} else if (!IsInsideMM(c, SCC_SPRITE_START, SCC_SPRITE_END) && IsPrintable(c) && !IsTextDirectionChar(c) && c != '?' && GetGlyph(size, c) == question_mark[size]) {
/* The character is printable, but not in the normal font. This is the case we were testing for. */
std::string size_name;
switch (size) {
case 0: size_name = "medium"; break;
case 1: size_name = "small"; break;
case 2: size_name = "large"; break;
case 3: size_name = "mono"; break;
default: NOT_REACHED();
}
Debug(fontcache, 0, "Font is missing glyphs to display char 0x{:X} in {} font size", (int)c, size_name);
return true;
}
}
}
return false;
}
/** Helper for searching through the language pack. */
class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
uint i; ///< Iterator for the primary language tables.
uint j; ///< Iterator for the secondary language tables.
void Reset() override
{
this->i = 0;
this->j = 0;
}
FontSize DefaultSize() override
{
return FS_NORMAL;
}
std::optional<std::string_view> NextString() override
{
if (this->i >= TEXT_TAB_END) return std::nullopt;
const char *ret = _langpack.offsets[_langpack.langtab_start[this->i] + this->j];
this->j++;
while (this->i < TEXT_TAB_END && this->j >= _langpack.langtab_num[this->i]) {
this->i++;
this->j = 0;
}
return ret;
}
bool Monospace() override
{
return false;
}
void SetFontNames(FontCacheSettings *settings, const char *font_name, const void *os_data) override
{
#if defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA)
settings->small.font = font_name;
settings->medium.font = font_name;
settings->large.font = font_name;
settings->small.os_handle = os_data;
settings->medium.os_handle = os_data;
settings->large.os_handle = os_data;
#endif
}
};
/**
* Check whether the currently loaded language pack
* uses characters that the currently loaded font
* does not support. If this is the case an error
* message will be shown in English. The error
* message will not be localized because that would
* mean it might use characters that are not in the
* font, which is the whole reason this check has
* been added.
* @param base_font Whether to look at the base font as well.
* @param searcher The methods to use to search for strings to check.
* If nullptr the loaded language pack searcher is used.
*/
void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
{
static LanguagePackGlyphSearcher pack_searcher;
if (searcher == nullptr) searcher = &pack_searcher;
bool bad_font = !base_font || searcher->FindMissingGlyphs();
#if defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA)
if (bad_font) {
/* We found an unprintable character... lets try whether we can find
* a fallback font that can print the characters in the current language. */
bool any_font_configured = !_fcsettings.medium.font.empty();
FontCacheSettings backup = _fcsettings;
_fcsettings.mono.os_handle = nullptr;
_fcsettings.medium.os_handle = nullptr;
bad_font = !SetFallbackFont(&_fcsettings, _langpack.langpack->isocode, _langpack.langpack->winlangid, searcher);
_fcsettings = backup;
if (!bad_font && any_font_configured) {
/* If the user configured a bad font, and we found a better one,
* show that we loaded the better font instead of the configured one.
* The colour 'character' might change in the
* future, so for safety we just Utf8 Encode it into the string,
* which takes exactly three characters, so it replaces the "XXX"
* with the colour marker. */
static std::string err_str("XXXThe current font is missing some of the characters used in the texts for this language. Using system fallback font instead.");
Utf8Encode(err_str.data(), SCC_YELLOW);
SetDParamStr(0, err_str);
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_WARNING);
}
if (bad_font && base_font) {
/* Our fallback font does miss characters too, so keep the
* user chosen font as that is more likely to be any good than
* the wild guess we made */
InitFontCache(searcher->Monospace());
}
}
#endif
if (bad_font) {
/* All attempts have failed. Display an error. As we do not want the string to be translated by
* the translators, we 'force' it into the binary and 'load' it via a BindCString. To do this
* properly we have to set the colour of the string, otherwise we end up with a lot of artifacts.
* The colour 'character' might change in the future, so for safety we just Utf8 Encode it into
* the string, which takes exactly three characters, so it replaces the "XXX" with the colour marker. */
static std::string err_str("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this.");
Utf8Encode(err_str.data(), SCC_YELLOW);
SetDParamStr(0, err_str);
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_WARNING);
/* Reset the font width */
LoadStringWidthTable(searcher->Monospace());
return;
}
/* Update the font with cache */
LoadStringWidthTable(searcher->Monospace());
#if !(defined(WITH_ICU_I18N) && defined(WITH_HARFBUZZ)) && !defined(WITH_UNISCRIBE) && !defined(WITH_COCOA)
/*
* For right-to-left languages we need the ICU library. If
* we do not have support for that library we warn the user
* about it with a message. As we do not want the string to
* be translated by the translators, we 'force' it into the
* binary and 'load' it via a BindCString. To do this
* properly we have to set the colour of the string,
* otherwise we end up with a lot of artifacts. The colour
* 'character' might change in the future, so for safety
* we just Utf8 Encode it into the string, which takes
* exactly three characters, so it replaces the "XXX" with
* the colour marker.
*/
if (_current_text_dir != TD_LTR) {
static std::string err_str("XXXThis version of OpenTTD does not support right-to-left languages. Recompile with ICU + Harfbuzz enabled.");
Utf8Encode(err_str.data(), SCC_YELLOW);
SetDParamStr(0, err_str);
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
}
#endif /* !(WITH_ICU_I18N && WITH_HARFBUZZ) && !WITH_UNISCRIBE && !WITH_COCOA */
}
|