Browse Source

feat(utilization): new vocab and color

master
farhantock 2 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',
white: '#F9F9F9',
pureWhite: '#fFFFFF',
yellow: "#F8DC49",
red: "#AE110C"
};

19
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);
};

38
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",

32
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",

Loading…
Cancel
Save