Skip to content

Commit

Permalink
Internationalization for Scope management (#362)
Browse files Browse the repository at this point in the history
* Added Kannada language as App language

* Internationalization for Scope management

* Added new app language Telugu

* Fix for not displaying Kannada & Telugu app language

* adding translation for Project Type
  • Loading branch information
vipinpaul authored Sep 17, 2024
1 parent 7745fd3 commit 83ca9ac
Show file tree
Hide file tree
Showing 20 changed files with 744 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const AudioEditor = ({ editor }) => {
}, [bookId, chapter]);
return (
<Editor callFrom="textTranslation" editor={editor}>
{((isLoading || !audioContent) && displyScreen) && <EmptyScreen />}
{((isLoading || !audioContent) && displyScreen) && <EmptyScreen call="audio" />}
{isLoading && !displyScreen && <LoadingScreen /> }
{audioContent && isLoading === false
&& (
Expand Down
21 changes: 19 additions & 2 deletions renderer/src/components/Loading/EmptySrceen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { t } from 'i18next';
import React from 'react';

export default function EmptyScreen() {
export default function EmptyScreen({ call = '' }) {
return (
<div className="h-full w-full items-center justify-center flex">
<div className="container mx-auto px-4">
Expand Down Expand Up @@ -43,7 +43,24 @@ export default function EmptyScreen() {
<g />
</svg>
</div>
<h2 className="mt-8 uppercase text-xl lg:text-5xl font-black">{t('label-no-content-available')}</h2>
{call === 'audio' ? (
<>
<h2 className="mt-8 text-xl lg:text-5xl font-black">
{t('label-scope-not-selected')}
{' '}
</h2>
<a
href="https://scribe-editor-docs.netlify.app/scribe/Manage%20Project/Create%20a%20Project/p2-1-new%20project"
target="_blank"
className="mt-8 text-3xl text-blue-500 underline"
rel="noreferrer"
>
For More Info
</a>
</>

)
: <h2 className="mt-8 uppercase text-xl lg:text-5xl font-black">{t('label-no-content-available')}</h2>}
</div>
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function ProjectMangement(props) {

<div className="flex justify-between items-center bg-secondary">
<div className="uppercase bg-secondary text-white py-2 px-2 text-xs tracking-widest leading-snug rounded-tl text-center flex gap-2">
<span>Scope Management</span>
<span>{t('modal-title-scope-management')}</span>
<span>:</span>
<span>{project?.name}</span>
</div>
Expand Down Expand Up @@ -153,7 +153,7 @@ export default function ProjectMangement(props) {
className=" bg-success w-28 h-8 border-color-success rounded uppercase text-white text-xs shadow focus:outline-none"
onClick={() => handleProject()}
>
Apply
{t('label-apply')}
</button>
</div>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useBibleReference } from 'bible-reference-rcl';
import ScopeHead from './ScopeHead';
import { useTranslation } from 'react-i18next';
import TitleBar from './TitleBar';
import BookButton from '../Common/Button/BookButton';
import BulkSelectionGroup from './BulkSelectionGroup';
Expand All @@ -12,21 +12,21 @@ const initialBook = 'gen';
const initialChapter = '1';
const initialVerse = '1';

const ToggleBookOptions = [
{ key: 'all', name: 'All' },
{ key: 'old', name: 'Old' },
{ key: 'new', name: 'New' },
{ key: 'none', name: 'Deselect' },
];

const ToggleChapterOptions = [
{ key: 'all', name: 'All' },
{ key: 'none', name: 'Deselect' },
];

function ScopeManagement({
metadata, currentScope, setCurrentScope, backendScope,
metadata, currentScope, setCurrentScope, backendScope,
}) {
const { t } = useTranslation();
const ToggleBookOptions = [
{ key: 'all', name: t('btn-all') },
{ key: 'old', name: t('btn-ot') },
{ key: 'new', name: t('btn-nt') },
{ key: 'none', name: t('label-deselect') },
];

const ToggleChapterOptions = [
{ key: 'all', name: t('btn-all') },
{ key: 'none', name: t('label-deselect') },
];
const [bookFilter, setBookFilter] = useState('');
const [chapterFilter, setChapterFilter] = useState('');
const [selectedChaptersSet, setSelectedChaptersSet] = useState(new Set([]));
Expand Down Expand Up @@ -175,9 +175,12 @@ function ScopeManagement({

return (
<div className="w-full h-full pt-5 px-5">
<ScopeHead>Project Scope Management</ScopeHead>
<TitleBar>
<p className="text-gray-900 text-center text-sm">Book Selection</p>
<p className="text-gray-900 text-center text-sm">
{t('label-book-selection')}
{' '}
:
</p>
<BulkSelectionGroup
selectedOption={bookFilter}
handleSelect={handleChangeBookToggle}
Expand Down Expand Up @@ -226,7 +229,11 @@ function ScopeManagement({
&& (
<TitleBar>
<p className="text-gray-900 text-center text-sm flex gap-2">
<span>Chapter Selection :</span>
<span>
{t('label-chapter-selection')}
{' '}
:
</span>
<span className="font-medium">{bookName}</span>
</p>
<BulkSelectionGroup
Expand All @@ -239,7 +246,11 @@ function ScopeManagement({

<form className="w-full my-2 flex gap-3 h-6 text-xxs justify-end" onSubmit={handleChapterRangeSelection}>
<div className="flex gap-1 items-center ">
<label>Start :</label>
<label>
{t('label-start')}
{' '}
:
</label>
<input
type="number"
className="w-12 h-full px-1 text-xs border-gray-400 outline-none rounded-[4px]"
Expand All @@ -250,7 +261,11 @@ function ScopeManagement({
/>
</div>
<div className="flex gap-1 items-center">
<label>End :</label>
<label>
{t('label-end')}
{' '}
:
</label>
<input
type="number"
className="w-12 h-full px-1 text-xs border-gray-400 outline-none rounded-[4px]"
Expand All @@ -262,7 +277,7 @@ function ScopeManagement({
</div>

<Button type="submit">
Select
{t('label-select')}
</Button>
</form>

Expand Down
2 changes: 1 addition & 1 deletion renderer/src/components/Projects/NewProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export default function NewProject({ call, project, closeEdit }) {
: (
<div className="rounded-md border shadow-sm mt-4 ml-5 mr-5 mb-5">
<div className="space-y-2 m-10">
<span className="text-xs font-base mb-2 text-primary leading-4 tracking-wide font-light">Project Type</span>
<span className="text-xs font-base mb-2 text-primary leading-4 tracking-wide font-light">{t('label-project-type')}</span>
{BibleHeaderTagDropDown(headerDropDown, handleDropDown, call)}
</div>
<div className="grid grid-cols-1 lg:grid-cols-3 m-10 gap-5">
Expand Down
2 changes: 1 addition & 1 deletion renderer/src/components/Projects/ProjectRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const ProjectRow = ({
} group rounded-md items-center w-full px-2 py-2 text-sm ${project.isArchived ? 'hidden' : 'flex'}`}
onClick={() => manageProject(project)}
>
Scope Management
{t('modal-title-scope-management')}
</button>
)}
</Menu.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default function AdvancedSettingsDropdown({ call, project, projectType })
const selectCanon = (val) => {
const value = val;
// console.log(val)

if (call === 'edit' && value.title === 'Other') {
if (canonSpecification.title === 'Other') {
value.currentScope = canonSpecification.currentScope;
Expand Down Expand Up @@ -263,7 +263,12 @@ export default function AdvancedSettingsDropdown({ call, project, projectType })
</div>
</div>
{projectType === 'Audio'
&& <span className="text-error">NOTE: Choose the book and chapter from the SCOPE MANAGEMENT option on the project listing page.</span>}
&& (
<span className="text-error">
{'NOTE: '}
{t('label-scope-note-audio')}
</span>
)}
{/* <div className="relative"> */}
<div>
{/* <CustomList
Expand Down
2 changes: 1 addition & 1 deletion renderer/src/layouts/projects/ImportProjectPopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export default function ImportProjectPopUp(props) {
value={sbData.language}
disabled
/>
<h4 className="text-sm font-base mb-2 text-primary tracking-wide leading-4 font-light">{t('label-project-type')}</h4>
<h4 className="text-sm font-base mb-2 text-primary tracking-wide leading-4 font-light">{t('label-type')}</h4>
<input
className="w-full mb-4 bg-gray-200 block rounded shadow-sm sm:text-sm focus:border-primary border-gray-300"
type="text"
Expand Down
2 changes: 2 additions & 0 deletions renderer/src/modules/projects/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const languages = [
{ title: 'Arabic', code: 'ar' },
{ title: 'Spanish', code: 'es' },
{ title: 'Bahasa Indonesia', code: 'id' },
{ title: 'Kannada', code: 'kn' },
{ title: 'Telugu', code: 'te' },
];

function ProgressCircle({ isFilled, count, text }) {
Expand Down
12 changes: 11 additions & 1 deletion renderer/src/translations/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const En = {
'label-search': 'Search',
'label-project': 'Project',
'label-flavor': 'Flavor',
'label-project-type': 'Type',
'label-project-type': 'Project Type',
'label-project-name': 'Project Name',
'label-language': 'Language Name',
'label-language-code': 'Language Code',
Expand Down Expand Up @@ -104,6 +104,9 @@ export const En = {
'label-enter-location': 'Enter location',
'label-editor-load-module': 'Load a Module',
'label-import-door43-resources': 'Import Door43 helps resources',
'label-scope-not-selected': 'To get started, go to Scope Management select the book and chapters and click Apply button',
'label-scope-note-audio': 'Choose the book and chapter from the SCOPE MANAGEMENT option on the project listing page',
'modal-title-scope-management': 'Scope Management',
'tooltip-editor-lock': 'navigation lock/unlock',
'tooltip-editor-bookmark': 'bookmark',
'tooltip-editor-notification': 'notification',
Expand Down Expand Up @@ -281,4 +284,11 @@ export const En = {
'tooltip-supported-resources': 'supported resources are TN, TW, TQ, TA',
'label-upload-help-resources': 'Upload Help Resources',
'label-filter': 'Filter',
'label-book-selection': 'Book Selection',
'label-chapter-selection': 'Chapter Selection',
'label-select': 'Select',
'label-deselect': 'Deselect',
'label-start': 'Start',
'label-end': 'End',
'label-apply': 'Apply',
};
12 changes: 11 additions & 1 deletion renderer/src/translations/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Es = {
'label-search': 'Buscar',
'label-project': 'Proyecto',
'label-flavour': 'Sabor',
'label-project-type': 'Tipo',
'label-project-type': 'Tipo de proyecto',
'label-project-name': 'Nombre del proyecto',
'label-language': 'Nombre del idioma',
'label-language-code': 'Código de idioma',
Expand Down Expand Up @@ -280,4 +280,14 @@ export const Es = {
'msg-helps-filepath': 'Ruta al Recurso de Ayuda con manifest.yaml válido',
'tooltip-supported-resources': 'los recursos soportados son TN, TW, TQ, TA',
'label-upload-help-resources': 'Cargar Recursos de Ayuda',
'label-book-selection': 'Selección de libros',
'label-chapter-selection': 'Selección de capítulos',
'label-select': 'Seleccionar',
'label-deselect': 'Deseleccionar',
'label-start': 'Comenzar',
'label-end': 'Fin',
'label-apply': 'Aplicar',
'label-scope-not-selected': 'Para comenzar, vaya a Gestión de alcance, seleccione el libro y los capítulos y haga clic en el botón Aplicar.',
'label-scope-note-audio': 'Seleccione el libro y el capítulo de la opción GESTIÓN DEL ALCANCE en la página de listado de proyectos',
'modal-title-scope-management': 'Gestión del alcance',
};
12 changes: 11 additions & 1 deletion renderer/src/translations/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Fr = {
'label-search': 'Recherche',
'label-project': 'Projets',
'label-flavor': 'Saveur',
'label-project-type': 'Taper',
'label-project-type': 'Type de projet',
'label-project-name': 'nom du projet',
'label-language': 'Langue',
'label-language-code': 'Language Code',
Expand Down Expand Up @@ -281,4 +281,14 @@ export const Fr = {
'tooltip-supported-resources': 'les ressources prises en charge sont TN, TW, TQ, TA',
'label-upload-help-resources': 'Télécharger des ressources d\'aide',
'label-filter': 'Filtre',
'label-book-selection': 'Sélection de livres',
'label-chapter-selection': 'Sélection de chapitre',
'label-select': 'Sélectionner',
'label-deselect': 'Désélectionner',
'label-start': 'Commencer',
'label-end': 'Fin',
'label-apply': 'Appliquer',
'label-scope-not-selected': 'Pour commencer, accédez à Gestion de la portée, sélectionnez le livre et les chapitres et cliquez sur le bouton Appliquer',
'label-scope-note-audio': 'Choisissez le livre et le chapitre à partir de l\'option GESTION DE LA PORTÉE sur la page de liste des projets',
'modal-title-scope-management': 'Gestion de la portée',
};
16 changes: 13 additions & 3 deletions renderer/src/translations/hi.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Hi = {
'label-search': 'खोजें',
'label-project': 'प्रोजेक्ट',
'label-flavor': 'स्वाद',
'label-project-type': 'प्रकार',
'label-project-type': 'परियोजना प्रकार',
'label-project-name': 'प्रोजेक्ट का नाम',
'label-language': 'भाषा',
'label-language-code': 'भाषा कोड',
Expand Down Expand Up @@ -151,8 +151,8 @@ export const Hi = {
'tooltip-import-resource-info-circle': 'एक निर्देशिका/प्रोजेक्ट का चयन करें जिसमें एक स्क्रिप्चर बरिटो फ़ाइल है यानी मेटाडेटा.json फ़ाइल।',
'tooltip-import-open-file-location': 'फ़ोल्डर का स्थान खोलें',
'dynamic-msg-import-resource-snack': 'संसाधन अपलोड सफल रहा! कृपया संसाधन सूची देखें',
'dynamic-msg-unable-find-buritto-snack': 'बरिटो फ़ाइल को ढूंढने में असमर्थ (मेटाडेटा.json )',
'dynamic-msg-unable-invalid-buritto-snack': 'अमान्य बरिटो फ़ाइल (मेटाडेटा.json) ',
'dynamic-msg-unable-find-buritto-snack': 'बरिटो फ़ाइल को ढूंढने में असमर्थ (metadata.json )',
'dynamic-msg-unable-invalid-buritto-snack': 'अमान्य बरिटो फ़ाइल (metadata.json) ',
'dynamic-msg-confirm-replace-resource': 'इसी नाम से एक मौजूदा प्रोजेक्ट मिला! "संग्रहीत टैब" या "प्रोजेक्ट टैब" जांचें। ओवरलैपिंग पुस्तकों में किसी भी मौजूदा सामग्री को अधिलेखित करने के लिए "बदलें" दबाएँ। प्रोजेक्ट को वर्तमान प्रोजेक्ट के साथ संयोजित करने के लिए "मर्ज" दबाएँ। परिवर्तनों से बचने के लिए "रद्द करें" दबाएँ।',
'dynamic-msg-resource-added': 'संसाधन को सफलतापूर्वक जोड़ा गया है',
'dynamic-msg-resource-unable-fetch-url': 'दिए गए यू आर एल(URL) से चयनित संसाधन लाने में असमर्थ',
Expand Down Expand Up @@ -281,4 +281,14 @@ export const Hi = {
'tooltip-supported-resources': 'समर्थित संसाधन TN, TW, TQ, TA हैं।',
'label-upload-help-resources': 'सहायता संसाधन अपलोड करें',
'label-filter': 'फ़िल्टर',
'label-book-selection': 'पुस्तक चयन',
'label-chapter-selection': 'अध्याय चयन',
'label-select': 'चयन्',
'label-deselect': 'चयन रद्द करें',
'label-start': 'सुरु्',
'label-end': 'अंत',
'label-apply': 'आवेदन करना',
'label-scope-not-selected': 'आरंभ करने के लिए, स्कोप प्रबंधन पर जाएं, पुस्तक और अध्यायों का चयन करें और लागू करें बटन पर क्लिक करें',
'label-scope-note-audio': 'प्रोजेक्ट लिस्टिंग पेज पर SCOPE MANAGEMENT विकल्प से पुस्तक और अध्याय चुनें',
'modal-title-scope-management': 'स्कोप प्रबंधन',
};
8 changes: 8 additions & 0 deletions renderer/src/translations/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { Fr } from './fr';
import { Ne } from './ne';
import { Es } from './es';
import { Id } from './id';
import { Kn } from './kn';
import { Te } from './te';

i18n
.use(initReactI18next)
Expand Down Expand Up @@ -43,6 +45,12 @@ i18n
id: {
translation: Id,
},
kn: {
translation: Kn,
},
te: {
translation: Te,
},
},
});

Expand Down
12 changes: 11 additions & 1 deletion renderer/src/translations/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Id = {
'label-search': 'Cari',
'label-project': 'Proyek',
'label-flavour': 'Flavour',
'label-project-type': 'Tipe',
'label-project-type': 'Jenis Proyek',
'label-project-name': 'Nama Proyek',
'label-language': 'Nama Bahasa',
'label-language-code': 'Kode Bahasa',
Expand Down Expand Up @@ -280,4 +280,14 @@ export const Id = {
'tooltip-supported-resources': 'Sumber Daya Pendukung Lainnya Adalah TN, TW, TQ, TA',
'label-upload-help-resources': 'Unggah Sumber Daya Bantuan',
'label-filter': 'Filter',
'label-book-selection': 'Pemilihan Buku',
'label-chapter-selection': 'Pemilihan Bab',
'label-select': 'Memilih',
'label-deselect': 'Batalkan pilihan',
'label-start': 'Awal',
'label-end': 'Akhir',
'label-apply': 'Menerapkan',
'label-scope-not-selected': 'Untuk memulai, masuk ke Manajemen Lingkup pilih buku dan bab dan klik tombol Terapkan',
'label-scope-note-audio': 'Pilih buku dan bab dari opsi MANAJEMEN RUANG LINGKUP pada halaman daftar proyek',
'modal-title-scope-management': 'Manajemen Ruang Lingkup',
};
Loading

0 comments on commit 83ca9ac

Please sign in to comment.