Spaces:
Runtime error
Runtime error
File size: 7,752 Bytes
0e0cc3e 40fe69e ddec551 238d8e3 ddec551 0e0cc3e 40fe69e 0e0cc3e 40fe69e d600757 06bdaca ebe2f4e 0758854 d16c4ed 0e0cc3e 40fe69e 0e0cc3e 40fe69e bd603dd 2b21a73 0e0cc3e 40fe69e 0e0cc3e e205988 40fe69e ffdf130 6544822 0e0cc3e 40fe69e ddec551 238d8e3 ddec551 0e0cc3e 40fe69e 0e0cc3e 40fe69e d600757 06bdaca ebe2f4e 0758854 d16c4ed 0e0cc3e 40fe69e 0e0cc3e 40fe69e bd603dd 2b21a73 0e0cc3e 40fe69e 0e0cc3e e205988 40fe69e ffdf130 6544822 0e0cc3e | 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 | import type { Lang } from './types'
const messages = {
en: {
title: 'NPI Pipe Count',
subtitle: 'Offline AI pipe counting',
// wizard
captureSubtitle: 'Take a photo or choose from gallery',
previewTitle: 'Configure & Count',
previewBack: 'Back',
cropTitle: 'Select detection area',
cropHint: 'Drag the box or corners to frame the pipe bundle.',
cropContinue: 'Use this area',
cropUseFull: 'Use full image',
countNow: 'Count Pipes',
retake: 'Retake',
countingTitle: 'Counting pipes…',
countingHint: 'Tap anywhere to skip preview animation',
resultsBack: 'New',
tapToSkip: 'Tap to skip animation',
takePhoto: 'Take Photo',
chooseFile: 'Choose Image',
count: 'Count Pipes',
recount: 'Re-count',
newPhoto: 'Choose a different photo',
loadingModel: 'Loading model...',
modelReady: 'Model ready',
modelErrorTitle: 'Could not load the AI model',
retry: 'Retry',
cloudMode: 'Cloud mode',
fallbackServer: 'Switching to server…',
fallbackLocal: 'Switching to this device…',
inferenceMode: 'Counting mode',
inferenceServer: 'Server',
inferenceLocal: 'This device',
inferenceServerHint: 'Recommended — works on all phones',
inferenceLocalHint: 'Offline — needs a capable device',
serverUnavailable: 'Server unavailable',
serverCountFailed: 'Server counting failed. Check your connection and try again.',
serverTimeout: 'Counting took too long. Try cropping a smaller area or enable High accuracy in settings.',
processing: 'Processing...',
pleaseWait: 'This may take a moment on large photos.',
total: 'Total pipes',
groups: 'Diameter groups',
groupCount: 'Number of groups',
auto: 'Auto',
expected: 'Expected',
toolView: 'View',
toolDelete: 'Delete',
toolAdd: 'Add',
toolReassign: 'Re-tag',
toolArea: 'Area',
tools: 'Correction tools',
exportPng: 'Annotated image (PNG)',
exportJson: 'Data (JSON)',
exportCsv: 'Spreadsheet (CSV)',
export: 'Export results',
cancel: 'Cancel',
highAccuracy: 'High accuracy (multi-tile, recommended)',
filterOutliers: 'Filter outliers',
mismatch: 'Mismatch',
selectGroup: 'Tap a group, then use tools to correct detections.',
noImage: 'Capture or upload a photo of a pipe bundle. Works fully offline after first load.',
getStarted: 'Ready to count',
company: 'Nawaplastic Industry Co., Ltd.',
creditFooter: 'Digital Manufacturing · Nawaplastic',
settings: 'Settings',
apply: 'Apply',
updateApp: 'Update app',
updateAppHint: 'Reload the latest version from the server',
debugSection: 'Debug',
showConfidenceLabels: 'Show confidence scores',
showConfidenceLabelsHint: 'Display model confidence in circles instead of count numbers',
},
th: {
title: 'NPI นับท่อ',
subtitle: 'นับท่อออฟไลน์ด้วย AI',
// wizard
captureSubtitle: 'ถ่ายภาพหรือเลือกจากคลัง',
previewTitle: 'ตั้งค่าและนับ',
previewBack: 'ย้อนกลับ',
cropTitle: 'เลือกพื้นที่นับ',
cropHint: 'ลากกรอบหรือมุมเพื่อกำหนดบริเวณมัดท่อ',
cropContinue: 'ใช้พื้นที่นี้',
cropUseFull: 'ใช้รูปเต็ม',
countNow: 'นับท่อ',
retake: 'ถ่ายใหม่',
countingTitle: 'กำลังนับท่อ…',
countingHint: 'แตะเพื่อข้ามการแสดงผล',
resultsBack: 'ใหม่',
tapToSkip: 'แตะเพื่อข้ามแอนิเมชั่น',
takePhoto: 'ถ่ายภาพ',
chooseFile: 'เลือกรูป',
count: 'นับท่อ',
recount: 'นับใหม่',
newPhoto: 'เลือกรูปอื่น',
loadingModel: 'กำลังโหลดโมเดล...',
modelReady: 'โมเดลพร้อมใช้งาน',
modelErrorTitle: 'โหลดโมเดล AI ไม่สำเร็จ',
retry: 'ลองใหม่',
cloudMode: 'โหมดเซิร์ฟเวอร์',
fallbackServer: 'กำลังสลับไปเซิร์ฟเวอร์…',
fallbackLocal: 'กำลังสลับไปอุปกรณ์นี้…',
inferenceMode: 'โหมดการนับ',
inferenceServer: 'เซิร์ฟเวอร์',
inferenceLocal: 'อุปกรณ์นี้',
inferenceServerHint: 'แนะนำ — ใช้ได้ทุกเครื่อง',
inferenceLocalHint: 'ออฟไลน์ — ต้องใช้เครื่องที่รองรับ',
serverUnavailable: 'เซิร์ฟเวอร์ไม่พร้อม',
serverCountFailed: 'นับบนเซิร์ฟเวอร์ไม่สำเร็จ กรุณาตรวจสอบการเชื่อมต่อแล้วลองใหม่',
serverTimeout: 'นับใช้เวลานานเกินไป ลอง crop พื้นที่ให้เล็กลง หรือเปิดความแม่นยำสูงในการตั้งค่า',
processing: 'กำลังประมวลผล...',
pleaseWait: 'รูปขนาดใหญ่อาจใช้เวลาสักครู่',
total: 'จำนวนท่อรวม',
groups: 'กลุ่มเส้นผ่านศูนย์กลาง',
groupCount: 'จำนวนกลุ่ม',
auto: 'อัตโนมัติ',
expected: 'คาดหวัง',
toolView: 'ดู',
toolDelete: 'ลบ',
toolAdd: 'เพิ่ม',
toolReassign: 'เปลี่ยนกลุ่ม',
toolArea: 'เลือกพื้นที่',
tools: 'เครื่องมือแก้ไข',
exportPng: 'รูปพร้อมหมายเลข (PNG)',
exportJson: 'ข้อมูล (JSON)',
exportCsv: 'ตาราง (CSV)',
export: 'ส่งออกผลลัพธ์',
cancel: 'ยกเลิก',
highAccuracy: 'ความแม่นยำสูง (หลายส่วน, แนะนำ)',
filterOutliers: 'กรองค่าผิดปกติ',
mismatch: 'ไม่ตรง',
selectGroup: 'แตะเลือกกลุ่ม แล้วใช้เครื่องมือแก้ไขจุดตรวจจับ',
noImage: 'ถ่ายหรืออัปโหลดรูปมัดท่อ ใช้งานออฟไลน์ได้หลังโหลดครั้งแรก',
getStarted: 'พร้อมนับท่อ',
company: 'บริษัท นวพลาสติก อุตสาหกรรม จำกัด',
creditFooter: 'Digital Manufacturing · Nawaplastic',
settings: 'ตั้งค่า',
apply: 'ใช้',
updateApp: 'อัปเดตแอป',
updateAppHint: 'โหลดเวอร์ชันล่าสุดจากเซิร์ฟเวอร์',
debugSection: 'ดีบัก',
showConfidenceLabels: 'แสดงค่า confidence',
showConfidenceLabelsHint: 'แสดงความมั่นใจของโมเดลในวงกลม แทนหมายเลขนับ',
},
} as const
export function t(lang: Lang, key: keyof (typeof messages)['en']): string {
return messages[lang][key]
}
|