-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
th.rb
204 lines (182 loc) · 6.95 KB
/
th.rb
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
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
# Thai translation for Ruby on Rails
# original by Prem Sichanugrist (s@sikachu.com/sikandsak@gmail.com)
# activerecord keys fixed by Jittat Fakcharoenphol (jittat@gmail.com)
#
# Note: You must install i18n gem in order to use this language pack.
# If you're calling I18n.localize(Time.now), the year will be in Bhuddhist calendar
# This is used to DRY up ActiveRecord validation messages
unless defined?(ThaiLocaleI18n::ERROR_MESSAGES)
module ThaiLocaleI18n
ERROR_MESSAGES = {
inclusion: "ไม่ได้อยู่ในรายการ",
exclusion: "ไม่ได้รับอนุญาตให้ใช้",
invalid: "ไม่ถูกต้อง",
confirmation: "ไม่ตรงกับการยืนยัน",
accepted: "ต้องถูกยอมรับ",
empty: "ต้องไม่เว้นว่างเอาไว้",
blank: "ต้องไม่เว้นว่างเอาไว้",
too_long: "ยาวเกินไป (ต้องไม่เกิน %{count} ตัวอักษร)",
too_short: "สั้นเกินไป (ต้องยาวกว่า %{count} ตัวอักษร)",
wrong_length: "มีความยาวไม่ถูกต้อง (ต้องมีความยาว %{count} ตัวอักษร)",
not_a_number: "ไม่ใช่ตัวเลข",
not_an_integer: "ไม่ใช่จำนวนเต็ม",
greater_than: "ต้องมากกว่า %{count}",
greater_than_or_equal_to: "ต้องมากกว่าหรือเท่ากับ %{count}",
equal_to: "ต้องมีค่าเท่ากับ %{count}",
less_than: "ต้องมีค่าน้อยกว่า %{count}",
less_than_or_equal_to: "ต้องมีค่าน้อยกว่าหรือเท่ากับ %{count}",
odd: "ต้องเป็นจำนวนคี่",
even: "ต้องเป็นจำนวนคู่"
}
end
end
{ th: {
date: {
formats: {
default: ->(date, _opts) { "%d-%m-#{date.year + 543}" },
short: "%d %b",
long: ->(date, _opts) { "%d %B #{date.year + 543}" }
},
day_names: %w(อาทิตย์ จันทร์ อังคาร พุธ พฤหัสบดี ศุกร์ เสาร์),
abbr_day_names: %w(อา จ อ พ พฤ ศ ส),
month_names: [nil, "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
abbr_month_names: [nil, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
order: [:day, :month, :year]
},
time: {
formats: {
default: ->(date, _opts) { "%a %d %b #{date.year + 543} %H:%M:%S %z" },
short: "%d %b %H:%M น.",
long: ->(date, _opts) { "%d %B #{date.year + 543} %H:%M น." }
},
am: "ก่อนเที่ยง",
pm: "หลังเที่ยง"
},
support: {
array: {
words_connector: ", ",
two_words_connector: " และ ",
last_word_connector: ", และ "
},
select: {
prompt: "โปรดเลือก"
}
},
number: {
format: {
separator: ".",
delimiter: ",",
precision: 3,
significant: false,
strip_insignificant_zeros: false
},
currency: {
format: {
format: "%n %u",
unit: "บาท",
separator: ".",
delimiter: ",",
precision: 2,
significant: false,
strip_insignificant_zeros: false
}
},
percentage: {
format: {
delimiter: ""
}
},
precision: {
format: {
delimiter: ""
}
},
human: {
format: {
delimiter: "",
precision: 3,
significant: true,
strip_insignificant_zeros: true
},
storage_units: {
format: "%n %u",
units: {
byte: "ไบต์",
kb: "กิโลไบต์",
mb: "เมกะไบต์",
gb: "จิกะไบต์",
tb: "เทระไบต์"
}
},
decimal_units: {
format: "%n %u",
units: {
unit: "",
thousand: "พัน",
million: "ล้าน",
billion: "พันล้าน",
trillion: "ล้านล้าน",
quadrillion: "พันล้านล้าน"
}
}
}
},
datetime: {
distance_in_words: {
half_a_minute: "ครึ่งนาที",
less_than_x_seconds: "น้อยกว่า %{count} วินาที",
x_seconds: "%{count} วินาที",
less_than_x_minutes: "น้อยกว่า %{count} นาที",
x_minutes: "%{count} นาที",
about_x_hours: "ประมาณ %{count} ชั่วโมง",
x_days: "%{count} วัน",
about_x_months: "ประมาณ %{count} เดือน",
x_months: "%{count} เดือน",
about_x_years: "ประมาณ %{count} ปี",
over_x_years: "มากกว่า %{count} ปี",
almost_x_years: "เกือบ %{count} ปี"
},
prompts: {
year: "ปี",
month: "เดือน",
day: "วัน",
hour: "ชั่วโมง",
minute: "นาที",
second: "วินาที"
}
},
helpers: {
select: {
prompt: "โปรดเลือก"
},
submit: {
create: "สร้าง%{model}",
update: "ปรับปรุง%{model}",
submit: "บันทึก%{model}"
}
},
errors: {
format: "%{attribute} %{message}",
messages: ThaiLocaleI18n::ERROR_MESSAGES
},
activerecord: {
errors: {
template: {
header: "พบข้อผิดพลาด %{count} ประการ ทำให้ไม่สามารถบันทึก%{model}ได้",
body: "โปรดตรวจสอบข้อมูลในช่องต่อไปนี้:"
},
messages: {
taken: "ถูกใช้ไปแล้ว",
record_invalid: "ไม่ผ่านการตรวจสอบ: %{errors}"
}.merge(ThaiLocaleI18n::ERROR_MESSAGES),
full_messages: {
format: "%{attribute} %{message}"
}
}
}
} }