tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

icu-test-selectors.json (4729B)


      1 [
      2  {
      3    "comment": "Testing simple plural",
      4    "shared": {
      5      "srcs": [
      6        ".match {$count :number}\n",
      7        "one {{{$count} file}}\n",
      8        " *  {{{$count} files}}"
      9      ]
     10    },
     11    "variations" : [
     12      { "params": { "count": 0 }, "exp": "0 files" },
     13      { "params": { "count": 1 }, "exp": "1 file" },
     14      { "params": { "count": 3 }, "exp": "3 files" },
     15      { "params": { "count": 0 }, "locale": "fr", "exp": "0 file" },
     16      { "params": { "count": 1 }, "locale": "fr", "exp": "1 file" },
     17      { "params": { "count": 3 }, "locale": "fr", "exp": "3 files" }
     18    ]
     19  },
     20  {
     21    "comment": "Testing simple plural, but swap variant order",
     22    "shared": {
     23      "srcs": [
     24        ".match {$count :number}\n",
     25        " *  {{You deleted {$count} files}}\n",
     26        "one {{You deleted {$count} file}}"
     27      ]
     28    },
     29    "variations" : [
     30      {
     31        "params": { "count": 1 },
     32        "exp": "You deleted 1 file"
     33      },
     34      {
     35        "params": { "count": 3 },
     36        "exp": "You deleted 3 files"
     37      }
     38    ]
     39  },
     40  {
     41    "comment": "Ordinal, with mixed order and exact matches",
     42    "shared": {
     43      "srcs": [
     44        ".match {$place :number select=ordinal}\n",
     45        "*   {{You finished in the {$place}th place}}\n",
     46        "two {{You finished in the {$place}nd place}}\n",
     47        "one {{You finished in the {$place}st place}}\n",
     48        "1   {{You got the gold medal}}\n",
     49        "2   {{You got the silver medal}}\n",
     50        "3   {{You got the bronze medal}}\n",
     51        "few {{You finished in the {$place}rd place}}"
     52      ]
     53    },
     54    "variations" : [
     55      { "params": { "place": 1 }, "exp": "You got the gold medal" },
     56      { "params": { "place": 2 }, "exp": "You got the silver medal" },
     57      { "params": { "place": 3 }, "exp": "You got the bronze medal" },
     58      { "params": { "place": 7 }, "exp": "You finished in the 7th place" },
     59      { "params": { "place": 21 }, "exp": "You finished in the 21st place" },
     60      { "params": { "place": 22 }, "exp": "You finished in the 22nd place" },
     61      { "params": { "place": 23 }, "exp": "You finished in the 23rd place" },
     62      { "params": { "place": 28 }, "exp": "You finished in the 28th place" }
     63    ]
     64  },
     65  {
     66    "comment": "Plural combinations, mixed order",
     67    "shared": {
     68      "srcs": [
     69        ".match {$fileCount :number} {$folderCount :number}\n",
     70        "  *   *   {{You found {$fileCount} files in {$folderCount} folders}}\n",
     71        "  one one {{You found {$fileCount} file in {$folderCount} folder}}\n",
     72        "  one *   {{You found {$fileCount} file in {$folderCount} folders}}\n",
     73        "  *   one {{You found {$fileCount} files in {$folderCount} folder}}"
     74      ]
     75    },
     76    "variations" : [
     77      { "params": { "fileCount": 1, "folderCount": 1 }, "exp": "You found 1 file in 1 folder" },
     78      { "params": { "fileCount": 1, "folderCount": 5 }, "exp": "You found 1 file in 5 folders" },
     79      { "params": { "fileCount": 7, "folderCount": 1 }, "exp": "You found 7 files in 1 folder" },
     80      { "params": { "fileCount": 7, "folderCount": 3 }, "exp": "You found 7 files in 3 folders" }
     81    ]
     82  },
     83  {
     84    "comment": "Test that the selection honors the formatting option (`1.00 dollars`)",
     85    "shared": {
     86      "srcs": [
     87        ".local $c = {$price :number minimumFractionDigits=$minF}\n",
     88        ".match {$c}\n",
     89        "  one {{{$c} dollar}}\n",
     90        "   *  {{{$c} dollars}}"
     91      ]
     92    },
     93    "variations" : [
     94      { "params": { "price": 1, "minF": 0 }, "exp": "1 dollar" },
     95      { "params": { "price": 1, "minF": 2 }, "exp": "1.00 dollars" }
     96    ]
     97  },
     98  {
     99    "comment": "Test that the selection honors the formatting option (`1.00 dollars`)",
    100    "shared": {
    101      "srcs": [
    102        ".local $c = {$price :number maximumFractionDigits=$maxF}\n",
    103        ".match {$c}\n",
    104        "  one {{{$c} dollar}}\n",
    105        "   *  {{{$c} dollars}}"
    106      ]
    107    },
    108    "variations" : [
    109      { "params": { "price": 1.25, "maxF": 0 }, "exp": "1 dollar" },
    110      { "params": { "price": 1.25, "maxF": 2 }, "exp": "1.25 dollars" }
    111    ]
    112  },
    113  {
    114    "comment": "Test that the selection honors the `:integer` over options",
    115    "shared": {
    116      "srcs": [
    117        ".local $c = {$price :integer maximumFractionDigits=$maxF}\n",
    118        ".match {$c}\n",
    119        "  one {{{$c} dollar}}\n",
    120        "   *  {{{$c} dollars}}"
    121      ]
    122    },
    123    "variations" : [
    124      { "params": { "price": 1, "maxF": 0 }, "exp": "1 dollar" },
    125      { "params": { "price": 1, "maxF": 2 }, "exp": "1 dollar" },
    126      { "params": { "price": 1.25, "maxF": 0 }, "exp": "1 dollar" },
    127      { "params": { "price": 1.25, "maxF": 2 }, "exp": "1 dollar" },
    128      { "params": { "price": 4.12345, "maxF": 4 }, "exp": "4 dollars" }
    129    ]
    130  }
    131 ]