Khác biệt giữa các bản “Mô đun:Convert/text”
(Tạo trang mới với nội dung “-- Text used by Module:Convert for enwiki. -- This is a separate module to simplify translation for use on another wiki. -- Some units accept an SI prefi…”) |
|||
| Dòng 1: | Dòng 1: | ||
| − | -- | + | local translation_table = { |
| − | -- | + | numdot = ',', -- decimal mark |
| + | numsep = '.', -- separator for number grouping | ||
| + | per_word = 'một', -- for units like "miles per gallon" | ||
| + | plural_suffix = '', -- disable plural unit names | ||
| + | specials = { -- for special processing by makeunits | ||
| + | utype = { | ||
| + | -- ["unit type in local language"] = "name_used_in_this_script" | ||
| + | ["fuel efficiency"] = "type_fuel_efficiency", | ||
| + | ["length"] = "type_length", | ||
| + | ["temperature"] = "type_temperature", | ||
| + | ["volume"] = "type_volume", | ||
| + | }, | ||
| + | ucode = { | ||
| + | exception = { | ||
| + | -- ["unit code in local language"] = "name_used_in_module_convert" | ||
| + | ["ft"] = "integer_more_precision", | ||
| + | ["in"] = "subunit_more_precision", | ||
| + | ["lb"] = "integer_more_precision", | ||
| + | }, | ||
| + | istemperature = { | ||
| + | -- Common temperature scales (not keVT or MK). | ||
| + | -- ["unit code in local language"] = 1 | ||
| + | ["C"] = true, | ||
| + | ["F"] = true, | ||
| + | ["K"] = true, | ||
| + | ["R"] = true, | ||
| + | }, | ||
| + | usesymbol = { | ||
| + | -- Use unit symbol not name if abbr not specified. | ||
| + | -- ["unit code in local language"] = 1 | ||
| + | ["C"] = 1, | ||
| + | ["F"] = 1, | ||
| + | ["K"] = 1, | ||
| + | ["R"] = 1, | ||
| + | ["C-change"] = 1, | ||
| + | ["F-change"] = 1, | ||
| + | ["K-change"] = 1, | ||
| + | }, | ||
| + | alttype = { | ||
| + | -- Unit has an alternate type that is a valid conversion. | ||
| + | -- ["unit code in local language"] = "alternate type in local language" | ||
| + | ["Nm"] = "energy", | ||
| + | ["ftlb"] = "torque", | ||
| + | ["ftlb-f"] = "torque", | ||
| + | ["ftlbf"] = "torque", | ||
| + | ["inlb"] = "torque", | ||
| + | ["inlb-f"] = "torque", | ||
| + | ["inlbf"] = "torque", | ||
| + | ["inoz-f"] = "torque", | ||
| + | ["inozf"] = "torque", | ||
| + | }, | ||
| + | }, | ||
| + | }, | ||
| + | mtext = { | ||
| + | titles = { | ||
| + | -- name_used_in_this_script = 'Title of page' | ||
| + | conversion_data = 'Mô đun:Convert/documentation/conversion data/tài liệu', | ||
| + | }, | ||
| + | messages = { | ||
| + | -- name_used_in_this_script = 'Error message ($1 = first parameter, $2 = second)' | ||
| + | m_als_bad = 'Biệt danh có văn bản không hợp lệ trong ô “$1”.', | ||
| + | m_als_dup = 'Khác biệt “$1” đã được định rõ.', | ||
| + | m_als_link = 'Biệt danh “$1” phải có liên kết wiki (“[[…]]”) trong văn bản liên kết tượng trưng.', | ||
| + | m_als_mul = 'Biệt danh “$1” có số nhân “$2” không phải là số.', | ||
| + | m_als_same = 'Nên bỏ qua “$1” cho biệt danh “$2” vì nó trùng khớp với đích.', | ||
| + | m_als_type = 'Đích của biệt danh “$1” có kiểu sai.', | ||
| + | m_als_undef = 'Đơn vị chính phải được định rõ trước biệt danh “=$1”.', | ||
| + | m_cmb_miss = 'Thiếu mã đơn vị của một tổ hợp.', | ||
| + | m_cmb_none = 'Đơn vị không được định rõ cho tổ hợp “$2”.', | ||
| + | m_cmb_one = 'Chỉ có một đơn vị được định rõ cho tổ hợp “$2”.', | ||
| + | m_cmb_type = 'Đơn vị “$1” trong tổ hợp “$2” có kiểu sai.', | ||
| + | m_cmb_undef = 'Đơn vị “$1” trong tổ hợp “$2” không được định rõ.', | ||
| + | m_cmp_def = 'Hỗn hợp “$1” phải định rõ một mã đơn vị mặc định.', | ||
| + | m_cmp_int = 'Hỗn hợp “$1” có những thành phần có toán hạng tỷ lệ không phải số nguyên.', | ||
| + | m_cmp_inval = 'Hỗn hợp “$1” có một thành phần có tỷ lệ không hợp lệ “$2”.', | ||
| + | m_cmp_many = 'Hỗn hợp “$1” có nhiều ô quá.', | ||
| + | m_cmp_miss = 'Thiếu mã đơn vị cho một hỗn hợp.', | ||
| + | m_cmp_order = 'Hỗn hợp “$1” có những thành phần có thứ tự sai hoặc tỷ lệ không hợp lệ.', | ||
| + | m_cmp_scale = 'Đơn vị thay thế “$1” trong hỗn hợp “$2” có tỷ lệ sai.', | ||
| + | m_cmp_two = 'Hỗn hợp “$1” phải định rõ đúng hai mã đơn vị.', | ||
| + | m_cmp_type = 'Đơn vị “$1” trong hỗn hợp “$2” có kiểu sai.', | ||
| + | m_cmp_undef = 'Đơn vị “$1” trong hỗn hợp “$2” không được định rõ.', | ||
| + | m_def_cond = 'Điều kiện không hợp lệ trong mặc định “$1” của đơn vị “$2”.', | ||
| + | m_def_fmt = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” phải có 2 hoặc 3 “!”.', | ||
| + | m_def_rpt = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” bị lặp lại.', | ||
| + | m_def_same = 'Giá trị cho ra mặc định của đơn vị “$1” có cùng đơn vị.', | ||
| + | m_def_type = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” có kiểu sai.', | ||
| + | m_def_undef = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” không được định rõ.', | ||
| + | m_dfs_code = 'Phần mặc định: không định rõ mã đơn vị.', | ||
| + | m_dfs_dup = 'Phần mặc định: đơn vị “$1” đã được định rõ.', | ||
| + | m_dfs_none = 'Phần mặc định: đơn vị “$1” không định rõ mặc định.', | ||
| + | m_dfs_sym = 'Phần mặc định: đơn vị “$1” phải có ký hiệu.', | ||
| + | m_dfs_two = 'Phần mặc định: đơn vị “$1” phải chỉ có hai ô.', | ||
| + | m_dfs_undef = 'Phần mặc định: đơn vị “$1” không được định rõ.', | ||
| + | m_dup_code = 'Mã đơn vị “$1” đã được định rõ.', | ||
| + | m_error = 'Lỗi:', | ||
| + | m_ftl_read = 'Không thể đọc văn bản wiki từ “[[$1]]”.', | ||
| + | m_ftl_table = '[[$1]] phải xuất bảng “$2”.', | ||
| + | m_ftl_type = 'Lỗi sự cố: Kiểu dữ liệu không rõ của “$1”', | ||
| + | m_hdg_lev2 = 'Không tìm thấy đề mục cấp 2 “$1”.', | ||
| + | m_hdg_lev3 = 'Không có đề mục cấp 3 trước: $1', | ||
| + | m_line_num = ' (dòng $1).', | ||
| + | m_lnk_brack = 'Liên kết “$1” có số dấu ngoặc vuông sai.', | ||
| + | m_lnk_dup = 'Ngoại lệ liên kết “$1” đã được định rõ.', | ||
| + | m_lnk_miss = 'Thiếu mã đơn vị cho một liên kết.', | ||
| + | m_lnk_none = 'Không định rõ liên kết cho đơn vị “$1”.', | ||
| + | m_lnk_sym = 'Mã đơn vị “$1” cho một liên kết phải có ký hiệu.', | ||
| + | m_lnk_two = 'Hàng của liên kết đơn vị “$1” phải chỉ có hai ô.', | ||
| + | m_lnk_type = 'Ngoại lệ liên kết “$1” có kiểu sai.', | ||
| + | m_lnk_undef = 'Mã đơn vị “$1” cho một liên kết không được định rõ.', | ||
| + | m_miss_code = 'Thiếu mã đơn vị.', | ||
| + | m_miss_sym = 'Thiếu ký hiệu.', | ||
| + | m_miss_type = 'Thiếu kiểu đơn vị.', | ||
| + | m_mul_int = 'Bội số “$1” có những thành phần có toán hạng tỷ lệ không phải số nguyên.', | ||
| + | m_mul_miss = 'Thiếu mã đơn vị cho một bội số.', | ||
| + | m_mul_none = 'Không định rõ đơn vị nào cho bội số “$1”.', | ||
| + | m_mul_one = 'Chỉ có định rõ một đơn vị cho bội số “$1”.', | ||
| + | m_mul_order = 'Bội số “$1” có những thành phần có thứ tự sai hoặc tỷ lệ không hợp lệ.', | ||
| + | m_mul_scale = 'Bội số “$1” có một thành phần có tỷ lệ không hợp lệ “$2”.', | ||
| + | m_mul_std = 'Đơn vị “$1” trong bội số “$2” phải là một đơn vị chuẩn.', | ||
| + | m_mul_type = 'Đơn vị “$1” trong bội số “$2” có kiểu sai.', | ||
| + | m_mul_undef = 'Đơn vị “$1” trong bội số “$2” không được định rõ.', | ||
| + | m_no_title = 'Cần nhan đề trang có các định nghĩa đơn vị.', | ||
| + | m_ovr_dup = 'Đơn vị ghi đè “$1” đã được định rõ.', | ||
| + | m_ovr_miss = 'Thiếu mã đơn vị để ghi đè.', | ||
| + | m_per_dup = 'Đơn vị chia “$1” đã được định rõ.', | ||
| + | m_per_empty = 'Đơn vị “$1” có một ô trống trong “per”.', | ||
| + | m_per_fuel = 'Đơn vị “$1” có các kiểu đơn vị không hợp lệ cho hiệu suất nhiên liệu.', | ||
| + | m_per_two = 'Đơn vị “$1” không có đúng hai ô trong “per”.', | ||
| + | m_per_undef = 'Đơn vị “$1” có mã đơn vị không rõ “$2” trong “per”.', | ||
| + | m_percent_s = 'Ô “$1” phải không chứa “%s”.', | ||
| + | m_pfx_bad = 'Tiền tố không rõ: “$1”.', | ||
| + | m_pfx_name = 'Đơn vị định rõ Prefix phải bao gồm Name.', | ||
| + | m_scl_bad = 'Biểu thức tỷ lệ không hợp lệ: "$1".', | ||
| + | m_scl_miss = 'Thiếu tỷ lệ.', | ||
| + | m_scl_oflow = 'Biểu thức tỷ lệ cho ra giá trị không hợp lệ: “$1”.', | ||
| + | m_var_cnt = 'Phần tên biến số: mỗi hàng phải có năm trường.', | ||
| + | m_var_dup = 'Đơn vị “$1” đã có một tên biến số.', | ||
| + | m_var_miss = 'Thiếu trường cho tên biến số.', | ||
| + | m_var_undef = 'Không định rõ đơn vị “$1” trong tên biến số.', | ||
| + | m_warning = 'Cảnh báo:', | ||
| + | m_wrn_more = ' (và thêm đơn vị không được liệt kê)', | ||
| + | m_wrn_nbsp = 'Dòng $1 có khoảng cách không ngắt dòng', | ||
| + | m_wrn_nodef = 'Các đơn vị với mã đơn vị sau không có giá trị cho ra mặc định.', | ||
| + | m_wrn_ucode = ' $1', | ||
| + | }, | ||
| + | } | ||
| + | } | ||
-- Some units accept an SI prefix before the unit code, such as "kg" for kilogram. | -- Some units accept an SI prefix before the unit code, such as "kg" for kilogram. | ||
local SIprefixes = { | local SIprefixes = { | ||
-- The prefix field is what the prefix should be, if different from the prefix used. | -- The prefix field is what the prefix should be, if different from the prefix used. | ||
| − | ['Y'] = { exponent = 24, name = ' | + | ['Y'] = { exponent = 24, name = 'yôta', }, |
| − | ['Z'] = { exponent = 21, name = ' | + | ['Z'] = { exponent = 21, name = 'zêta', }, |
['E'] = { exponent = 18, name = 'exa' , }, | ['E'] = { exponent = 18, name = 'exa' , }, | ||
| − | ['P'] = { exponent = 15, name = ' | + | ['P'] = { exponent = 15, name = 'pêta' , }, |
| − | ['T'] = { exponent = 12, name = ' | + | ['T'] = { exponent = 12, name = 'têra' , }, |
['G'] = { exponent = 9, name = 'giga' , }, | ['G'] = { exponent = 9, name = 'giga' , }, | ||
| − | ['M'] = { exponent = 6, name = ' | + | ['M'] = { exponent = 6, name = 'mêga' , }, |
| − | ['k'] = { exponent = 3, name = ' | + | ['k'] = { exponent = 3, name = 'kilô' , }, |
| − | ['h'] = { exponent = 2, name = ' | + | ['h'] = { exponent = 2, name = 'hêctô', }, |
| − | ['da']= { exponent = 1, name = ' | + | ['da']= { exponent = 1, name = 'đềca' , }, |
| − | ['d'] = { exponent = -1, name = ' | + | ['d'] = { exponent = -1, name = 'đêxi' , }, |
| − | ['c'] = { exponent = -2, name = ' | + | ['c'] = { exponent = -2, name = 'xenti', }, |
| − | ['m'] = { exponent = -3, name = ' | + | ['m'] = { exponent = -3, name = 'mili', }, |
| − | ['μ'] = { exponent = -6, name = ' | + | ['μ'] = { exponent = -6, name = 'micrô', prefix = 'µ' }, -- key = 'GREEK SMALL LETTER MU' (U+03BC) utf-8 CE BC |
| − | ['µ'] = { exponent = -6, name = ' | + | ['µ'] = { exponent = -6, name = 'micrô', }, -- key = 'MICRO SIGN' (U+00B5) utf-8 C2 B5 |
| − | ['u'] = { exponent = -6, name = ' | + | ['u'] = { exponent = -6, name = 'micrô', prefix = 'µ' }, -- not an SI prefix, but allow for people typing this |
| − | ['n'] = { exponent = -9, name = ' | + | ['n'] = { exponent = -9, name = 'nanô' , }, |
| − | ['p'] = { exponent =-12, name = ' | + | ['p'] = { exponent =-12, name = 'picô' , }, |
| − | ['f'] = { exponent =-15, name = ' | + | ['f'] = { exponent =-15, name = 'femtô', }, |
| − | ['a'] = { exponent =-18, name = ' | + | ['a'] = { exponent =-18, name = 'atô' , }, |
| − | ['z'] = { exponent =-21, name = ' | + | ['z'] = { exponent =-21, name = 'zéptô', }, |
| − | ['y'] = { exponent =-24, name = ' | + | ['y'] = { exponent =-24, name = 'yóctô', }, |
} | } | ||
-- Some units can be qualified with one of the following prefixes, when linked. | -- Some units can be qualified with one of the following prefixes, when linked. | ||
local customary_units = { | local customary_units = { | ||
| − | { " | + | { "Mỹ", link = "Hệ đo lường Mỹ" }, |
| − | { " | + | { "Mỹ", link = "Hệ đo lường Mỹ" }, |
| − | { " | + | { "Anh", link = "Hệ đo lường Anh" }, |
| − | { " | + | { "Anh", link = "Hệ đo lường Anh" }, |
} | } | ||
| Dòng 41: | Dòng 188: | ||
-- If lk=on and link is defined, the name of the number will appear as a link. | -- If lk=on and link is defined, the name of the number will appear as a link. | ||
local eng_scales = { | local eng_scales = { | ||
| − | ["3"] = { " | + | ["3"] = { "ngàn", exponent = 3 }, |
| − | ["6"] = { " | + | ["6"] = { "triệu", exponent = 6 }, |
| − | ["9"] = { " | + | ["9"] = { "tỷ", link = "1000000000 (số)", exponent = 9 }, |
| − | ["12"] = { " | + | ["12"] = { "ngàn tỷ", link = "1000000000000 (số)", exponent = 12 }, |
| − | ["15"] = { " | + | ["15"] = { "triệu tỷ", link = "1000000000000000 (số)", exponent = 15 }, |
} | } | ||
| + | -- One of the following categories is included in the text of each message. | ||
local all_categories = { | local all_categories = { | ||
| − | unit = "[[ | + | unit = "[[Thể loại:Đơn vị chuyển đổi không hợp lệ]]", |
| − | option = "[[ | + | option = "[[Thể loại:Tùy chọn chuyển đổi không hợp lệ]]", |
| − | + | enwiki = "[[Thể loại:Bài có giá trị chuyển đổi không chính xác]]", | |
| − | |||
} | } | ||
| Dòng 58: | Dòng 205: | ||
-- each unit code marked like '...%{ft%}...'. | -- each unit code marked like '...%{ft%}...'. | ||
local unitcode_regex = '%%([{}])' | local unitcode_regex = '%%([{}])' | ||
| − | local unitcode_replace = { ['{'] = ' | + | local unitcode_replace = { ['{'] = '“', ['}'] = '”' } -- no longer need the more elaborate substitute used before 2013-09-28 |
-- All messages that may be displayed if a problem occurs. | -- All messages that may be displayed if a problem occurs. | ||
local all_messages = { | local all_messages = { | ||
| − | -- Message format string: | + | -- Message format string, %s parameters: anchor, title, text, category. |
-- Each displayed message starts with "Convert:" so can easily locate by searching article. | -- Each displayed message starts with "Convert:" so can easily locate by searching article. | ||
| − | cvt_format = '<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i>[[Help:Convert messages# | + | cvt_format = '<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i>[[:en:Help:Convert messages#%s|<span title="Chuyển đổi: %s">Chuyển đổi: %s</span>]]</i>]</sup>%s', |
| − | |||
| − | |||
-- Each of following messages is a table: | -- Each of following messages is a table: | ||
-- { [1] = 'title', -- mouseover title text | -- { [1] = 'title', -- mouseover title text | ||
| Dòng 74: | Dòng 219: | ||
-- regex = gsub_regex, | -- regex = gsub_regex, | ||
-- replace = gsub_table, | -- replace = gsub_table, | ||
| − | -- } Mouseover title text | + | -- } Mouseover title text Link text CatKey Anchor |
| − | + | cvt_bad_num = { 'Giá trị “%s” phải là số' , 'Số không hợp lệ' , 'option', 'invalid_number' }, | |
| − | + | cvt_enwiki_num = { 'Giá trị “%s” nên được viết theo tiếng Việt: “%s”' , 'Số không hợp lệ' , 'enwiki', 'invalid_number' }, | |
| − | cvt_big_prec = { ' | + | cvt_big_prec = { 'Độ chính xác “%s” quá lớn' , 'Độ chính xác quá lớn' , 'option', 'precision_too_large' }, |
| − | cvt_invalid_num = { ' | + | cvt_invalid_num = { 'Số đã tràn' , 'Tràn số' , 'option', 'number_overflow' }, |
| − | cvt_no_num = { ' | + | cvt_no_num = { 'Cần số lượng để chuyển đổi' , 'Cần số lượng' , 'option', 'needs_number' }, |
| − | cvt_no_num2 = { ' | + | cvt_no_num2 = { 'Dãy cần một số lượng nữa' , 'Cần một số lượng nữa' , 'option', 'needs_another_number' }, |
| − | cvt_bad_frac = { ' | + | cvt_bad_frac = { 'frac “%s” phải là nguyên số hơn 1' , 'Phân số không hợp lệ' , 'option', 'invalid_fraction' }, |
| − | cvt_bad_prec = { ' | + | cvt_bad_prec = { 'Độ chinh xác “%s” phải là nguyên số' , 'Độ chính xác không hợp lệ' , 'option', 'invalid_precision' }, |
| − | cvt_bad_sigfig = { ' | + | cvt_bad_sigfig = { 'Số chữ số có nghĩa “%s” phải là nguyên số dương' , 'Số chữ số có nghĩa không hợp lệ', 'option', 'invalid_sigfig' }, |
| − | cvt_empty_option = { ' | + | cvt_empty_option = { 'Đã bỏ qua tùy chọn trống “%s”' , 'Tùy chọn trống' , 'option', 'empty_option' }, |
| − | + | cvt_no_spell = { 'Không thể viết dài' , 'Hãy báo cáo lỗi' , 'option', 'ask_for_help' }, | |
| − | cvt_no_spell = { ' | + | cvt_unknown_option = { 'Đã bỏ qua tùy chọn không hợp lệ “%s”' , 'Tùy chọn không hợp lệ' , 'option', 'invalid_option' }, |
| − | cvt_unknown_option = { ' | + | cvt_bad_default = { 'Đơn vị “%s” có mặc định không hợp lệ' , 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' }, |
| − | + | cvt_bad_unit = { 'Đơn vị “%s” không hợp lệ tại đây' , 'Đơn vị không hợp lệ tại đây' , 'unit' , 'unit_invalid_here' }, | |
| − | cvt_bad_default = { ' | + | cvt_no_default = { 'Đơn vị “%s” không có đơn vị cho ra mặc định' , 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' }, |
| − | cvt_bad_unit = { ' | + | cvt_no_unit = { 'Cần tên đơn vị' , 'Cần tên đơn vị' , 'unit' , 'needs_unit_name' }, |
| − | cvt_no_default = { ' | + | cvt_unknown = { 'Không có đơn vị “%s”' , 'Đơn vị bất ngờ' , 'unit' , 'unknown_unit' }, |
| − | cvt_no_unit = { ' | + | cvt_should_be = { '%s' , 'Đơn vị không rõ' , 'unit' , 'ambiguous_unit', regex = unitcode_regex, replace = unitcode_replace }, |
| − | cvt_unknown = { ' | + | cvt_mismatch = { 'Không thể chuyển đổi “%s” thành “%s”' , 'Đơn vị không phù hợp' , 'unit' , 'unit_mismatch' }, |
| − | cvt_should_be = { ' | + | cvt_bug_convert = { 'Lỗi: Không thể chuyển đổi giữa các đơn vị được định rõ', 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' }, |
| − | cvt_mismatch = { ' | + | cvt_lookup = { 'Đơn vị “%s” được định rõ không chính xác' , 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' }, |
| − | cvt_bug_convert = { ' | ||
| − | cvt_lookup = { ' | ||
} | } | ||
-- Text to join input value/unit with output value/unit. | -- Text to join input value/unit with output value/unit. | ||
local disp_joins = { | local disp_joins = { | ||
| − | -- | + | -- Position: before after between (wrt output; "between" is for a combination; default "; "). |
| − | + | ["or"] = { " hoặc " , "" ," hoặc " }, | |
| − | [" | + | ["hoặc"] = { " hoặc " , "" ," hoặc " }, |
| + | ["hay"] = { " hay " , "" ," hay " }, | ||
["sqbr-sp"] = { " [" , "]" }, | ["sqbr-sp"] = { " [" , "]" }, | ||
["sqbr-nbsp"] = { " [" , "]" }, | ["sqbr-nbsp"] = { " [" , "]" }, | ||
| − | ["comma"] = { ", " , "" | + | ["comma"] = { ", " , "" }, |
| − | ["slash-sp"] = { " / " , "" | + | ["slash-sp"] = { " / " , "" }, |
| − | ["slash-nbsp"] = { " / ", "" | + | ["slash-nbsp"] = { " / ", "" }, |
| − | ["slash-nosp"] = { "/" , "" | + | ["slash-nosp"] = { "/" , "" }, |
["b"] = { " (" , ")" }, | ["b"] = { " (" , ")" }, | ||
| − | + | ["br"] = { "<br/>" , "" }, | |
| − | ["br"] = { "<br />" | ||
| − | |||
} | } | ||
-- Text to separate values in a range. | -- Text to separate values in a range. | ||
local range_types = { | local range_types = { | ||
| − | -- Specifying a table requires | + | -- Specifying a table requires "off" and "on" values (for "abbr=off" and "abbr=on"); |
| − | |||
| − | |||
-- other fields are optional. | -- other fields are optional. | ||
-- When "adj=on|abbr=off" applies, spaces in range text are replaced with hyphens. | -- When "adj=on|abbr=off" applies, spaces in range text are replaced with hyphens. | ||
| Dòng 128: | Dòng 268: | ||
["+"] = " + ", | ["+"] = " + ", | ||
[","] = ", ", | [","] = ", ", | ||
| − | [", and"] = ", | + | [", and"] = ", và ", |
| − | [", or"] = ", | + | [", or"] = ", hoặc ", |
| − | ["by"] = " | + | ["by"] = " nhân ", |
["-"] = "–", | ["-"] = "–", | ||
| − | ["to about"] = " | + | ["to about"] = " đến vào khoảng ", |
| − | ["and"] = { off = " | + | ["and"] = { off = " và ", on = " và ", exception = true }, |
| − | + | ["or"] = { off = " hoặc " , on = " hoặc " , exception = true }, | |
| − | ["or"] = { off = " | + | ["to"] = { off = " đến " , on = " đến " , exception = true }, |
| − | ["to"] = { off = " | + | ["to(-)"] = { off = " đến ", on = "–" }, |
| − | ["to(-)"] = { | ||
["+/-"] = { off = " ± ", on = " ± ", adj = " ± ", is_range_change = true }, | ["+/-"] = { off = " ± ", on = " ± ", adj = " ± ", is_range_change = true }, | ||
| − | + | ["x"] = { off = " nhân ", on = " × ", is_range_x = true }, | |
| − | ["x"] = { off = " | ||
["xx"] = " × ", | ["xx"] = " × ", | ||
| − | ["*"] = "×", | + | ["*"] = "×", -- use "*" to replace "x" in {{convert/2}} which is different from "x" in old {{convert}} |
| − | |||
} | } | ||
local range_aliases = { | local range_aliases = { | ||
-- ["alternative name for a range"] = "standard range name" | -- ["alternative name for a range"] = "standard range name" | ||
| − | ["–"] | + | [", và"] = ", and", |
| − | ["–"] | + | [", hoặc"] = ", or", |
| − | ["×"] | + | [", hay"] = ", or", |
| − | ["×"] | + | ["nhân"] = "by", |
| − | ["±"] | + | ["đến vào khoảng"] = "to about", |
| − | ["±"] = "+/-", | + | ["tới vào khoảng"] = "to about", |
| + | ["và"] = "and", | ||
| + | ["hoặc"] = "or", | ||
| + | ["hay"] = "or", | ||
| + | ["đến"] = "to", | ||
| + | ["tới"] = "to", | ||
| + | ["and(-)"] = "and", | ||
| + | ["và(-)"] = "and", | ||
| + | ["&"] = "and", | ||
| + | ["–"] = "-", | ||
| + | ["–"] = "-", | ||
| + | ["to-"] = "to(-)", | ||
| + | ["đến-"] = "to(-)", | ||
| + | ["tới-"] = "to(-)", | ||
| + | ["đến(-)"] = "to(-)", | ||
| + | ["tới(-)"] = "to(-)", | ||
| + | ["×"] = "x", | ||
| + | ["×"] = "x", | ||
| + | ["±"] = "+/-", | ||
| + | ["±"] = "+/-", | ||
} | } | ||
| − | -- | + | -- The following "words" are accepted to make a simple range, for example, {{convert|1-2|ft}}. |
| − | + | -- Words must be in correct order for searching, for example, '-' after '+/-' and 'x' after 'xx'. | |
| − | -- Words must be in correct order for searching, for example, 'x' after 'xx'. | + | -- Put '-' last so can have a simple range with negative values as in {{convert|-5 to -1|C}}. |
| − | local range_words = { '-', ' | + | local range_words = { '+/-', 'to(-)', 'xx', 'x', '*', 'to', 'or', 'by', '–' , '-' } |
local ranges = { | local ranges = { | ||
| Dòng 170: | Dòng 326: | ||
local en_option_name = { | local en_option_name = { | ||
-- ["local text for option name"] = "en name used in this module" | -- ["local text for option name"] = "en name used in this module" | ||
| − | |||
["abbr"] = "abbr", | ["abbr"] = "abbr", | ||
| + | ["tắt"] = "abbr", | ||
| + | ["viết tắt"] = "abbr", | ||
["adj"] = "adj", | ["adj"] = "adj", | ||
| − | [" | + | ["tt"] = "adj", |
| + | ["tính từ"] = "adj", | ||
["debug"] = "debug", | ["debug"] = "debug", | ||
| + | ["gỡ lỗi"] = "debug", | ||
["disp"] = "disp", | ["disp"] = "disp", | ||
["frac"] = "frac", | ["frac"] = "frac", | ||
| − | [" | + | ["hiển thị"] = "disp", |
| + | ["comma"] = "comma", | ||
| + | ["phẩy"] = "comma", | ||
["lang"] = "lang", | ["lang"] = "lang", | ||
| + | ["ngôn ngữ"] = "lang", | ||
["lk"] = "lk", | ["lk"] = "lk", | ||
| + | ["near"] = "near", | ||
| + | ["gần"] = "near", | ||
["order"] = "order", | ["order"] = "order", | ||
| − | [" | + | ["thứ tự"] = "order", |
| − | |||
| − | |||
["round"] = "round", | ["round"] = "round", | ||
["sigfig"] = "sigfig", | ["sigfig"] = "sigfig", | ||
| + | ["nghĩa"] = "sigfig", | ||
["sing"] = "adj", -- "sing" is an old alias for "adj" | ["sing"] = "adj", -- "sing" is an old alias for "adj" | ||
["sortable"] = "sortable", | ["sortable"] = "sortable", | ||
| + | ["sắp xếp"] = "sortable", | ||
["sp"] = "sp", | ["sp"] = "sp", | ||
| + | ["dài"] = "sp", | ||
| + | ["viết dài"] = "sp", | ||
["spell"] = "spell", | ["spell"] = "spell", | ||
| − | |||
| − | |||
| − | |||
} | } | ||
| Dòng 198: | Dòng 361: | ||
-- Convention: parms.opt_xxx refers to an option that is set here | -- Convention: parms.opt_xxx refers to an option that is set here | ||
-- (not intended to be set by the template which invokes this module). | -- (not intended to be set by the template which invokes this module). | ||
| − | -- Example: At | + | -- Example: At en.wiki, "abbr" includes: |
-- ["comma"] = "opt_nocomma" | -- ["comma"] = "opt_nocomma" | ||
| − | -- As a result, if the template uses abbr=comma, | + | -- As a result, if the template uses abbr=comma, this script sets: |
-- parms["opt_nocomma"] = true | -- parms["opt_nocomma"] = true | ||
-- parms["abbr"] = nil | -- parms["abbr"] = nil | ||
-- Therefore parms.abbr will be nil, or will have one of the listed values | -- Therefore parms.abbr will be nil, or will have one of the listed values | ||
-- that do not start with "opt_". | -- that do not start with "opt_". | ||
| − | |||
local en_option_value = { | local en_option_value = { | ||
| − | |||
["abbr"] = { | ["abbr"] = { | ||
-- ["local text for option value"] = "en value used in this module" | -- ["local text for option value"] = "en value used in this module" | ||
| + | ["comma"] = "opt_nocomma", -- no numsep in input or output numbers | ||
| + | ["chấm"] = "opt_nocomma", -- no numsep in input or output numbers | ||
["def"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation") | ["def"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation") | ||
| + | ["mặc định"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation") | ||
["h"] = "on", -- abbr=on + use "h" for hand unit (default) | ["h"] = "on", -- abbr=on + use "h" for hand unit (default) | ||
["hh"] = "opt_hand_hh", -- abbr=on + use "hh" for hand unit | ["hh"] = "opt_hand_hh", -- abbr=on + use "hh" for hand unit | ||
["in"] = "in", -- use symbol for LHS unit | ["in"] = "in", -- use symbol for LHS unit | ||
| + | ["vào"] = "in", -- use symbol for LHS unit | ||
| + | ["mos"] = "mos", -- in a range, repeat the input unit (no longer used) | ||
["none"] = "off", -- old name for "off" | ["none"] = "off", -- old name for "off" | ||
| + | ["không"] = "off", -- use name for all units | ||
["off"] = "off", -- use name for all units | ["off"] = "off", -- use name for all units | ||
| + | ["tắt"] = "off", -- use name for all units | ||
["on"] = "on", -- use symbol for all units | ["on"] = "on", -- use symbol for all units | ||
| + | ["có"] = "on", -- use symbol for all units | ||
| + | ["tất cả"] = "on", -- use symbol for all units | ||
| + | ["cả"] = "on", -- use symbol for all units | ||
["out"] = "out", -- use symbol for RHS unit (default) | ["out"] = "out", -- use symbol for RHS unit (default) | ||
| − | [" | + | ["ra"] = "out", -- use symbol for RHS unit (default) |
["values"] = "opt_values", -- show only input and output numbers, not units | ["values"] = "opt_values", -- show only input and output numbers, not units | ||
| + | ["giá trị"] = "opt_values", -- show only input and output numbers, not units | ||
["~"] = "opt_also_symbol", -- show input unit symbol as well as name | ["~"] = "opt_also_symbol", -- show input unit symbol as well as name | ||
}, | }, | ||
["adj"] = { | ["adj"] = { | ||
| − | ["mid"] = " | + | ["1"] = "opt_singular", -- unit name is singular when value satisfies: (-1 <= v and v < 0) or (0 < v and v <= 1) |
| + | ["flip"] = "opt_flip", -- reverse order of input/output | ||
| + | ["ngược"] = "opt_flip", -- reverse order of input/output | ||
| + | ["j"] = "opt_use_nbsp", -- "join": use " " instead of " " between value and unit name | ||
| + | ["nối"] = "opt_use_nbsp", -- "join": use " " instead of " " between value and unit name | ||
| + | ["mid"] = "opt_adj_mid", -- user-specified text after input unit (between input and output) | ||
| + | ["giữa"] = "opt_adj_mid", -- user-specified text after input unit (between input and output) | ||
| + | ["nocomma"] = "opt_nocomma", -- no numsep in input or output numbers | ||
| + | ["không chấm"] = "opt_nocomma", -- no numsep in input or output numbers | ||
["off"] = "", -- ignored (off is the default) | ["off"] = "", -- ignored (off is the default) | ||
| − | ["on"] = " | + | ["tắt"] = "", -- ignored (off is the default) |
| + | ["không"] = "", -- ignored (off is the default) | ||
| + | ["on"] = "", -- disable hyphenation | ||
| + | ["có"] = "", -- disable hyphenation | ||
["pre"] = "opt_one_preunit", -- user-specified text before input unit | ["pre"] = "opt_one_preunit", -- user-specified text before input unit | ||
| − | ["ri0"] = " | + | ["trước"] = "opt_one_preunit", -- user-specified text before input unit |
| − | ["ri1"] = " | + | ["ri0"] = "ri0", -- round input with precision = 0 |
| − | ["ri2"] = " | + | ["vt0"] = "ri0", -- round input with precision = 0 |
| − | ["ri3"] = " | + | ["ri1"] = "ri1", -- round input with precision = 1 |
| + | ["vt1"] = "ri1", -- round input with precision = 1 | ||
| + | ["ri2"] = "ri2", -- round input with precision = 2 | ||
| + | ["vt2"] = "ri2", -- round input with precision = 2 | ||
| + | ["ri3"] = "ri3", -- round input with precision = 3 | ||
| + | ["vt3"] = "ri3", -- round input with precision = 3 | ||
}, | }, | ||
["comma"] = { | ["comma"] = { | ||
["5"] = "opt_comma5", -- only use numsep grouping if 5 or more digits | ["5"] = "opt_comma5", -- only use numsep grouping if 5 or more digits | ||
["gaps"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits | ["gaps"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits | ||
| − | [" | + | ["kẽ"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits |
| − | [" | + | ["gaps5"] = "opt_gaps, opt_comma5", -- opt_gaps + opt_comma5 |
| + | ["kẽ 5"] = "opt_gaps, opt_comma5", -- opt_gaps + opt_comma5 | ||
}, | }, | ||
["debug"] = { | ["debug"] = { | ||
["yes"] = "opt_sortable_debug", -- make the normally hidden sort key visible | ["yes"] = "opt_sortable_debug", -- make the normally hidden sort key visible | ||
| + | ["có"] = "opt_sortable_debug", -- make the normally hidden sort key visible | ||
}, | }, | ||
["disp"] = { | ["disp"] = { | ||
| − | [" | + | ["/"] = "slash", -- join: '/' |
| + | ["2"] = "opt_output_only", -- display only output value and symbol/name (not input) | ||
| + | ["5"] = "opt_round5", -- round output value to nearest 5 | ||
["b"] = "b", -- join: '(...)' | ["b"] = "b", -- join: '(...)' | ||
| − | + | ["br"] = "br", -- join: '<br/>' | |
| − | ["br"] = "br", -- join: '<br /> | ||
| − | |||
["comma"] = "comma", -- join: ',' | ["comma"] = "comma", -- join: ',' | ||
| + | ["phẩy"] = "comma", -- join: ',' | ||
["flip"] = "opt_flip", -- reverse order of input/output | ["flip"] = "opt_flip", -- reverse order of input/output | ||
| + | ["ngược"] = "opt_flip", -- reverse order of input/output | ||
| + | ["flip5"] = "opt_flip, opt_round5", -- disp=flip + disp=5 | ||
| + | ["ngược 5"] = "opt_flip, opt_round5",-- disp=flip + disp=5 | ||
| + | ["nocomma"] = "opt_nocomma", -- no numsep in input or output numbers | ||
| + | ["không chấm"] = "opt_nocomma", -- no numsep in input or output numbers | ||
["number"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name) | ["number"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name) | ||
| + | ["số"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name) | ||
["or"] = "or", -- join: 'or' | ["or"] = "or", -- join: 'or' | ||
| + | ["hoặc"] = "or", -- join: 'or' | ||
| + | ["hay"] = "or", -- join: 'or' | ||
["out"] = "opt_output_only", | ["out"] = "opt_output_only", | ||
| + | ["ra"] = "opt_output_only", | ||
["output number only"] = "opt_output_number_only", | ["output number only"] = "opt_output_number_only", | ||
| + | ["chỉ số ra"] = "opt_output_number_only", | ||
["output only"] = "opt_output_only", | ["output only"] = "opt_output_only", | ||
| − | ["preunit"] = "opt_two_preunits", | + | ["chỉ ra"] = "opt_output_only", |
| − | ["sqbr"] = "sqbr", | + | ["preunit"] = "opt_two_preunits", -- user-specified text before input and output units |
| − | ["table"] = "opt_table", | + | ["trước đơn vị"] = "opt_two_preunits", -- user-specified text before input and output units |
| − | ["tablecen"] = "opt_tablecen", | + | ["s"] = "slash", -- join: '/' |
| − | ["unit"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value) | + | ["slash"] = "slash", -- join: '/' |
| + | ["chéo"] = "slash", -- join: '/' | ||
| + | ["sqbr"] = "sqbr", -- join: '[...]' | ||
| + | ["ngoặc vuông"] = "sqbr", -- join: '[...]' | ||
| + | ["table"] = "opt_table", -- output is suitable for a table cell with align="right" | ||
| + | ["bảng"] = "opt_table", -- output is suitable for a table cell with align="right" | ||
| + | ["tablecen"] = "opt_tablecen", -- output is suitable for a table cell with align="center" | ||
| + | ["giữa bảng"] = "opt_tablecen", -- output is suitable for a table cell with align="center" | ||
| + | ["u2"] = "opt_output_unit_only", -- display output symbol/name (not input, and not output value) | ||
| + | ["unit"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value) | ||
| + | ["đơn vị vào"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value) | ||
["unit or text"] = "opt_input_unit_only, opt_ignore_error", -- display input symbol/name, or given unit code if not known | ["unit or text"] = "opt_input_unit_only, opt_ignore_error", -- display input symbol/name, or given unit code if not known | ||
["unit2"] = "opt_output_unit_only", | ["unit2"] = "opt_output_unit_only", | ||
| − | ["x"] = "x", | + | ["đơn vị ra"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value) |
| + | ["x"] = "x", -- join: <first>...<second> (user-specified text) | ||
}, | }, | ||
-- frac=x is handled as a special case: x must be an integer (possibly in local language) = 2 or more | -- frac=x is handled as a special case: x must be an integer (possibly in local language) = 2 or more | ||
| − | + | ["lang"] = { -- language for output digits (both en and local digits are always accepted for input) | |
| − | ["lang"] = { | ||
["en"] = "opt_lang_en", -- use en digits for numbers, regardless of local language | ["en"] = "opt_lang_en", -- use en digits for numbers, regardless of local language | ||
["local"] = "opt_lang_local", -- use local digits for numbers (default, although config can change default to en) | ["local"] = "opt_lang_local", -- use local digits for numbers (default, although config can change default to en) | ||
| Dòng 271: | Dòng 482: | ||
["lk"] = { | ["lk"] = { | ||
["in"] = "in", -- link LHS unit name or symbol | ["in"] = "in", -- link LHS unit name or symbol | ||
| + | ["vào"] = "in", -- link LHS unit name or symbol | ||
["off"] = "off", -- do not link: same as default except for hand unit | ["off"] = "off", -- do not link: same as default except for hand unit | ||
| + | ["tắt"] = "off", -- do not link: same as default except for hand unit | ||
| + | ["không"] = "off", -- do not link: same as default except for hand unit | ||
["on"] = "on", -- link all unit names or symbols (but not twice for the same unit) | ["on"] = "on", -- link all unit names or symbols (but not twice for the same unit) | ||
| + | ["có"] = "on", -- link all unit names or symbols (but not twice for the same unit) | ||
| + | ["cả"] = "on", -- link all unit names or symbols (but not twice for the same unit) | ||
| + | ["tất cả"] = "on", -- link all unit names or symbols (but not twice for the same unit) | ||
["out"] = "out", -- link RHS unit name or symbol | ["out"] = "out", -- link RHS unit name or symbol | ||
| + | ["ra"] = "out", -- link RHS unit name or symbol | ||
| + | }, | ||
| + | ["near"] = { | ||
| + | ["5"] = "opt_round5", -- round output value to nearest 5 | ||
}, | }, | ||
["order"] = { | ["order"] = { | ||
["flip"] = "opt_flip", -- reverse order of input/output | ["flip"] = "opt_flip", -- reverse order of input/output | ||
| − | [" | + | ["ngược"] = "opt_flip", -- reverse order of input/output |
}, | }, | ||
| − | |||
| − | |||
["round"] = { | ["round"] = { | ||
| − | [" | + | ["5"] = "opt_round5", -- round output value to nearest 5 |
| − | + | ["25"] = "opt_round25", -- round output value to nearest 25 | |
| − | |||
| − | ["25"] = " | ||
| − | |||
["each"] = "opt_round_each", -- using default precision in a range, round each output separately (default uses highest precision of each item in range) | ["each"] = "opt_round_each", -- using default precision in a range, round each output separately (default uses highest precision of each item in range) | ||
}, | }, | ||
| Dòng 292: | Dòng 508: | ||
["sortable"] = { | ["sortable"] = { | ||
["off"] = "", -- ignored (off is the default) | ["off"] = "", -- ignored (off is the default) | ||
| − | [" | + | ["tắt"] = "", -- ignored (off is the default) |
| − | [" | + | ["không"] = "", -- ignored (off is the default) |
| + | ["in"] = "opt_sortable_in", -- output numeric hidden sort field for use in a sortable table, based on input | ||
| + | ["có"] = "opt_sortable", -- output numeric hidden sort field for use in a sortable table, based on input | ||
| + | ["on"] = "opt_sortable_in", -- same | ||
| + | ["out"] = "opt_sortable_out", -- same, based on output | ||
}, | }, | ||
["sp"] = { | ["sp"] = { | ||
| Dòng 300: | Dòng 520: | ||
["spell"] = { -- only English spelling is supported; not scientific notation; only some fractions | ["spell"] = { -- only English spelling is supported; not scientific notation; only some fractions | ||
["in"] = "opt_spell_in", -- spell input value in words | ["in"] = "opt_spell_in", -- spell input value in words | ||
| + | ["vào"] = "opt_spell_in", -- spell input value in words | ||
["In"] = "opt_spell_in, opt_spell_upper", -- spell input value in words with first letter uppercase | ["In"] = "opt_spell_in, opt_spell_upper", -- spell input value in words with first letter uppercase | ||
| + | ["Vào"] = "opt_spell_in, opt_spell_upper", -- spell input value in words with first letter uppercase | ||
["on"] = "opt_spell_in, opt_spell_out", -- spell input and output values in words | ["on"] = "opt_spell_in, opt_spell_out", -- spell input and output values in words | ||
["On"] = "opt_spell_in, opt_spell_out, opt_spell_upper", -- same, with first letter of first word in result uppercase | ["On"] = "opt_spell_in, opt_spell_out, opt_spell_upper", -- same, with first letter of first word in result uppercase | ||
}, | }, | ||
| − | |||
| − | |||
| − | |||
} | } | ||
| Dòng 313: | Dòng 532: | ||
all_categories = all_categories, | all_categories = all_categories, | ||
all_messages = all_messages, | all_messages = all_messages, | ||
| − | currency = { ['$'] = true, ['£'] = true, [' | + | currency = { ['$'] = true, ['£'] = true, ['₫'] = true }, |
customary_units = customary_units, | customary_units = customary_units, | ||
disp_joins = disp_joins, | disp_joins = disp_joins, | ||
| Dòng 320: | Dòng 539: | ||
eng_scales = eng_scales, | eng_scales = eng_scales, | ||
ranges = ranges, | ranges = ranges, | ||
| + | translation_table = translation_table, | ||
} | } | ||
Phiên bản lúc 11:20, ngày 24 tháng 4 năm 2021
Có thể viết tài liệu về mô đun này tại Mô đun:Convert/text/tài liệu.
local translation_table = {
numdot = ',', -- decimal mark
numsep = '.', -- separator for number grouping
per_word = 'một', -- for units like "miles per gallon"
plural_suffix = '', -- disable plural unit names
specials = { -- for special processing by makeunits
utype = {
-- ["unit type in local language"] = "name_used_in_this_script"
["fuel efficiency"] = "type_fuel_efficiency",
["length"] = "type_length",
["temperature"] = "type_temperature",
["volume"] = "type_volume",
},
ucode = {
exception = {
-- ["unit code in local language"] = "name_used_in_module_convert"
["ft"] = "integer_more_precision",
["in"] = "subunit_more_precision",
["lb"] = "integer_more_precision",
},
istemperature = {
-- Common temperature scales (not keVT or MK).
-- ["unit code in local language"] = 1
["C"] = true,
["F"] = true,
["K"] = true,
["R"] = true,
},
usesymbol = {
-- Use unit symbol not name if abbr not specified.
-- ["unit code in local language"] = 1
["C"] = 1,
["F"] = 1,
["K"] = 1,
["R"] = 1,
["C-change"] = 1,
["F-change"] = 1,
["K-change"] = 1,
},
alttype = {
-- Unit has an alternate type that is a valid conversion.
-- ["unit code in local language"] = "alternate type in local language"
["Nm"] = "energy",
["ftlb"] = "torque",
["ftlb-f"] = "torque",
["ftlbf"] = "torque",
["inlb"] = "torque",
["inlb-f"] = "torque",
["inlbf"] = "torque",
["inoz-f"] = "torque",
["inozf"] = "torque",
},
},
},
mtext = {
titles = {
-- name_used_in_this_script = 'Title of page'
conversion_data = 'Mô đun:Convert/documentation/conversion data/tài liệu',
},
messages = {
-- name_used_in_this_script = 'Error message ($1 = first parameter, $2 = second)'
m_als_bad = 'Biệt danh có văn bản không hợp lệ trong ô “$1”.',
m_als_dup = 'Khác biệt “$1” đã được định rõ.',
m_als_link = 'Biệt danh “$1” phải có liên kết wiki (“[[…]]”) trong văn bản liên kết tượng trưng.',
m_als_mul = 'Biệt danh “$1” có số nhân “$2” không phải là số.',
m_als_same = 'Nên bỏ qua “$1” cho biệt danh “$2” vì nó trùng khớp với đích.',
m_als_type = 'Đích của biệt danh “$1” có kiểu sai.',
m_als_undef = 'Đơn vị chính phải được định rõ trước biệt danh “=$1”.',
m_cmb_miss = 'Thiếu mã đơn vị của một tổ hợp.',
m_cmb_none = 'Đơn vị không được định rõ cho tổ hợp “$2”.',
m_cmb_one = 'Chỉ có một đơn vị được định rõ cho tổ hợp “$2”.',
m_cmb_type = 'Đơn vị “$1” trong tổ hợp “$2” có kiểu sai.',
m_cmb_undef = 'Đơn vị “$1” trong tổ hợp “$2” không được định rõ.',
m_cmp_def = 'Hỗn hợp “$1” phải định rõ một mã đơn vị mặc định.',
m_cmp_int = 'Hỗn hợp “$1” có những thành phần có toán hạng tỷ lệ không phải số nguyên.',
m_cmp_inval = 'Hỗn hợp “$1” có một thành phần có tỷ lệ không hợp lệ “$2”.',
m_cmp_many = 'Hỗn hợp “$1” có nhiều ô quá.',
m_cmp_miss = 'Thiếu mã đơn vị cho một hỗn hợp.',
m_cmp_order = 'Hỗn hợp “$1” có những thành phần có thứ tự sai hoặc tỷ lệ không hợp lệ.',
m_cmp_scale = 'Đơn vị thay thế “$1” trong hỗn hợp “$2” có tỷ lệ sai.',
m_cmp_two = 'Hỗn hợp “$1” phải định rõ đúng hai mã đơn vị.',
m_cmp_type = 'Đơn vị “$1” trong hỗn hợp “$2” có kiểu sai.',
m_cmp_undef = 'Đơn vị “$1” trong hỗn hợp “$2” không được định rõ.',
m_def_cond = 'Điều kiện không hợp lệ trong mặc định “$1” của đơn vị “$2”.',
m_def_fmt = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” phải có 2 hoặc 3 “!”.',
m_def_rpt = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” bị lặp lại.',
m_def_same = 'Giá trị cho ra mặc định của đơn vị “$1” có cùng đơn vị.',
m_def_type = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” có kiểu sai.',
m_def_undef = 'Giá trị cho ra mặc định “$1” của đơn vị “$2” không được định rõ.',
m_dfs_code = 'Phần mặc định: không định rõ mã đơn vị.',
m_dfs_dup = 'Phần mặc định: đơn vị “$1” đã được định rõ.',
m_dfs_none = 'Phần mặc định: đơn vị “$1” không định rõ mặc định.',
m_dfs_sym = 'Phần mặc định: đơn vị “$1” phải có ký hiệu.',
m_dfs_two = 'Phần mặc định: đơn vị “$1” phải chỉ có hai ô.',
m_dfs_undef = 'Phần mặc định: đơn vị “$1” không được định rõ.',
m_dup_code = 'Mã đơn vị “$1” đã được định rõ.',
m_error = 'Lỗi:',
m_ftl_read = 'Không thể đọc văn bản wiki từ “[[$1]]”.',
m_ftl_table = '[[$1]] phải xuất bảng “$2”.',
m_ftl_type = 'Lỗi sự cố: Kiểu dữ liệu không rõ của “$1”',
m_hdg_lev2 = 'Không tìm thấy đề mục cấp 2 “$1”.',
m_hdg_lev3 = 'Không có đề mục cấp 3 trước: $1',
m_line_num = ' (dòng $1).',
m_lnk_brack = 'Liên kết “$1” có số dấu ngoặc vuông sai.',
m_lnk_dup = 'Ngoại lệ liên kết “$1” đã được định rõ.',
m_lnk_miss = 'Thiếu mã đơn vị cho một liên kết.',
m_lnk_none = 'Không định rõ liên kết cho đơn vị “$1”.',
m_lnk_sym = 'Mã đơn vị “$1” cho một liên kết phải có ký hiệu.',
m_lnk_two = 'Hàng của liên kết đơn vị “$1” phải chỉ có hai ô.',
m_lnk_type = 'Ngoại lệ liên kết “$1” có kiểu sai.',
m_lnk_undef = 'Mã đơn vị “$1” cho một liên kết không được định rõ.',
m_miss_code = 'Thiếu mã đơn vị.',
m_miss_sym = 'Thiếu ký hiệu.',
m_miss_type = 'Thiếu kiểu đơn vị.',
m_mul_int = 'Bội số “$1” có những thành phần có toán hạng tỷ lệ không phải số nguyên.',
m_mul_miss = 'Thiếu mã đơn vị cho một bội số.',
m_mul_none = 'Không định rõ đơn vị nào cho bội số “$1”.',
m_mul_one = 'Chỉ có định rõ một đơn vị cho bội số “$1”.',
m_mul_order = 'Bội số “$1” có những thành phần có thứ tự sai hoặc tỷ lệ không hợp lệ.',
m_mul_scale = 'Bội số “$1” có một thành phần có tỷ lệ không hợp lệ “$2”.',
m_mul_std = 'Đơn vị “$1” trong bội số “$2” phải là một đơn vị chuẩn.',
m_mul_type = 'Đơn vị “$1” trong bội số “$2” có kiểu sai.',
m_mul_undef = 'Đơn vị “$1” trong bội số “$2” không được định rõ.',
m_no_title = 'Cần nhan đề trang có các định nghĩa đơn vị.',
m_ovr_dup = 'Đơn vị ghi đè “$1” đã được định rõ.',
m_ovr_miss = 'Thiếu mã đơn vị để ghi đè.',
m_per_dup = 'Đơn vị chia “$1” đã được định rõ.',
m_per_empty = 'Đơn vị “$1” có một ô trống trong “per”.',
m_per_fuel = 'Đơn vị “$1” có các kiểu đơn vị không hợp lệ cho hiệu suất nhiên liệu.',
m_per_two = 'Đơn vị “$1” không có đúng hai ô trong “per”.',
m_per_undef = 'Đơn vị “$1” có mã đơn vị không rõ “$2” trong “per”.',
m_percent_s = 'Ô “$1” phải không chứa “%s”.',
m_pfx_bad = 'Tiền tố không rõ: “$1”.',
m_pfx_name = 'Đơn vị định rõ Prefix phải bao gồm Name.',
m_scl_bad = 'Biểu thức tỷ lệ không hợp lệ: "$1".',
m_scl_miss = 'Thiếu tỷ lệ.',
m_scl_oflow = 'Biểu thức tỷ lệ cho ra giá trị không hợp lệ: “$1”.',
m_var_cnt = 'Phần tên biến số: mỗi hàng phải có năm trường.',
m_var_dup = 'Đơn vị “$1” đã có một tên biến số.',
m_var_miss = 'Thiếu trường cho tên biến số.',
m_var_undef = 'Không định rõ đơn vị “$1” trong tên biến số.',
m_warning = 'Cảnh báo:',
m_wrn_more = ' (và thêm đơn vị không được liệt kê)',
m_wrn_nbsp = 'Dòng $1 có khoảng cách không ngắt dòng',
m_wrn_nodef = 'Các đơn vị với mã đơn vị sau không có giá trị cho ra mặc định.',
m_wrn_ucode = ' $1',
},
}
}
-- Some units accept an SI prefix before the unit code, such as "kg" for kilogram.
local SIprefixes = {
-- The prefix field is what the prefix should be, if different from the prefix used.
['Y'] = { exponent = 24, name = 'yôta', },
['Z'] = { exponent = 21, name = 'zêta', },
['E'] = { exponent = 18, name = 'exa' , },
['P'] = { exponent = 15, name = 'pêta' , },
['T'] = { exponent = 12, name = 'têra' , },
['G'] = { exponent = 9, name = 'giga' , },
['M'] = { exponent = 6, name = 'mêga' , },
['k'] = { exponent = 3, name = 'kilô' , },
['h'] = { exponent = 2, name = 'hêctô', },
['da']= { exponent = 1, name = 'đềca' , },
['d'] = { exponent = -1, name = 'đêxi' , },
['c'] = { exponent = -2, name = 'xenti', },
['m'] = { exponent = -3, name = 'mili', },
['μ'] = { exponent = -6, name = 'micrô', prefix = 'µ' }, -- key = 'GREEK SMALL LETTER MU' (U+03BC) utf-8 CE BC
['µ'] = { exponent = -6, name = 'micrô', }, -- key = 'MICRO SIGN' (U+00B5) utf-8 C2 B5
['u'] = { exponent = -6, name = 'micrô', prefix = 'µ' }, -- not an SI prefix, but allow for people typing this
['n'] = { exponent = -9, name = 'nanô' , },
['p'] = { exponent =-12, name = 'picô' , },
['f'] = { exponent =-15, name = 'femtô', },
['a'] = { exponent =-18, name = 'atô' , },
['z'] = { exponent =-21, name = 'zéptô', },
['y'] = { exponent =-24, name = 'yóctô', },
}
-- Some units can be qualified with one of the following prefixes, when linked.
local customary_units = {
{ "Mỹ", link = "Hệ đo lường Mỹ" },
{ "Mỹ", link = "Hệ đo lường Mỹ" },
{ "Anh", link = "Hệ đo lường Anh" },
{ "Anh", link = "Hệ đo lường Anh" },
}
-- Names when using engineering notation (a prefix of "eN" where N is a number; example "e6km").
-- key = { "name", link = "article title", exponent = numeric_key_value }
-- If lk=on and link is defined, the name of the number will appear as a link.
local eng_scales = {
["3"] = { "ngàn", exponent = 3 },
["6"] = { "triệu", exponent = 6 },
["9"] = { "tỷ", link = "1000000000 (số)", exponent = 9 },
["12"] = { "ngàn tỷ", link = "1000000000000 (số)", exponent = 12 },
["15"] = { "triệu tỷ", link = "1000000000000000 (số)", exponent = 15 },
}
-- One of the following categories is included in the text of each message.
local all_categories = {
unit = "[[Thể loại:Đơn vị chuyển đổi không hợp lệ]]",
option = "[[Thể loại:Tùy chọn chuyển đổi không hợp lệ]]",
enwiki = "[[Thể loại:Bài có giá trị chuyển đổi không chính xác]]",
}
-- For some error messages, the following puts the wanted style around
-- each unit code marked like '...%{ft%}...'.
local unitcode_regex = '%%([{}])'
local unitcode_replace = { ['{'] = '“', ['}'] = '”' } -- no longer need the more elaborate substitute used before 2013-09-28
-- All messages that may be displayed if a problem occurs.
local all_messages = {
-- Message format string, %s parameters: anchor, title, text, category.
-- Each displayed message starts with "Convert:" so can easily locate by searching article.
cvt_format = '<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i>[[:en:Help:Convert messages#%s|<span title="Chuyển đổi: %s">Chuyển đổi: %s</span>]]</i>]</sup>%s',
-- Each of following messages is a table:
-- { [1] = 'title', -- mouseover title text
-- [2] = 'text', -- link text displayed in article
-- [3] = 'category key', -- key to lookup category in all_categories
-- [4] = 'anchor', -- anchor for link to relevant section on help page
-- regex = gsub_regex,
-- replace = gsub_table,
-- } Mouseover title text Link text CatKey Anchor
cvt_bad_num = { 'Giá trị “%s” phải là số' , 'Số không hợp lệ' , 'option', 'invalid_number' },
cvt_enwiki_num = { 'Giá trị “%s” nên được viết theo tiếng Việt: “%s”' , 'Số không hợp lệ' , 'enwiki', 'invalid_number' },
cvt_big_prec = { 'Độ chính xác “%s” quá lớn' , 'Độ chính xác quá lớn' , 'option', 'precision_too_large' },
cvt_invalid_num = { 'Số đã tràn' , 'Tràn số' , 'option', 'number_overflow' },
cvt_no_num = { 'Cần số lượng để chuyển đổi' , 'Cần số lượng' , 'option', 'needs_number' },
cvt_no_num2 = { 'Dãy cần một số lượng nữa' , 'Cần một số lượng nữa' , 'option', 'needs_another_number' },
cvt_bad_frac = { 'frac “%s” phải là nguyên số hơn 1' , 'Phân số không hợp lệ' , 'option', 'invalid_fraction' },
cvt_bad_prec = { 'Độ chinh xác “%s” phải là nguyên số' , 'Độ chính xác không hợp lệ' , 'option', 'invalid_precision' },
cvt_bad_sigfig = { 'Số chữ số có nghĩa “%s” phải là nguyên số dương' , 'Số chữ số có nghĩa không hợp lệ', 'option', 'invalid_sigfig' },
cvt_empty_option = { 'Đã bỏ qua tùy chọn trống “%s”' , 'Tùy chọn trống' , 'option', 'empty_option' },
cvt_no_spell = { 'Không thể viết dài' , 'Hãy báo cáo lỗi' , 'option', 'ask_for_help' },
cvt_unknown_option = { 'Đã bỏ qua tùy chọn không hợp lệ “%s”' , 'Tùy chọn không hợp lệ' , 'option', 'invalid_option' },
cvt_bad_default = { 'Đơn vị “%s” có mặc định không hợp lệ' , 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' },
cvt_bad_unit = { 'Đơn vị “%s” không hợp lệ tại đây' , 'Đơn vị không hợp lệ tại đây' , 'unit' , 'unit_invalid_here' },
cvt_no_default = { 'Đơn vị “%s” không có đơn vị cho ra mặc định' , 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' },
cvt_no_unit = { 'Cần tên đơn vị' , 'Cần tên đơn vị' , 'unit' , 'needs_unit_name' },
cvt_unknown = { 'Không có đơn vị “%s”' , 'Đơn vị bất ngờ' , 'unit' , 'unknown_unit' },
cvt_should_be = { '%s' , 'Đơn vị không rõ' , 'unit' , 'ambiguous_unit', regex = unitcode_regex, replace = unitcode_replace },
cvt_mismatch = { 'Không thể chuyển đổi “%s” thành “%s”' , 'Đơn vị không phù hợp' , 'unit' , 'unit_mismatch' },
cvt_bug_convert = { 'Lỗi: Không thể chuyển đổi giữa các đơn vị được định rõ', 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' },
cvt_lookup = { 'Đơn vị “%s” được định rõ không chính xác' , 'Hãy báo cáo lỗi' , 'unit' , 'ask_for_help' },
}
-- Text to join input value/unit with output value/unit.
local disp_joins = {
-- Position: before after between (wrt output; "between" is for a combination; default "; ").
["or"] = { " hoặc " , "" ," hoặc " },
["hoặc"] = { " hoặc " , "" ," hoặc " },
["hay"] = { " hay " , "" ," hay " },
["sqbr-sp"] = { " [" , "]" },
["sqbr-nbsp"] = { " [" , "]" },
["comma"] = { ", " , "" },
["slash-sp"] = { " / " , "" },
["slash-nbsp"] = { " / ", "" },
["slash-nosp"] = { "/" , "" },
["b"] = { " (" , ")" },
["br"] = { "<br/>" , "" },
}
-- Text to separate values in a range.
local range_types = {
-- Specifying a table requires "off" and "on" values (for "abbr=off" and "abbr=on");
-- other fields are optional.
-- When "adj=on|abbr=off" applies, spaces in range text are replaced with hyphens.
-- With "exception = true", that also occurs with "adj=on|abbr=on".
-- If "adj" is defined here, that text (unchanged) is used with "adj=on".
["+"] = " + ",
[","] = ", ",
[", and"] = ", và ",
[", or"] = ", hoặc ",
["by"] = " nhân ",
["-"] = "–",
["to about"] = " đến vào khoảng ",
["and"] = { off = " và ", on = " và ", exception = true },
["or"] = { off = " hoặc " , on = " hoặc " , exception = true },
["to"] = { off = " đến " , on = " đến " , exception = true },
["to(-)"] = { off = " đến ", on = "–" },
["+/-"] = { off = " ± ", on = " ± ", adj = " ± ", is_range_change = true },
["x"] = { off = " nhân ", on = " × ", is_range_x = true },
["xx"] = " × ",
["*"] = "×", -- use "*" to replace "x" in {{convert/2}} which is different from "x" in old {{convert}}
}
local range_aliases = {
-- ["alternative name for a range"] = "standard range name"
[", và"] = ", and",
[", hoặc"] = ", or",
[", hay"] = ", or",
["nhân"] = "by",
["đến vào khoảng"] = "to about",
["tới vào khoảng"] = "to about",
["và"] = "and",
["hoặc"] = "or",
["hay"] = "or",
["đến"] = "to",
["tới"] = "to",
["and(-)"] = "and",
["và(-)"] = "and",
["&"] = "and",
["–"] = "-",
["–"] = "-",
["to-"] = "to(-)",
["đến-"] = "to(-)",
["tới-"] = "to(-)",
["đến(-)"] = "to(-)",
["tới(-)"] = "to(-)",
["×"] = "x",
["×"] = "x",
["±"] = "+/-",
["±"] = "+/-",
}
-- The following "words" are accepted to make a simple range, for example, {{convert|1-2|ft}}.
-- Words must be in correct order for searching, for example, '-' after '+/-' and 'x' after 'xx'.
-- Put '-' last so can have a simple range with negative values as in {{convert|-5 to -1|C}}.
local range_words = { '+/-', 'to(-)', 'xx', 'x', '*', 'to', 'or', 'by', '–' , '-' }
local ranges = {
types = range_types,
aliases = range_aliases,
words = range_words,
}
-- Valid option names.
local en_option_name = {
-- ["local text for option name"] = "en name used in this module"
["abbr"] = "abbr",
["tắt"] = "abbr",
["viết tắt"] = "abbr",
["adj"] = "adj",
["tt"] = "adj",
["tính từ"] = "adj",
["debug"] = "debug",
["gỡ lỗi"] = "debug",
["disp"] = "disp",
["frac"] = "frac",
["hiển thị"] = "disp",
["comma"] = "comma",
["phẩy"] = "comma",
["lang"] = "lang",
["ngôn ngữ"] = "lang",
["lk"] = "lk",
["near"] = "near",
["gần"] = "near",
["order"] = "order",
["thứ tự"] = "order",
["round"] = "round",
["sigfig"] = "sigfig",
["nghĩa"] = "sigfig",
["sing"] = "adj", -- "sing" is an old alias for "adj"
["sortable"] = "sortable",
["sắp xếp"] = "sortable",
["sp"] = "sp",
["dài"] = "sp",
["viết dài"] = "sp",
["spell"] = "spell",
}
-- Valid option values.
-- Convention: parms.opt_xxx refers to an option that is set here
-- (not intended to be set by the template which invokes this module).
-- Example: At en.wiki, "abbr" includes:
-- ["comma"] = "opt_nocomma"
-- As a result, if the template uses abbr=comma, this script sets:
-- parms["opt_nocomma"] = true
-- parms["abbr"] = nil
-- Therefore parms.abbr will be nil, or will have one of the listed values
-- that do not start with "opt_".
local en_option_value = {
["abbr"] = {
-- ["local text for option value"] = "en value used in this module"
["comma"] = "opt_nocomma", -- no numsep in input or output numbers
["chấm"] = "opt_nocomma", -- no numsep in input or output numbers
["def"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation")
["mặc định"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation")
["h"] = "on", -- abbr=on + use "h" for hand unit (default)
["hh"] = "opt_hand_hh", -- abbr=on + use "hh" for hand unit
["in"] = "in", -- use symbol for LHS unit
["vào"] = "in", -- use symbol for LHS unit
["mos"] = "mos", -- in a range, repeat the input unit (no longer used)
["none"] = "off", -- old name for "off"
["không"] = "off", -- use name for all units
["off"] = "off", -- use name for all units
["tắt"] = "off", -- use name for all units
["on"] = "on", -- use symbol for all units
["có"] = "on", -- use symbol for all units
["tất cả"] = "on", -- use symbol for all units
["cả"] = "on", -- use symbol for all units
["out"] = "out", -- use symbol for RHS unit (default)
["ra"] = "out", -- use symbol for RHS unit (default)
["values"] = "opt_values", -- show only input and output numbers, not units
["giá trị"] = "opt_values", -- show only input and output numbers, not units
["~"] = "opt_also_symbol", -- show input unit symbol as well as name
},
["adj"] = {
["1"] = "opt_singular", -- unit name is singular when value satisfies: (-1 <= v and v < 0) or (0 < v and v <= 1)
["flip"] = "opt_flip", -- reverse order of input/output
["ngược"] = "opt_flip", -- reverse order of input/output
["j"] = "opt_use_nbsp", -- "join": use " " instead of " " between value and unit name
["nối"] = "opt_use_nbsp", -- "join": use " " instead of " " between value and unit name
["mid"] = "opt_adj_mid", -- user-specified text after input unit (between input and output)
["giữa"] = "opt_adj_mid", -- user-specified text after input unit (between input and output)
["nocomma"] = "opt_nocomma", -- no numsep in input or output numbers
["không chấm"] = "opt_nocomma", -- no numsep in input or output numbers
["off"] = "", -- ignored (off is the default)
["tắt"] = "", -- ignored (off is the default)
["không"] = "", -- ignored (off is the default)
["on"] = "", -- disable hyphenation
["có"] = "", -- disable hyphenation
["pre"] = "opt_one_preunit", -- user-specified text before input unit
["trước"] = "opt_one_preunit", -- user-specified text before input unit
["ri0"] = "ri0", -- round input with precision = 0
["vt0"] = "ri0", -- round input with precision = 0
["ri1"] = "ri1", -- round input with precision = 1
["vt1"] = "ri1", -- round input with precision = 1
["ri2"] = "ri2", -- round input with precision = 2
["vt2"] = "ri2", -- round input with precision = 2
["ri3"] = "ri3", -- round input with precision = 3
["vt3"] = "ri3", -- round input with precision = 3
},
["comma"] = {
["5"] = "opt_comma5", -- only use numsep grouping if 5 or more digits
["gaps"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits
["kẽ"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits
["gaps5"] = "opt_gaps, opt_comma5", -- opt_gaps + opt_comma5
["kẽ 5"] = "opt_gaps, opt_comma5", -- opt_gaps + opt_comma5
},
["debug"] = {
["yes"] = "opt_sortable_debug", -- make the normally hidden sort key visible
["có"] = "opt_sortable_debug", -- make the normally hidden sort key visible
},
["disp"] = {
["/"] = "slash", -- join: '/'
["2"] = "opt_output_only", -- display only output value and symbol/name (not input)
["5"] = "opt_round5", -- round output value to nearest 5
["b"] = "b", -- join: '(...)'
["br"] = "br", -- join: '<br/>'
["comma"] = "comma", -- join: ','
["phẩy"] = "comma", -- join: ','
["flip"] = "opt_flip", -- reverse order of input/output
["ngược"] = "opt_flip", -- reverse order of input/output
["flip5"] = "opt_flip, opt_round5", -- disp=flip + disp=5
["ngược 5"] = "opt_flip, opt_round5",-- disp=flip + disp=5
["nocomma"] = "opt_nocomma", -- no numsep in input or output numbers
["không chấm"] = "opt_nocomma", -- no numsep in input or output numbers
["number"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name)
["số"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name)
["or"] = "or", -- join: 'or'
["hoặc"] = "or", -- join: 'or'
["hay"] = "or", -- join: 'or'
["out"] = "opt_output_only",
["ra"] = "opt_output_only",
["output number only"] = "opt_output_number_only",
["chỉ số ra"] = "opt_output_number_only",
["output only"] = "opt_output_only",
["chỉ ra"] = "opt_output_only",
["preunit"] = "opt_two_preunits", -- user-specified text before input and output units
["trước đơn vị"] = "opt_two_preunits", -- user-specified text before input and output units
["s"] = "slash", -- join: '/'
["slash"] = "slash", -- join: '/'
["chéo"] = "slash", -- join: '/'
["sqbr"] = "sqbr", -- join: '[...]'
["ngoặc vuông"] = "sqbr", -- join: '[...]'
["table"] = "opt_table", -- output is suitable for a table cell with align="right"
["bảng"] = "opt_table", -- output is suitable for a table cell with align="right"
["tablecen"] = "opt_tablecen", -- output is suitable for a table cell with align="center"
["giữa bảng"] = "opt_tablecen", -- output is suitable for a table cell with align="center"
["u2"] = "opt_output_unit_only", -- display output symbol/name (not input, and not output value)
["unit"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value)
["đơn vị vào"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value)
["unit or text"] = "opt_input_unit_only, opt_ignore_error", -- display input symbol/name, or given unit code if not known
["unit2"] = "opt_output_unit_only",
["đơn vị ra"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value)
["x"] = "x", -- join: <first>...<second> (user-specified text)
},
-- frac=x is handled as a special case: x must be an integer (possibly in local language) = 2 or more
["lang"] = { -- language for output digits (both en and local digits are always accepted for input)
["en"] = "opt_lang_en", -- use en digits for numbers, regardless of local language
["local"] = "opt_lang_local", -- use local digits for numbers (default, although config can change default to en)
},
["lk"] = {
["in"] = "in", -- link LHS unit name or symbol
["vào"] = "in", -- link LHS unit name or symbol
["off"] = "off", -- do not link: same as default except for hand unit
["tắt"] = "off", -- do not link: same as default except for hand unit
["không"] = "off", -- do not link: same as default except for hand unit
["on"] = "on", -- link all unit names or symbols (but not twice for the same unit)
["có"] = "on", -- link all unit names or symbols (but not twice for the same unit)
["cả"] = "on", -- link all unit names or symbols (but not twice for the same unit)
["tất cả"] = "on", -- link all unit names or symbols (but not twice for the same unit)
["out"] = "out", -- link RHS unit name or symbol
["ra"] = "out", -- link RHS unit name or symbol
},
["near"] = {
["5"] = "opt_round5", -- round output value to nearest 5
},
["order"] = {
["flip"] = "opt_flip", -- reverse order of input/output
["ngược"] = "opt_flip", -- reverse order of input/output
},
["round"] = {
["5"] = "opt_round5", -- round output value to nearest 5
["25"] = "opt_round25", -- round output value to nearest 25
["each"] = "opt_round_each", -- using default precision in a range, round each output separately (default uses highest precision of each item in range)
},
-- sigfig=x is handled as a special case: x must be an integer (possibly in local language) = 1 or more
["sortable"] = {
["off"] = "", -- ignored (off is the default)
["tắt"] = "", -- ignored (off is the default)
["không"] = "", -- ignored (off is the default)
["in"] = "opt_sortable_in", -- output numeric hidden sort field for use in a sortable table, based on input
["có"] = "opt_sortable", -- output numeric hidden sort field for use in a sortable table, based on input
["on"] = "opt_sortable_in", -- same
["out"] = "opt_sortable_out", -- same, based on output
},
["sp"] = {
["us"] = "opt_sp_us", -- use U.S. spelling (like "meter" instead of default "metre")
},
["spell"] = { -- only English spelling is supported; not scientific notation; only some fractions
["in"] = "opt_spell_in", -- spell input value in words
["vào"] = "opt_spell_in", -- spell input value in words
["In"] = "opt_spell_in, opt_spell_upper", -- spell input value in words with first letter uppercase
["Vào"] = "opt_spell_in, opt_spell_upper", -- spell input value in words with first letter uppercase
["on"] = "opt_spell_in, opt_spell_out", -- spell input and output values in words
["On"] = "opt_spell_in, opt_spell_out, opt_spell_upper", -- same, with first letter of first word in result uppercase
},
}
return {
SIprefixes = SIprefixes,
all_categories = all_categories,
all_messages = all_messages,
currency = { ['$'] = true, ['£'] = true, ['₫'] = true },
customary_units = customary_units,
disp_joins = disp_joins,
en_option_name = en_option_name,
en_option_value = en_option_value,
eng_scales = eng_scales,
ranges = ranges,
translation_table = translation_table,
}