blob: a8fb52c66e56c394aaaa8d62d4cce43626a61b89 (
plain)
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
|
(local product-type
[{:value "white" :label "Белый чай"}
{:value "dark-oolong" :label "Темный улун"}
{:value "light-oolong" :label "Светлый улун"}
{:value "red" :label "Красный чай"}
{:value "green" :label "Зеленый чай"}
{:value "shu-puerh" :label "Шу пуэр"}
{:value "sheng-puerh" :label "Шэн пуэр"}
{:value "yellow" :label "Желтый чай"}
{:value "liu-bao" :label "Лю бао"}
{:value "teapot" :label "Чайник"}
{:value "gaiwan" :label "Гайвань"}
{:value "pourer" :label "Чахай"}])])
(local tea-season
[{:value "spring" :label "Весна"}
{:value "summer" :label "Лето"}
{:value "autumn" :label "Осень"}
{:value "winter" :label "Зима"}])
(local tea-packaging
[{:value "loose" :label "Россыпь"}
{:value "piece" :label "Штучный товар"}
{:value "pieces" :label "Разлом"}])
(local order-state
[{:value "cart" :label "Корзина"}
{:value "placed" :label "Размещен"}
{:value "done" :label "Выполнен"}
{:value "canceled" :label "Отменен"}])
(fn label [dict value]
(var result nil)
(each [_ item (ipairs dict) &until result]
(when (= item.value value)
(set result item.label)))
result)
{: product-type : tea-packaging : tea-season : order-state : label}
|