Skip to content

Commit

Permalink
chore: follow translation keys convention
Browse files Browse the repository at this point in the history
  • Loading branch information
rafgugi committed Apr 15, 2024
1 parent b893182 commit 03d5c68
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/components/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ i18n.use(initReactI18next).init({
dev: {
translation: {
'header.family': '{{name}} Family',
'header.general_family': 'Family Grid'
'header.family_general': 'Family Grid'
},
},
},
Expand Down
18 changes: 9 additions & 9 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function App(props: AppProps) {
onChange={() => setSplitValue(!split)}
/>
<Label for="split-switch" check>
{t('config.split_family')}
{t('config.splitFamily')}
</Label>
</FormGroup>
<FormGroup switch>
Expand All @@ -183,7 +183,7 @@ function App(props: AppProps) {
onChange={() => setHideCode(!hidePersonCode)}
/>
<Label for="hidePersonCode-switch" check>
{t('config.show_code')}
{t('config.showCode')}
</Label>
</FormGroup>
<FormGroup switch>
Expand All @@ -194,7 +194,7 @@ function App(props: AppProps) {
onChange={() => setHideIg(!hidePersonIg)}
/>
<Label for="hidePersonIg-switch" check>
{t('config.show_ig')}
{t('config.showIg')}
</Label>
</FormGroup>
<FormGroup switch className="mb-3">
Expand All @@ -205,25 +205,25 @@ function App(props: AppProps) {
onChange={() => setEditModeValue(!editMode)}
/>
<Label for="editMode-switch" check>
{t('config.edit_mode')}
{t('config.editMode')}
</Label>
</FormGroup>
<FormGroup>
<Button size="sm" onClick={() => openModalAddTree()}>
<i className="bi-person-plus-fill" /> {t('config.add_tree')}
<i className="bi-person-plus-fill" /> {t('config.addTree')}
</Button>{' '}
<Button size="sm" onClick={() => openModalAddChild(trees[0])}>
<i className="bi-person-plus-fill" /> {t('config.add_child')}
<i className="bi-person-plus-fill" /> {t('config.addChild')}
</Button>{' '}
<Button size="sm" onClick={() => openModalAddSpouse(trees[0])}>
<i className="bi-person-plus-fill" /> {t('config.add_spouse')}
<i className="bi-person-plus-fill" /> {t('config.addSpouse')}
</Button>{' '}
<Button
size="sm"
onClick={() => openModalDeletePerson()}
color="danger"
>
<i className="bi-person-dash-fill" /> {t('config.delete_person')}
<i className="bi-person-dash-fill" /> {t('config.deletePerson')}
</Button>
</FormGroup>
<FormGroup>
Expand All @@ -232,7 +232,7 @@ function App(props: AppProps) {
onClick={() => openModalEditYaml()}
color="warning"
>
<i className="bi-filetype-yml" /> {t('config.edit_tree')}
<i className="bi-filetype-yml" /> {t('config.editTree')}
</Button>{' '}
<Button size="sm" tag="label">
<i className="bi-upload" /> {t('config.import')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Family.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function BigFamily({ trees, ...props }: FamilyProps) {
return (
<Fragment>
<hr className="d-print-none" />
<h3 className="text-center">{t('header.general_family')}</h3>
<h3 className="text-center">{t('header.family_general')}</h3>
<FamilyDiagram trees={trees} />
<FamilyGrid {...props} trees={trees} />
</Fragment>
Expand Down
8 changes: 4 additions & 4 deletions src/components/ModalAddChild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ModalAddChild({

setChildError('');
if (Object.keys(treeMap).includes(value)) {
setChildError(t('error.already_taken', { value: value }));
setChildError(t('error.alreadyTaken', { value: value }));
}
};

Expand Down Expand Up @@ -92,7 +92,7 @@ function ModalAddChild({

return (
<Modal isOpen={isOpen} toggle={toggle} unmountOnClose>
<ModalHeader toggle={toggle}>{t('config.label.add_child')}</ModalHeader>
<ModalHeader toggle={toggle}>{t('config.label.addChild')}</ModalHeader>
<ModalBody>
<FormGroup>
<Label for="select-person">{t('config.label.person')}</Label>
Expand All @@ -102,7 +102,7 @@ function ModalAddChild({
value={person ? person.id : ''}
onChange={handlePersonChange}
>
<option value="">{t('config.label.select_person')}</option>
<option value="">{t('config.label.selectPerson')}</option>
{marriedPeople.map(person => (
<option key={person.id} value={person.id}>
{person.id}
Expand All @@ -119,7 +119,7 @@ function ModalAddChild({
value={spouse ? spouse.id : ''}
onChange={handleSpouseChange}
>
<option value="">{t('config.label.select_spouse')}</option>
<option value="">{t('config.label.selectSpouse')}</option>
{person.marriages.map(marriage => (
<option key={marriage.spouse.id} value={marriage.spouse.id}>
{marriage.spouse.id}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ModalAddSpouse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ModalAddSpouse({

setSpouseError('');
if (Object.keys(treeMap).includes(value)) {
setSpouseError(t('error.already_taken', { value: value }));
setSpouseError(t('error.alreadyTaken', { value: value }));
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/ModalAddTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ModalAddTree({ isOpen, toggle }: ModalAddTreeProps) {

setChildError('');
if (Object.keys(treeMap).includes(value)) {
setChildError(t('error.already_taken', { value: value }));
setChildError(t('error.alreadyTaken', { value: value }));
}
};

Expand All @@ -53,7 +53,7 @@ function ModalAddTree({ isOpen, toggle }: ModalAddTreeProps) {

return (
<Modal isOpen={isOpen} toggle={toggle} unmountOnClose>
<ModalHeader toggle={toggle}>{t('config.label.add_tree')}</ModalHeader>
<ModalHeader toggle={toggle}>{t('config.label.addTree')}</ModalHeader>
<ModalBody>
<FormGroup>
<Label for="input-tree">{t('config.label.person')}</Label>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ModalDeletePerson.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ModalDeletePerson({
return (
<Modal isOpen={isOpen} toggle={toggle} unmountOnClose>
<ModalHeader toggle={toggle}>
{t('config.label.delete_person')}
{t('config.label.deletePerson')}
</ModalHeader>
<ModalBody>
<FormGroup>
Expand All @@ -57,7 +57,7 @@ function ModalDeletePerson({
value={person ? person.id : ''}
onChange={handlePersonChange}
>
<option value="">{t('config.label.select_person')}</option>
<option value="">{t('config.label.selectPerson')}</option>
{people.map(person => (
<option key={person.id} value={person.id}>
{person.id}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ModalEditYaml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ function ModalEditYaml({

return (
<Modal size="xl" isOpen={isOpen} toggle={toggle} unmountOnClose>
<ModalHeader toggle={toggle}>{t('config.edit_tree')}</ModalHeader>
<ModalHeader toggle={toggle}>{t('config.editTree')}</ModalHeader>
<ModalBody>
<FormGroup>
<span className="mb-2 d-inline-block">
{t('config.label.tree_preview')}
{t('config.label.treePreview')}
</span>
<Card outline color={validForm ? '' : 'danger'}>
<CardBody style={{ opacity: validForm ? 1 : 0.3 }}>
Expand All @@ -100,7 +100,7 @@ function ModalEditYaml({
</Card>
</FormGroup>
<FormGroup>
<Label for="edit-tree">{t('config.label.edit_tree')}</Label>
<Label for="edit-tree">{t('config.label.editTree')}</Label>
<Input
type="textarea"
id="edit-tree"
Expand Down
40 changes: 20 additions & 20 deletions src/lang-en.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
translation:
config.add_child: Add Child
config.add_spouse: Add Spouse
config.add_tree: Add Family
config.addChild: Add Child
config.addSpouse: Add Spouse
config.addTree: Add Family
config.button.apply: Apply!
config.button.delete: Delete!
config.button.submit: Submit!
config.delete_person: Delete Person
config.edit_mode: Edit Mode
config.edit_tree: Edit Family Tree
config.deletePerson: Delete Person
config.editMode: Edit Mode
config.editTree: Edit Family Tree
config.export: Export
config.import: Import
config.label.add_child: Add a Child
config.label.add_spouse: Add a Spouse
config.label.add_tree: Add a Family
config.label.addChild: Add a Child
config.label.addSpouse: Add a Spouse
config.label.addTree: Add a Family
config.label.child: Child
config.label.delete_person: Delete a Person
config.label.edit_tree: Edit Tree
config.label.deletePerson: Delete a Person
config.label.editTree: Edit Tree
config.label.person: Person
config.label.select_child: Select a Child
config.label.select_person: Select a Person
config.label.select_spouse: Select a Spouse
config.label.selectChild: Select a Child
config.label.selectPerson: Select a Person
config.label.selectSpouse: Select a Spouse
config.label.spouse: Spouse
config.label.tree_preview: Show Family Tree Diagram
config.label.treePreview: Show Family Tree Diagram
config.placeholder.child: Insert the child unique nickname
config.placeholder.person: Insert the person unique nickname
config.placeholder.spouse: Insert the spouse unique nickname
config.show_code: Show Code
config.show_ig: Show Instagram
config.split_family: Split Family
error.already_taken: '{{value}} is already taken'
config.showCode: Show Code
config.showIg: Show Instagram
config.splitFamily: Split Family
error.alreadyTaken: '{{value}} is already taken'
header.family: '{{name}} Family'
header.general_family: Family Grid
header.family_general: Family Grid
table.header.address: Address
table.header.birthdate: Birthdate
table.header.birthplace: Birthplace
Expand Down
40 changes: 20 additions & 20 deletions src/lang-id.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
translation:
config.add_child: Tambah Anak
config.add_spouse: Tambah Pasangan
config.add_tree: Tambah Keluarga
config.addChild: Tambah Anak
config.addSpouse: Tambah Pasangan
config.addTree: Tambah Keluarga
config.button.apply: Terapkan!
config.button.delete: Hapus!
config.button.submit: Terapkan!
config.delete_person: Hapus Orang
config.edit_mode: Mode Edit
config.edit_tree: Edit Pohon Keluarga
config.deletePerson: Hapus Orang
config.editMode: Mode Edit
config.editTree: Edit Pohon Keluarga
config.export: Expor
config.import: Impor
config.label.add_child: Tambah Anak
config.label.add_spouse: Tambah Pasangan
config.label.add_tree: Tambah Keluarga
config.label.addChild: Tambah Anak
config.label.addSpouse: Tambah Pasangan
config.label.addTree: Tambah Keluarga
config.label.child: Anak
config.label.delete_person: Hapus Orang
config.label.edit_tree: Edit Pohon Keluarga
config.label.deletePerson: Hapus Orang
config.label.editTree: Edit Pohon Keluarga
config.label.person: Orang
config.label.select_child: Pilih Anak
config.label.select_person: Pilih Orang
config.label.select_spouse: Pilih Pasangan
config.label.selectChild: Pilih Anak
config.label.selectPerson: Pilih Orang
config.label.selectSpouse: Pilih Pasangan
config.label.spouse: Pasangan
config.label.tree_preview: Tampilan Diagram Pohon Keluarga
config.label.treePreview: Tampilan Diagram Pohon Keluarga
config.placeholder.child: Masukkan nama panggilan anak
config.placeholder.person: Masukkan nama panggilan orang
config.placeholder.spouse: Masukkan nama panggilan pasangan
config.show_code: Tampilkan Kode
config.show_ig: Tampilkan Instagram
config.split_family: Pisah Per Keluarga
error.already_taken: '{{value}} sudah digunakan'
config.showCode: Tampilkan Kode
config.showIg: Tampilkan Instagram
config.splitFamily: Pisah Per Keluarga
error.alreadyTaken: '{{value}} sudah digunakan'
header.family: 'Keluarga {{name}}'
header.general_family: Family Grid
header.family_general: Family Grid
table.header.address: Alamat
table.header.birthdate: Tgl Lahir
table.header.birthplace: Tempat Lahir
Expand Down

0 comments on commit 03d5c68

Please sign in to comment.