Skip to content

Commit

Permalink
Merge pull request #235 from srikanth716/injiver-762-car-branding
Browse files Browse the repository at this point in the history
[INJIVER-762] implement multi language support and local changes
  • Loading branch information
sree96 authored Nov 13, 2024
2 parents f5ff659 + 955bf19 commit 375a1f9
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/commons/LanguageSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const LanguageSelector: React.FC = () => {

{isOpen && (
<div
className={`absolute top-8 w-[167px] lg:w-60 z-40 ${
className={`absolute top-10 w-[167px] lg:w-60 z-40 ${
rtl ? "left-1 lg:left-0" : "right-1 lg:right-0"
} mt-3 rounded-md shadow-lg bg-background overflow-hidden font-normal border border-gray-200`}
>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "بليه"
},
"Upload": {
"format": "تنسيقات الملفات المسموح بها: PNG/JPEG/JPG/PDF \n الحد الأدنى للحجم : 10 كيلو بايت | \n الحد الأقصى للحجم : 5 ميجابايت"
"format": "تنسيقات الملفات المسموح بها: PNG/JPEG/JPG/PDF \n حجم الملف - 10 كيلو بايت إلى 5 ميجابايت"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "Allowed file formats: PNG/JPEG/JPG/PDF \nMin Size : 10KB | Max Size : 5MB"
"format": "Allowed file formats: PNG/JPEG/JPG/PDF \n File Size - 10KB to 5MB"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "Formatos de archivo permitidos: PNG/JPEG/JPG/PDF \nTamaño mínimo: 10 KB | Tamaño máximo: 5 MB"
"format": "Formatos de archivo permitidos: PNG/JPEG/JPG/PDF \n Tamaño de archivo: 10 KB a 5 MB"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "Formats de fichiers autorisés : PNG/JPEG/JPG/PDF \n Taille minimale : 10 Ko | \n Taille maximale : 5 Mo"
"format": "Formats de fichiers autorisés : PNG/JPEG/JPG/PDF \n Taille du fichier : 10 Ko à 5 Mo"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "बीएलई"
},
"Upload": {
"format": "अनुमत फ़ाइल प्रारूप: पीएनजी/जेपीईजी/जेपीजी/पीडीएफ \n न्यूनतम आकार: 10KB | \n अधिकतम आकार : 5एमबी"
"format": "अनुमत फ़ाइल प्रारूप: PNG/JPEG/JPG/PDF \n फ़ाइल का आकार - 10KB से 5MB"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "ទម្រង់ឯកសារដែលបានអនុញ្ញាត៖ PNG/JPEG/JPG/PDF \nទំហំអប្បបរមា៖ 10KB | ទំហំអតិបរមា៖ 5MB"
"format": "ទម្រង់ឯកសារដែលបានអនុញ្ញាត៖ PNG/JPEG/JPG/PDF \n ទំហំឯកសារ - 10KB ដល់ 5MB"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "ಅನುಮತಿಸಲಾದ ಫೈಲ್ ಫಾರ್ಮ್ಯಾಟ್‌ಗಳು: PNG/JPEG/JPG/PDF \n ಕನಿಷ್ಠ ಗಾತ್ರ: 10KB | ಗರಿಷ್ಠ ಗಾತ್ರ: 5MB"
"format": "ಅನುಮತಿಸಲಾದ ಫೈಲ್ ಫಾರ್ಮ್ಯಾಟ್‌ಗಳು: PNG/JPEG/JPG/PDF \n ಫೈಲ್ ಗಾತ್ರ - 10KB ನಿಂದ 5MB"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "Formatos de arquivo permitidos: PNG/JPEG/JPG/PDF \n Tamanho mínimo: 10KB | \n Tamanho máximo: 5 MB"
"format": "Formatos de arquivo permitidos: PNG/JPEG/JPG/PDF \n Tamanho do arquivo – 10 KB a 5 MB"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/ta.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ble": "BLE"
},
"Upload": {
"format": "அனுமதிக்கப்பட்ட கோப்பு வடிவங்கள்: PNG/JPEG/JPG/PDF \nகுறைந்தபட்ச அளவு: 10KB | அதிகபட்ச அளவு: 5MB"
"format": "அனுமதிக்கப்பட்ட கோப்பு வடிவங்கள்: PNG/JPEG/JPG/PDF \n கோப்பு அளவு - 10KB முதல் 5MB வரை"
},
"VerificationStepsContent": {
"SCAN": {
Expand Down
26 changes: 15 additions & 11 deletions ui/src/utils/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@ const resources = { en, ta, kn, hi, fr, ar, pt, es, km };
export const LanguagesSupported: LanguageObject[] = [
{ label: "Português", value: "pt" },
{ label: "English", value: "en" },

{ label: "தமிழ்", value: "ta" },
{ label: "ಕನ್ನಡ", value: "kn" },
{ label: "हिंदी", value: "hi" },
{ label: "Français", value: "fr" },
{ label: "عربي", value: "ar" },
{ label: "español", value: "es" },
{ label: "ខ្មែរ", value: "km" },
];

export const defaultLanguage = window._env_.DEFAULT_LANG;

export const selected_language = storage.getItem(storage.SELECTED_LANGUAGE);

i18n
.use(initReactI18next)
.init({
resources,
lng: selected_language ? selected_language : defaultLanguage,
fallbackLng: defaultLanguage,
interpolation: {
escapeValue: false,
},
});
i18n.use(initReactI18next).init({
resources,
lng: selected_language ? selected_language : defaultLanguage,
fallbackLng: defaultLanguage,
interpolation: {
escapeValue: false,
},
});

export const switchLanguage = async (language: string) => {
storage.setItem(storage.SELECTED_LANGUAGE, language);
Expand Down

0 comments on commit 375a1f9

Please sign in to comment.