Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finwise-miniapp-fe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ThinhNC
finwise-miniapp-fe
Commits
150d32cb
Commit
150d32cb
authored
Oct 07, 2026
by
ThinhNC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ocr): localize OCR receipt extraction warnings for Vietnamese and English
parent
57d7b4b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
en.json
src/i18n/locales/en.json
+1
-0
vi.json
src/i18n/locales/vi.json
+1
-0
guest-mock.ts
src/lib/guest-mock.ts
+1
-0
ReceiptScannerView.tsx
src/pages/ai-assistant/components/ReceiptScannerView.tsx
+18
-2
No files found.
src/i18n/locales/en.json
View file @
150d32cb
...
@@ -1537,6 +1537,7 @@
...
@@ -1537,6 +1537,7 @@
"previewAlt"
:
"Receipt preview"
,
"previewAlt"
:
"Receipt preview"
,
"itemCount"
:
"{{count}} items"
,
"itemCount"
:
"{{count}} items"
,
"warnings"
:
"AI Warnings"
,
"warnings"
:
"AI Warnings"
,
"defaultWarning"
:
"Please verify extracted values against the original receipt before creating a transaction."
,
"confirmTransaction"
:
"Confirm Create Transaction"
,
"confirmTransaction"
:
"Confirm Create Transaction"
,
"confirmHint"
:
"Pre-fill this extracted receipt data into a new Transaction"
,
"confirmHint"
:
"Pre-fill this extracted receipt data into a new Transaction"
,
"reScan"
:
"Scan Another Receipt"
"reScan"
:
"Scan Another Receipt"
...
...
src/i18n/locales/vi.json
View file @
150d32cb
...
@@ -1638,6 +1638,7 @@
...
@@ -1638,6 +1638,7 @@
"previewAlt"
:
"Bản xem trước hóa đơn"
,
"previewAlt"
:
"Bản xem trước hóa đơn"
,
"itemCount"
:
"{{count}} món"
,
"itemCount"
:
"{{count}} món"
,
"warnings"
:
"Cảnh báo từ AI"
,
"warnings"
:
"Cảnh báo từ AI"
,
"defaultWarning"
:
"Vui lòng đối chiếu các giá trị đã trích xuất với hóa đơn gốc trước khi tạo giao dịch."
,
"confirmTransaction"
:
"Xác nhận tạo Giao dịch"
,
"confirmTransaction"
:
"Xác nhận tạo Giao dịch"
,
"confirmHint"
:
"Tự động điền dữ liệu hóa đơn này vào Form tạo giao dịch mới"
,
"confirmHint"
:
"Tự động điền dữ liệu hóa đơn này vào Form tạo giao dịch mới"
,
"reScan"
:
"Quét hóa đơn khác"
"reScan"
:
"Quét hóa đơn khác"
...
...
src/lib/guest-mock.ts
View file @
150d32cb
...
@@ -1549,6 +1549,7 @@ export function handleGuestRequest(config: InternalAxiosRequestConfig): AxiosRes
...
@@ -1549,6 +1549,7 @@ export function handleGuestRequest(config: InternalAxiosRequestConfig): AxiosRes
rawText
:
`SIEU THI CO.OPMART\nNgay:
${
todayStr
}
\n1. Sua chua hoa qua: 70.000\n2. Banh mi sandwich: 45.000\n3. Nuoc ep cam: 110.000\n4. Khan giay: 25.000\nTong tien: 250.000 VND\nVAT 8%: 20.000 VND`
,
rawText
:
`SIEU THI CO.OPMART\nNgay:
${
todayStr
}
\n1. Sua chua hoa qua: 70.000\n2. Banh mi sandwich: 45.000\n3. Nuoc ep cam: 110.000\n4. Khan giay: 25.000\nTong tien: 250.000 VND\nVAT 8%: 20.000 VND`
,
confidence
:
0.96
,
confidence
:
0.96
,
warnings
:
[
warnings
:
[
"Vui lòng đối chiếu các giá trị đã trích xuất với hóa đơn gốc trước khi tạo giao dịch."
,
"Hóa đơn mẫu mô phỏng trong Chế độ Dùng thử (100% xử lý tại máy, không tốn token AI thật)."
,
"Hóa đơn mẫu mô phỏng trong Chế độ Dùng thử (100% xử lý tại máy, không tốn token AI thật)."
,
],
],
},
},
...
...
src/pages/ai-assistant/components/ReceiptScannerView.tsx
View file @
150d32cb
...
@@ -61,7 +61,13 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
...
@@ -61,7 +61,13 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
// Auto trigger extraction
// Auto trigger extraction
extractMutation
.
mutate
(
extractMutation
.
mutate
(
{
file
},
{
file
,
hints
:
{
languageHint
:
intlLocale
===
"vi"
?
"vi"
:
"en"
,
currencyHint
:
"VND"
,
},
},
{
{
onSuccess
:
(
res
)
=>
{
onSuccess
:
(
res
)
=>
{
if
(
res
.
success
&&
res
.
data
)
{
if
(
res
.
success
&&
res
.
data
)
{
...
@@ -165,6 +171,16 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
...
@@ -165,6 +171,16 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
})
})
:
"—"
;
:
"—"
;
const
localizeWarning
=
(
warn
:
string
):
string
=>
{
const
trimmed
=
warn
.
trim
();
const
standardEn
=
"please verify extracted values against the original receipt before creating a transaction."
;
const
standardVi
=
"vui lòng đối chiếu các giá trị đã trích xuất với hóa đơn gốc trước khi tạo giao dịch."
;
if
(
trimmed
.
toLowerCase
()
===
standardEn
||
trimmed
.
toLowerCase
()
===
standardVi
)
{
return
t
(
"ai.ocr.defaultWarning"
);
}
return
trimmed
;
};
return
(
return
(
<
div
className=
"flex flex-col gap-5 px-2 pb-4 pt-2"
>
<
div
className=
"flex flex-col gap-5 px-2 pb-4 pt-2"
>
<
section
className=
"text-center"
>
<
section
className=
"text-center"
>
...
@@ -391,7 +407,7 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
...
@@ -391,7 +407,7 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
{
t
(
"ai.ocr.warnings"
)
}
:
{
t
(
"ai.ocr.warnings"
)
}
:
</
span
>
</
span
>
{
extractedData
.
warnings
.
map
((
warn
,
i
)
=>
(
{
extractedData
.
warnings
.
map
((
warn
,
i
)
=>
(
<
p
key=
{
i
}
>
•
{
warn
}
</
p
>
<
p
key=
{
i
}
>
•
{
localizeWarning
(
warn
)
}
</
p
>
))
}
))
}
</
div
>
</
div
>
)
}
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment