From fae19ac900bf7e6ba55645a9a5a342d350e95f84 Mon Sep 17 00:00:00 2001 From: liaojack8 Date: Sat, 4 Jul 2020 01:41:35 +0800 Subject: [PATCH] translate --- src/summary.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/summary.js b/src/summary.js index be4377a..644f244 100644 --- a/src/summary.js +++ b/src/summary.js @@ -5,10 +5,10 @@ const { escape } = require('html-escaper') module.exports = { make_table, summary, make_html, make_tg_table } function make_html ({ file_count, folder_count, total_size, details }) { - const head = ['类型', '数量', '大小'] + const head = ['類型', '數量', '大小'] const th = '' + head.map(k => `${k}`).join('') + '' const td = details.map(v => '' + [escape(v.ext), v.count, v.size].map(k => `${k}`).join('') + '').join('') - let tail = ['合计', file_count + folder_count, total_size] + let tail = ['合計', file_count + folder_count, total_size] tail = '' + tail.map(k => `${k}`).join('') + '' const table = ` ${th} @@ -56,8 +56,8 @@ function make_tg_table ({ file_count, folder_count, total_size, details }) { const hAlign = 'center' const headers = ['Type', 'Count', 'Size'].map(v => ({ content: v, hAlign })) details.forEach(v => { - if (v.ext === '文件夹') v.ext = '[Folder]' - if (v.ext === '无扩展名') v.ext = '[NoExt]' + if (v.ext === '資料夾') v.ext = '[Folder]' + if (v.ext === '無副檔名') v.ext = '[NoExt]' }) const records = details.map(v => [v.ext, v.count, v.size]).map(arr => arr.map(content => ({ content, hAlign }))) const total_count = file_count + folder_count @@ -107,8 +107,8 @@ function summary (info, sort_by) { } else { details.sort((a, b) => b.count - a.count) } - if (no_ext) details.push({ ext: '无扩展名', count: no_ext, size: format_size(no_ext_size), raw_size: no_ext_size }) - if (folder_count) details.push({ ext: '文件夹', count: folder_count, size: 0, raw_size: 0 }) + if (no_ext) details.push({ ext: '無副檔名', count: no_ext, size: format_size(no_ext_size), raw_size: no_ext_size }) + if (folder_count) details.push({ ext: '資料夾', count: folder_count, size: 0, raw_size: 0 }) return { file_count, folder_count, total_size, details } }