Browse Source

feat(utils): new utilization

master
farhantock 8 months ago
parent
commit
5cbbbfbef7
  1. 15
      src/utils/color.js
  2. 2
      src/utils/i18n.js
  3. 123
      src/utils/locales/en.json
  4. 126
      src/utils/locales/id.json

15
src/utils/color.js

@ -0,0 +1,15 @@
export const colors = {
blue: '#3876BF',
semiBlue: '#DCECFF',
beanRed: '#EF6262',
semiRed: '#FFC5C3',
green: '#17C13E',
semigreen: '#E3F8E8',
black: '#333333',
mistBlue: '#667085',
amethystSmoke: '#9A99AB',
mercury: '#E4E4E7',
catskillWhite: '#F2F4F6',
white: '#F9F9F9',
pureWhite: '#fFFFFF',
};

2
src/utils/i18n.js

@ -15,7 +15,6 @@ if (Array.isArray(locales)) {
i18n.fallbacks = true; i18n.fallbacks = true;
// The method we'll use instead of a regular string
export const strings = (name, params = {}) => { export const strings = (name, params = {}) => {
return i18n.t(name, params); return i18n.t(name, params);
} }
@ -26,6 +25,5 @@ const localStr = new LocalizedStrings({
}); });
export const changeLanguage = (languageKey) => { export const changeLanguage = (languageKey) => {
console.log('changeLanguage', languageKey)
localStr.setLanguage(languageKey) localStr.setLanguage(languageKey)
} }

123
src/utils/locales/en.json

@ -1,21 +1,15 @@
{ {
"menu": {
"home": "Home",
"history": "History",
"profile": "Profile"
},
"global": { "global": {
"save": "Save", "save": "Save",
"delete": "Delete", "delete": "Delete",
"edit": "Edit",
"cancel": "Cancel", "cancel": "Cancel",
"signin": "Sign In", "signin": "Sign In",
"logout": "Logout", "logout": "Logout",
"register" : "Register",
"start" : "Start",
"onprogress" : "On Progress",
"yes": "Yes", "yes": "Yes",
"no": "No", "no": "No",
"ok": "Ok", "ok": "Ok",
"see": "Detail",
"completed": "Completed", "completed": "Completed",
"canceled": "Dibatalkan", "canceled": "Dibatalkan",
"notes": "Notes", "notes": "Notes",
@ -23,40 +17,12 @@
"done": "Done", "done": "Done",
"reset": "Reset", "reset": "Reset",
"close": "Close", "close": "Close",
"forgotpin" : "Forgot PIN",
"send": "Send", "send": "Send",
"sending": "Sending", "sending": "Sending",
"errorConnectionMsg": "Failed to connect internet", "errorConnectionMsg": "Failed to connect internet",
"scan" : "Scan",
"reject" : "Reject",
"areYouSure": "Are you sure?", "areYouSure": "Are you sure?",
"noData": "No data found" "noData": "No data found"
}, },
"loginPage": {
"headMessage" : "Welcome back!",
"signInBtn" : "SIGN IN",
"usingQRBtn" : "USING QR INSTEAD",
"registerMessage" : "Don't have an account?",
"register" : "Register",
"usernameErrorMsg" : "Username field must be between 3-30 character",
"passwordErrorMsg" : "PIN is required",
"successLogin" : "You are successfully logged in"
},
"loginQRPage": {
"navbarTitle" : "Driver Login",
"caption" : "Scan QR Code"
},
"shipmentQRPage": {
"navbarTitle" : "Scan Order",
"caption" : "Scan QR Code"
},
"registerPage": {
"navbarTitle" : "Driver Register",
"headMessage" : "Create an account",
"registerBtn" : "REGISTER",
"usernameErrorMsg" : "Username is required",
"passwordErrorMsg" : "PIN is required"
},
"profile": { "profile": {
"profile": "Profile", "profile": "Profile",
"profilePicture": "Profile Picture", "profilePicture": "Profile Picture",
@ -69,7 +35,6 @@
"signoutMessage": "Are you sure?", "signoutMessage": "Are you sure?",
"about": "About", "about": "About",
"languageSetting": "Language Setting" "languageSetting": "Language Setting"
}, },
"login": { "login": {
"welcomeMessage": "Welcome back!", "welcomeMessage": "Welcome back!",
@ -84,50 +49,7 @@
"cannotResetPin": "Cannot reset PIN, username you entered does not match the IMEI number on your cellphone!" "cannotResetPin": "Cannot reset PIN, username you entered does not match the IMEI number on your cellphone!"
}, },
"home": { "home": {
"welcomeMessage" : "Welcome", "welcomeMessage": "Welcome"
"home" : "Home",
"noOrder" : "You don't have a new order",
"getNewOrder" : "You have a new order!",
"scanOrder" : "Scan Order",
"delivorder" : "Delivery Order",
"loadlocation" : "Loading Location",
"cancelShipment" : "Why do you want to cancel this shipment?",
"rejectShipment" : "Why do you want to reject this shipment?",
"startDeliv" : "Start Delivery",
"cancelDeliv" : "Cancel Delivery",
"rejectDeliv" : "Reject Delivery",
"confirm" : "Are you sure?",
"confirmStartDeliv" : "Are you sure want to start this delivery?",
"writeReasonError" : "Note cannot be empty",
"writeReasonPlaceholder": "Write your reason here",
"continueDelivery" : "Continue Delivery",
"continueDeliveryMsg" : "You have an unfinish order, continue to complete it!",
"successStart" : "Successfully start shipment.",
"failedStart" : "Failed to start shipment. Check your internet connectivity and try again later.",
"successCancel" : "Successfully reject shipment.",
"failedCancel" : "Failed to reject shipment. Check your internet connectivity and try again later."
},
"startDeliv": {
"ongoingorder" : "Ongoing Order",
"deliveryorder" : "Delivery Order",
"origin" : "Loading Location",
"destination" : "Destination",
"arrived" : "Arrived",
"shipNumber" : "Shipment Number",
"licensePlate" : "License Plate",
"shipStart" : "Shipment Start",
"shipEnd" : "Shipment End",
"deliveryPictures" : "Delivery Pictures",
"deliveringOrder" : "Delivering Order",
"successArrived" : "Arrived successfully. Please take a proof delivery picture to continue.",
"failedArrived" : "Gagal sampai tujuan. Periksa koneksi internet anda dan ulangi kembali.",
"finishTask" : "Finish Task",
"successContinue" : "Task finished successfully. Continue to next location.",
"successComplete" : "Shipment completed.",
"errorEmptyPhoto" : "Take a proof delivery picture to continue"
},
"photoPreview": {
"navbarTitle" : "Delivery Picture"
}, },
"takePicture": { "takePicture": {
"select": "Select", "select": "Select",
@ -153,37 +75,16 @@
"failedDeletePhoto": "Failed to delete photo." "failedDeletePhoto": "Failed to delete photo."
}, },
"history": { "history": {
"navbarTitle" : "Shipment History", "navbarTitle": "Shipment Presence"
"noTask" : "You haven't completed any task",
"dropPointPictures" : "Drop Point Pictures",
"signaturePicture" : "Signature"
},
"dropPoint": {
"cancelDrop" : "Why do you want to cancel this Drop Point",
"arrivedTime" : "Arrived Time",
"startTime" : "Start Time",
"finishedTime" : "Finished Time",
"exitTime" : "Exit Time",
"reason" : "Reason",
"noDetail" : "No Detail"
},
"signature": {
"navbarTitle" : "Signature",
"newSignature" : "Take a new signature",
"newSignatureAlertMessage": "You will replace this current signature",
"remark" : "Set Remark",
"remarkInstruction" : "Send a feedback about shipment at this location",
"remarkPlaceholder" : "Write your note here",
"noData" : "No signature found",
"uploadSuccess" : "Successfully uploaded signature",
"successSendRemark" : "Successfully send remark"
}, },
"shipmentDigital": { "incidentReport": {
"navbarTitle" : "Shipment Digital" "title": "Incident Report",
"add": "Add Incident Report",
"containedAction": "Add Contained Action"
}, },
"label": { "patrol": {
"shipmentDate" : "Shipment Date", "title": "Patrol",
"shipmentNumber" : "No. Shipment", "add": "Add Patrol Data",
"dropPointLocations" : "Locations" "detail": "Detail Information"
} }
} }

126
src/utils/locales/id.json

@ -1,21 +1,15 @@
{ {
"menu": {
"home": "Beranda",
"history": "Riwayat",
"profile": "Profil"
},
"global": { "global": {
"save": "Simpan", "save": "Simpan",
"delete": "Hapus", "delete": "Hapus",
"edit": "Ubah",
"cancel": "Batal", "cancel": "Batal",
"signin": "Masuk", "signin": "Masuk",
"logout": "keluar", "logout": "keluar",
"register": "Mendaftar",
"start": "Mulai",
"onprogress": "Sedang berjalan",
"yes": "Ya", "yes": "Ya",
"no": "Tidak", "no": "Tidak",
"ok": "Ok", "ok": "Ok",
"see": "Lihat",
"completed": "Selesai", "completed": "Selesai",
"canceled": "Dibatalkan", "canceled": "Dibatalkan",
"notes": "Catatan", "notes": "Catatan",
@ -23,7 +17,6 @@
"done": "Selesai", "done": "Selesai",
"reset": "Atur Ulang", "reset": "Atur Ulang",
"close": "Tutup", "close": "Tutup",
"forgotpin": "Lupa PIN",
"send": "Kirim", "send": "Kirim",
"sending": "Mengirim", "sending": "Mengirim",
"errorConnectionMsg": "Gagal menghubungkan ke internet", "errorConnectionMsg": "Gagal menghubungkan ke internet",
@ -35,28 +28,10 @@
"loginPage": { "loginPage": {
"headMessage": "Selamat datang!", "headMessage": "Selamat datang!",
"signInBtn": "MASUK", "signInBtn": "MASUK",
"usingQRBtn": "MASUK DENGAN QR",
"registerMessage": "Belum memiliki akun?",
"register": "Daftar",
"usernameErrorMsg": "Username harus di antara 3-30 karakter", "usernameErrorMsg": "Username harus di antara 3-30 karakter",
"passwordErrorMsg": "PIN tidak boleh kosong", "passwordErrorMsg": "Password tidak boleh kosong",
"successLogin": "Berhasil login aplikasi" "successLogin": "Berhasil login aplikasi"
}, },
"loginQRPage": {
"navbarTitle": "Masuk Aplikasi",
"caption": "Pindai Kode QR"
},
"shipmentQRPage": {
"navbarTitle": "Memindai Pesanan",
"caption": "Pindai Kode QR"
},
"registerPage": {
"navbarTitle": "Daftar Pengemudi",
"headMessage": "Daftar akun",
"registerBtn": "DAFTAR",
"usernameErrorMsg": "Username tidak boleh kosong",
"passwordErrorMsg": "PIN tidak boleh kosong"
},
"profile": { "profile": {
"profile": "Profil", "profile": "Profil",
"profilePicture": "Foto Profil", "profilePicture": "Foto Profil",
@ -70,63 +45,9 @@
"about": "Tentang", "about": "Tentang",
"languageSetting": "Pengaturan Bahasa" "languageSetting": "Pengaturan Bahasa"
}, },
"login": {
"welcomeMessage": "Selamat datang!",
"scanuserid": "Pindai ID Pengguna",
"userlogin": "Masuk Pengguna",
"userregister": "Daftar Pengguna",
"successRegis": "Berhasil mendaftar, Silahkan masuk.",
"successResetPin": "PIN berhasil di reset, harap cek email atau hubungi Admin Anda!",
"successResetPin2": "Harap cek email Anda atau hubungi Admin Anda untuk konfirmasi!",
"successResetPin3": "Akun Anda berhasil di reset dan di konfirmasi oleh Admin, silakan mendaftar ulang!",
"usernamenotexist": "Username tidak di temukan!",
"cannotResetPin": "Gagal reset PIN, username yang Anda masukkan tidak sama dengan nomor IMEI di HP Anda!"
},
"home": { "home": {
"welcomeMessage": "Selamat datang", "welcomeMessage": "Selamat datang",
"home": "Beranda", "home": "Beranda"
"noOrder": "Anda tidak memiliki pesanan baru",
"getNewOrder": "Anda memiliki pesanan baru!",
"scanOrder": "Pindai Pesanan",
"delivorder": "Mengantar Barang",
"loadlocation": "Lokasi Muat",
"cancelShipment": "Kenapa anda ingin membatalkan pengirimaan ini?",
"rejectShipment": "Kenapa anda ingin menolak pengirimaan ini?",
"startDeliv": "Mulai Pengiriman",
"cancelDeliv": "Batal Pengiriman",
"rejectDeliv": "Tolak Pengiriman",
"confirm": "Apakah anda yakin?",
"confirmStartDeliv": "Apakah anda yakin ingin memulai pengiriman?",
"writeReasonError": "Catatan tidak boleh kosong",
"writeReasonPlaceholder": "Tuliskan alasan anda di sini",
"continueDelivery": "Lanjutkan pengiriman",
"continueDeliveryMsg": "Anda memiliki pesanan yang harus diselesaikan",
"successStart": "Berhasil memulai perjalanan.",
"failedStart": "Gagal memulai perjalanan. Periksa koneksi internet anda dan ulangi kembali.",
"successCancel": "Berhasil menolak pengiriman.",
"failedCancel": "Gagal menolak pengiriman. Periksa koneksi internet anda dan ulangi kembali."
},
"startDeliv": {
"ongoingorder": "Pesanan",
"deliveryorder": "Pesan Antar Barang",
"origin": "Lokasi Muat",
"destination": "Lokasi Bongkar",
"arrived": "Sampai Tujuan",
"shipNumber": "Nomor Pengiriman",
"licensePlate": "Nomor Polisi",
"shipStart": "Mulai Pengiriman",
"shipEnd": "Akhir Pengiriman",
"deliveryPictures": "Bukti Pengiriman",
"deliveringOrder": "Mengantar Pesanan",
"successArrived": "Berhasil sampai tujuan. Ambil foto bukti pengiriman untuk dapat melanjutkan.",
"failedArrived": "Gagal sampai tujuan. Periksa koneksi internet anda dan ulangi kembali.",
"finishTask": "Selesai",
"successContinue": "Berhasil menyelesaikan tugas. Melanjutkan ke lokasi berikutnya.",
"successComplete": "Pengiriman selesai.",
"errorEmptyPhoto": "Ambil foto bukti pengiriman untuk dapat melanjutkan"
},
"photoPreview": {
"navbarTitle": "Foto Bukti Pengiriman"
}, },
"takePicture": { "takePicture": {
"select": "Pilih", "select": "Pilih",
@ -152,37 +73,16 @@
"failedDeletePhoto": "Gagal menghapus foto." "failedDeletePhoto": "Gagal menghapus foto."
}, },
"history": { "history": {
"navbarTitle": "Riwayat Pengiriman", "navbarTitle": "Riwayat Kehadiran"
"noTask": "Anda Belum menyelesaikan task",
"dropPointPictures": "Foto Bukti Pengiriman",
"signaturePicture": "Tanda Tangan"
},
"dropPoint": {
"cancelDrop": "Kenapa anda ingin membatalkan titik bongkar ini",
"arrivedTime": "Waktu Kedatangan",
"startTime": "Waktu Mulai",
"finishedTime": "Waktu Selesai",
"exitTime": "Waktu Keluar",
"reason": "Alasan",
"noDetail": "No Detail"
},
"signature": {
"navbarTitle": "Tanda Tangan",
"newSignature": "Ambil tanda Tangan baru",
"newSignatureAlertMessage": "Anda akan mengubah tanda tangan ini",
"remark": "Beri Catatan",
"remarkInstruction": "Berikan catatan mengenai pengiriman pada lokasi ini",
"remarkPlaceholder": "Tuliskan catatan anda di sini",
"noData": "Tidak ada tanda tangan ditemukan",
"uploadSuccess": "Berhasil mengirim tanda tangan",
"successSendRemark": "Berhasil mengirim catatan"
}, },
"shipmentDigital": { "incidentReport": {
"navbarTitle": "Shipment Digital" "title": "Laporan Kejadian",
"add": "Tambah Laporan",
"containedAction": "Tambah Rencana Pencegahan"
}, },
"label": { "patrol": {
"shipmentDate": "Waktu Pengiriman", "title": "Patroli",
"shipmentNumber": "No. Pengiriman", "add": "Tambah Data Patroli",
"dropPointLocations": "Lokasi" "detail": "Informasi Detail"
} }
} }
Loading…
Cancel
Save