From 70273798b6fcc65553763ff8065411d3b1fb89e7 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 15 Aug 2021 11:59:30 +0100 Subject: [PATCH] feat(translations): add WIP support for create, fix stats issue --- .../main/marketplace/sections/Create.jsx | 52 ++++++++++--------- .../modals/main/settings/sections/Stats.jsx | 16 +++--- .../modals/main/tabs/backend/Tab.jsx | 2 +- src/translations/de_DE.json | 24 +++++++++ src/translations/en_GB.json | 24 +++++++++ src/translations/en_US.json | 24 +++++++++ src/translations/es.json | 24 +++++++++ src/translations/fr.json | 24 +++++++++ src/translations/nl.json | 24 +++++++++ src/translations/no.json | 24 +++++++++ src/translations/ru.json | 24 +++++++++ src/translations/zh_CN.json | 24 +++++++++ 12 files changed, 253 insertions(+), 33 deletions(-) diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/components/modals/main/marketplace/sections/Create.jsx index 43b9156f..c26f7beb 100644 --- a/src/components/modals/main/marketplace/sections/Create.jsx +++ b/src/components/modals/main/marketplace/sections/Create.jsx @@ -77,22 +77,26 @@ export default class Create extends PureComponent { render() { let tabContent; + const { time } = window.language.modals.main.settings.sections; + const { marketplace, addons } = window.language.modals.main; + const { welcome } = window.language.modals; + const chooseType = ( <> -

Type

+

{time.type}

this.changeTab(2, 'photos')}> - Photo Pack (soon™️) + {marketplace.photo_packs}
this.changeTab(2, 'quotes')}> - Quote Pack (soon™️) + {marketplace.quote_packs}
this.changeTab(2, 'settings')}> - Preset Settings + {marketplace.preset_settings}
@@ -122,22 +126,22 @@ export default class Create extends PureComponent { const writeDescription = ( <> -

Information

-

Name

+

{marketplace.product.information}

+

{addons.create.metadata.name}

setMetadata(e.target.value, 'name')}/> -

Version

+

{marketplace.product.version}

setMetadata(e.target.value, 'version')}/> -

Author

+

{marketplace.product.author}

setMetadata(e.target.value, 'author')}/> -

Icon URL

+

{addons.create.metadata.icon_url}

setMetadata(e.target.value, 'icon_url')}/> -

Screenshot URL

+

{addons.create.metadata.screenshot_url}

setMetadata(e.target.value, 'screenshot_url')}/> -

Description

+

{addons.create.metadata.description}


- - + + ); @@ -146,37 +150,37 @@ export default class Create extends PureComponent { // settings const importSettings = ( <> -

Import Settings

-

this.importSettings()} className='addToMue'>Import current setup

+

{welcome.sections.settings.title}

+

this.importSettings()} className='addToMue'>{addons.create.settings.current}




this.importSettings(JSON.parse(e.target.result))} /> -

document.getElementById('file-input').click()}>Upload JSON

+

document.getElementById('file-input').click()}>{addons.create.settings.json}



- - + + ); // quotes const addQuotes = ( <> -

Add Quotes

+

{addons.create.quotes.title}

); // photos const addPhotos = ( <> -

Add Photos

+

{addons.create.photos.title}

); const downloadAddon = ( <> -

Finish

- +

{addons.create.finish.title}

+

- + ); @@ -191,7 +195,7 @@ export default class Create extends PureComponent { return ( <> -

Create Add-on

+

{addons.create.other_title}

{tabContent} ); diff --git a/src/components/modals/main/settings/sections/Stats.jsx b/src/components/modals/main/settings/sections/Stats.jsx index 0a0711a6..de79a688 100644 --- a/src/components/modals/main/settings/sections/Stats.jsx +++ b/src/components/modals/main/settings/sections/Stats.jsx @@ -29,13 +29,13 @@ export default class Stats extends PureComponent { render() { if (localStorage.getItem('stats') === 'false') { - return ( - <> -

Notice

-

{this.language.warning}

- - - ); + return ( + <> +

{window.language.modals.main.settings.reminder.title}

+

{this.language.warning}

+ + + ); } return ( @@ -49,7 +49,7 @@ export default class Stats extends PureComponent {

{this.language.sections.settings_changed}: {this.state.stats.setting ? Object.keys(this.state.stats.setting).length : 0}

{this.language.sections.addons_installed}: {this.state.stats.marketplace ? this.state.stats.marketplace['install'] : 0}

-

Turning this off will clear your statistics locally, but will not delete the anonymous data posted to umami.

+

{this.language.disable}

); } diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx index b6760761..682bfb85 100644 --- a/src/components/modals/main/tabs/backend/Tab.jsx +++ b/src/components/modals/main/tabs/backend/Tab.jsx @@ -70,7 +70,7 @@ function Tab(props) { // Addons case addons.added: icon = ; break; case addons.sideload: icon = ; break; - case 'Create': icon = ; break; + case addons.create.title: icon = ; break; // Marketplace case marketplace.photo_packs: icon = ; break; diff --git a/src/translations/de_DE.json b/src/translations/de_DE.json index 2eb241fb..39806fc7 100644 --- a/src/translations/de_DE.json +++ b/src/translations/de_DE.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index 20d9c82a..ed3d4027 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/en_US.json b/src/translations/en_US.json index 55aab2cc..7b69c309 100644 --- a/src/translations/en_US.json +++ b/src/translations/en_US.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/es.json b/src/translations/es.json index 7037605d..f74da545 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -386,6 +386,30 @@ "oldest": "Instalado (Antiguos)", "a_z": "Alfabético (A-Z)", "z_a": "Alfabético (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/fr.json b/src/translations/fr.json index 9067d764..6723d8ec 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/nl.json b/src/translations/nl.json index 54540703..d8c20efb 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/no.json b/src/translations/no.json index 0cad4a2b..32539a57 100644 --- a/src/translations/no.json +++ b/src/translations/no.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/ru.json b/src/translations/ru.json index 9377b30b..d1f7b1aa 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } }, diff --git a/src/translations/zh_CN.json b/src/translations/zh_CN.json index 6a768fbb..6b3979f9 100644 --- a/src/translations/zh_CN.json +++ b/src/translations/zh_CN.json @@ -386,6 +386,30 @@ "oldest": "Installed (Oldest)", "a_z": "Alphabetical (A-Z)", "z_a": "Alphabetical (Z-A)" + }, + "create": { + "title": "Create", + "other_title": "Create Add-on", + "metadata": { + "name": "Name", + "icon_url": "Icon URL", + "screenshot_url": "Screenshot URL", + "description": "Description" + }, + "finish": { + "title": "Finish", + "download": "Download Add-on" + }, + "settings": { + "current": "Import current setup", + "json": "Upload JSON" + }, + "photos": { + "title": "Add Photos" + }, + "quotes": { + "title": "Add Quotes" + } } } },