feat(localization): Add en/vi language

This commit is contained in:
Tran Anh Tuan
2025-11-20 16:21:17 +07:00
parent dea435a4ec
commit 216e865ca5
37 changed files with 2356 additions and 455 deletions

View File

@@ -12,12 +12,12 @@ export default function useGetGpsModel() {
try {
// Bypass cache để GPS luôn realtime, gọi trực tiếp API
const data = await getGPS();
console.log('GPS fetched from API:', data);
// console.log('GPS fetched from API:', data);
setGpsData(data);
// Luôn emit event GPS để đảm bảo realtime
try {
eventBus.emit('gpsData:update', data);
// eventBus.emit('gpsData:update', data);
} catch (e) {
console.warn('Failed to emit gpsData:update event', e);
}
@@ -31,7 +31,7 @@ export default function useGetGpsModel() {
// ✅ Lắng nghe event cập nhật cache từ nơi khác (nếu có)
useEffect(() => {
const handleUpdate = (data: API.GPSResonse) => {
console.log('GPS cache updated via eventBus');
// console.log('GPS cache updated via eventBus');
setGpsData(data);
};
eventBus.on('gpsData:update', handleUpdate);