From d8058ecc6735f1acbbf590895d2250798789af3f Mon Sep 17 00:00:00 2001 From: farhantock Date: Wed, 31 Jul 2024 14:28:16 +0700 Subject: [PATCH] feat(utilization): new vocab and color --- src/utils/color.js | 2 ++ src/utils/i18n.js | 19 ++++++++----------- src/utils/locales/en.json | 38 ++++++++++++++++++++++++++++---------- src/utils/locales/id.json | 32 ++++++++++++++++++++++++++------ 4 files changed, 64 insertions(+), 27 deletions(-) diff --git a/src/utils/color.js b/src/utils/color.js index 8eaffb8..c69a4c6 100644 --- a/src/utils/color.js +++ b/src/utils/color.js @@ -14,4 +14,6 @@ export const colors = { catskillWhite: '#F2F4F6', white: '#F9F9F9', pureWhite: '#fFFFFF', + yellow: "#F8DC49", + red: "#AE110C" }; diff --git a/src/utils/i18n.js b/src/utils/i18n.js index a597111..87c5fef 100644 --- a/src/utils/i18n.js +++ b/src/utils/i18n.js @@ -1,13 +1,14 @@ import { I18n } from "i18n-js"; import * as RNLocalize from "react-native-localize"; - import en from "./locales/en"; import id from "./locales/id"; -import LocalizedStrings from "react-native-localization"; const locales = RNLocalize.getLocales(); -const i18n = new I18n({ en, id }); +const i18n = new I18n({ + en, + id, +}); if (Array.isArray(locales)) { i18n.locale = locales[0].languageCode; @@ -17,13 +18,9 @@ i18n.fallbacks = true; export const strings = (name, params = {}) => { return i18n.t(name, params); -} - -const localStr = new LocalizedStrings({ - en, - id -}); +}; export const changeLanguage = (languageKey) => { - localStr.setLanguage(languageKey) -} + i18n.locale = languageKey; + console.log("languageKey", languageKey); +}; diff --git a/src/utils/locales/en.json b/src/utils/locales/en.json index 148d931..17f62c2 100644 --- a/src/utils/locales/en.json +++ b/src/utils/locales/en.json @@ -25,13 +25,16 @@ "send": "Send", "sending": "Sending", "errorConnectionMsg": "Failed to connect internet", + "backMessage": "Are you sure you want to back ?", "areYouSure": "Are you sure?", "noData": "No data found", - "register": "Register", "fill": "FILL", "press": "PRESS", + "search": "Search", "panicButton": "PANIC BUTTON", - "panicButtonMessage": "Press this button in case of an incident" + "panicButtonMessage": "Press this button in case of an incident", + "message": "Data inputted will be lost", + "imageNull": "Image cannot be null" }, "profile": { "profile": "Profile", @@ -44,13 +47,15 @@ "signout": "Sign Out", "signoutMessage": "Are you sure you want to log out of this account?", "about": "About", - "languageSetting": "Language Setting" + "languageSetting": "Language Setting", + "changeTheme": "Theme Setting", + "personnelList": "Personel List" }, - "login": { - "welcomeMessage": "Welcome back!", - "scanuserid": "Scan User ID", - "userlogin": "Login User", - "usernamenotexist": "Username does not exist!" + "loginPage": { + "headMessage": "Welcome back!", + "signInBtn": "SIGN IN", + "passwordErrorMsg": "Pleas fill the password", + "successLogin": "welcome to Neops" }, "home": { "welcomeMessage": "Welcome" @@ -81,7 +86,14 @@ "incidentReport": { "title": "Incident Report", "add": "Add Incident Report", - "containedAction": "Add Contained Action" + "containedAction": "Add Contained Action", + "incidentSelect": "Select Incident", + "achievementSelect": "Select Achievement", + "incidentStep": "Capaian & Kejadian", + "timeStep": "Time", + "locationStep": "Location", + "reportStep": "Reporter", + "chronologyStep": "Chronology" }, "patrol": { "title": "Patrol", @@ -96,7 +108,13 @@ "failedSendDataPresence": "Failed to send presence data", "presenceOutMessage": "Thank you for your dedication and work today", "dataSentSuccessfully": "Presence Data Successfully Saved", - "dataSentOutSuccessfully": "Out attendance data is successfully saved" + "dataSentOutSuccessfully": "Out attendance data is successfully saved", + "attendanceHistory": "Presence History" + }, + "register": { + "title": "Registration", + "dataSentSuccessfully": "Register Data Successfully Saved", + "failedSendData": "Failed to send register data" }, "activity": { "title": "Report Activity", diff --git a/src/utils/locales/id.json b/src/utils/locales/id.json index 72d2b4f..0b4f4b1 100644 --- a/src/utils/locales/id.json +++ b/src/utils/locales/id.json @@ -24,22 +24,25 @@ "close": "Tutup", "send": "Kirim", "sending": "Mengirim", + "backMessage": "Apakah anda ingin kembali ?", "errorConnectionMsg": "Gagal menghubungkan ke internet", "reject": "Tolak", "areYouSure": "Apakah anda yakin?", "noData": "Tidak ada data ditemukan", - "register": "Pendaftaran", "fill": "ISI", "press": "TEKAN", + "search": "Cari", "panicButton": "TOMBOL PANIK", - "panicButtonMessage": "Press this button in case of an incident" + "panicButtonMessage": "Press this button in case of an incident", + "message": "Data yang di input akan hilang", + "imageNull": "Gambar Tidak Boleh Kosong" }, "loginPage": { "headMessage": "Selamat datang!", "signInBtn": "MASUK", "usernameErrorMsg": "Username harus di antara 3-30 karakter", "passwordErrorMsg": "Password tidak boleh kosong", - "successLogin": "Berhasil login aplikasi" + "successLogin": "Selamat Datang di Neops" }, "profile": { "profile": "Profil", @@ -52,7 +55,9 @@ "signout": "Keluar Aplikasi", "signoutMessage": "Apakah anda yakin ingin keluar dari akun ini?", "about": "Tentang", - "languageSetting": "Pengaturan Bahasa" + "languageSetting": "Pengaturan Bahasa", + "changeTheme": "Ganti Tampilan", + "personnelList": "Daftar Personel" }, "home": { "welcomeMessage": "Selamat datang", @@ -67,7 +72,13 @@ "failedSendDataPresence": "Gagal mengirim data kehadiran", "errorFetchingLocation": "Gagal Mendapatkan Titik Lokasi", "dataSentSuccessfully": "Data Presensi Berhasil Disimpan", - "dataSentOutSuccessfully": "Data Presensi Keluar Berhasil Disimpan" + "dataSentOutSuccessfully": "Data Presensi Keluar Berhasil Disimpan", + "attendanceHistory": "Riwayat Kehadiran" + }, + "register": { + "title": "Pendaftaran", + "dataSentSuccessfully": "Data Pendaftaran Berhasil Disimpan", + "failedSendData": "Gagal mengirim data pendaftaran" }, "takePicture": { "select": "Pilih", @@ -95,7 +106,16 @@ "incidentReport": { "title": "Laporan Kejadian", "add": "Tambah Laporan", - "containedAction": "Tambah Rencana Pencegahan" + "containedAction": "Tambah Rencana Pencegahan", + "incidentSelect": "Pilih Kejadian", + "achievementSelect": "Pilih Capaian", + "incident": "Kejadian", + "achievement": "Capaian", + "incidentStep": "Capaian & Kejadian", + "timeStep": "Waktu", + "locationStep": "Lokasi", + "reportStep": "Pelapor", + "chronologyStep": "Kronologis" }, "patrol": { "title": "Patroli",