Browse Source

feat(utilization): new vocab and color

master
farhantock 3 months ago
parent
commit
d8058ecc67
  1. 2
      src/utils/color.js
  2. 19
      src/utils/i18n.js
  3. 38
      src/utils/locales/en.json
  4. 32
      src/utils/locales/id.json

2
src/utils/color.js

@ -14,4 +14,6 @@ export const colors = {
catskillWhite: '#F2F4F6', catskillWhite: '#F2F4F6',
white: '#F9F9F9', white: '#F9F9F9',
pureWhite: '#fFFFFF', pureWhite: '#fFFFFF',
yellow: "#F8DC49",
red: "#AE110C"
}; };

19
src/utils/i18n.js

@ -1,13 +1,14 @@
import { I18n } from "i18n-js"; import { I18n } from "i18n-js";
import * as RNLocalize from "react-native-localize"; import * as RNLocalize from "react-native-localize";
import en from "./locales/en"; import en from "./locales/en";
import id from "./locales/id"; import id from "./locales/id";
import LocalizedStrings from "react-native-localization";
const locales = RNLocalize.getLocales(); const locales = RNLocalize.getLocales();
const i18n = new I18n({ en, id }); const i18n = new I18n({
en,
id,
});
if (Array.isArray(locales)) { if (Array.isArray(locales)) {
i18n.locale = locales[0].languageCode; i18n.locale = locales[0].languageCode;
@ -17,13 +18,9 @@ i18n.fallbacks = true;
export const strings = (name, params = {}) => { export const strings = (name, params = {}) => {
return i18n.t(name, params); return i18n.t(name, params);
} };
const localStr = new LocalizedStrings({
en,
id
});
export const changeLanguage = (languageKey) => { export const changeLanguage = (languageKey) => {
localStr.setLanguage(languageKey) i18n.locale = languageKey;
} console.log("languageKey", languageKey);
};

38
src/utils/locales/en.json

@ -25,13 +25,16 @@
"send": "Send", "send": "Send",
"sending": "Sending", "sending": "Sending",
"errorConnectionMsg": "Failed to connect internet", "errorConnectionMsg": "Failed to connect internet",
"backMessage": "Are you sure you want to back ?",
"areYouSure": "Are you sure?", "areYouSure": "Are you sure?",
"noData": "No data found", "noData": "No data found",
"register": "Register",
"fill": "FILL", "fill": "FILL",
"press": "PRESS", "press": "PRESS",
"search": "Search",
"panicButton": "PANIC BUTTON", "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": "Profile", "profile": "Profile",
@ -44,13 +47,15 @@
"signout": "Sign Out", "signout": "Sign Out",
"signoutMessage": "Are you sure you want to log out of this account?", "signoutMessage": "Are you sure you want to log out of this account?",
"about": "About", "about": "About",
"languageSetting": "Language Setting" "languageSetting": "Language Setting",
"changeTheme": "Theme Setting",
"personnelList": "Personel List"
}, },
"login": { "loginPage": {
"welcomeMessage": "Welcome back!", "headMessage": "Welcome back!",
"scanuserid": "Scan User ID", "signInBtn": "SIGN IN",
"userlogin": "Login User", "passwordErrorMsg": "Pleas fill the password",
"usernamenotexist": "Username does not exist!" "successLogin": "welcome to Neops"
}, },
"home": { "home": {
"welcomeMessage": "Welcome" "welcomeMessage": "Welcome"
@ -81,7 +86,14 @@
"incidentReport": { "incidentReport": {
"title": "Incident Report", "title": "Incident Report",
"add": "Add 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": { "patrol": {
"title": "Patrol", "title": "Patrol",
@ -96,7 +108,13 @@
"failedSendDataPresence": "Failed to send presence data", "failedSendDataPresence": "Failed to send presence data",
"presenceOutMessage": "Thank you for your dedication and work today", "presenceOutMessage": "Thank you for your dedication and work today",
"dataSentSuccessfully": "Presence Data Successfully Saved", "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": { "activity": {
"title": "Report Activity", "title": "Report Activity",

32
src/utils/locales/id.json

@ -24,22 +24,25 @@
"close": "Tutup", "close": "Tutup",
"send": "Kirim", "send": "Kirim",
"sending": "Mengirim", "sending": "Mengirim",
"backMessage": "Apakah anda ingin kembali ?",
"errorConnectionMsg": "Gagal menghubungkan ke internet", "errorConnectionMsg": "Gagal menghubungkan ke internet",
"reject": "Tolak", "reject": "Tolak",
"areYouSure": "Apakah anda yakin?", "areYouSure": "Apakah anda yakin?",
"noData": "Tidak ada data ditemukan", "noData": "Tidak ada data ditemukan",
"register": "Pendaftaran",
"fill": "ISI", "fill": "ISI",
"press": "TEKAN", "press": "TEKAN",
"search": "Cari",
"panicButton": "TOMBOL PANIK", "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": { "loginPage": {
"headMessage": "Selamat datang!", "headMessage": "Selamat datang!",
"signInBtn": "MASUK", "signInBtn": "MASUK",
"usernameErrorMsg": "Username harus di antara 3-30 karakter", "usernameErrorMsg": "Username harus di antara 3-30 karakter",
"passwordErrorMsg": "Password tidak boleh kosong", "passwordErrorMsg": "Password tidak boleh kosong",
"successLogin": "Berhasil login aplikasi" "successLogin": "Selamat Datang di Neops"
}, },
"profile": { "profile": {
"profile": "Profil", "profile": "Profil",
@ -52,7 +55,9 @@
"signout": "Keluar Aplikasi", "signout": "Keluar Aplikasi",
"signoutMessage": "Apakah anda yakin ingin keluar dari akun ini?", "signoutMessage": "Apakah anda yakin ingin keluar dari akun ini?",
"about": "Tentang", "about": "Tentang",
"languageSetting": "Pengaturan Bahasa" "languageSetting": "Pengaturan Bahasa",
"changeTheme": "Ganti Tampilan",
"personnelList": "Daftar Personel"
}, },
"home": { "home": {
"welcomeMessage": "Selamat datang", "welcomeMessage": "Selamat datang",
@ -67,7 +72,13 @@
"failedSendDataPresence": "Gagal mengirim data kehadiran", "failedSendDataPresence": "Gagal mengirim data kehadiran",
"errorFetchingLocation": "Gagal Mendapatkan Titik Lokasi", "errorFetchingLocation": "Gagal Mendapatkan Titik Lokasi",
"dataSentSuccessfully": "Data Presensi Berhasil Disimpan", "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": { "takePicture": {
"select": "Pilih", "select": "Pilih",
@ -95,7 +106,16 @@
"incidentReport": { "incidentReport": {
"title": "Laporan Kejadian", "title": "Laporan Kejadian",
"add": "Tambah Laporan", "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": { "patrol": {
"title": "Patroli", "title": "Patroli",

Loading…
Cancel
Save