From 8c6e62e1b49d30da075e4a5275525f7e698f14c9 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Tue, 23 Aug 2022 10:59:20 +0100 Subject: [PATCH 1/4] feat(translations): support for new strings --- .../modals/main/settings/sections/Stats.jsx | 8 ++++- .../modals/welcome/WelcomeSections.jsx | 36 ++++++++++++------- src/translations/de_DE.json | 19 ++++++++-- src/translations/en_GB.json | 19 ++++++++-- src/translations/en_US.json | 19 ++++++++-- src/translations/es.json | 19 ++++++++-- src/translations/fr.json | 19 ++++++++-- src/translations/id_ID.json | 19 ++++++++-- src/translations/nl.json | 19 ++++++++-- src/translations/no.json | 19 ++++++++-- src/translations/ru.json | 19 ++++++++-- src/translations/tr_TR.json | 19 ++++++++-- src/translations/zh_CN.json | 19 ++++++++-- 13 files changed, 218 insertions(+), 35 deletions(-) diff --git a/src/components/modals/main/settings/sections/Stats.jsx b/src/components/modals/main/settings/sections/Stats.jsx index 95d8162f..c91221e9 100644 --- a/src/components/modals/main/settings/sections/Stats.jsx +++ b/src/components/modals/main/settings/sections/Stats.jsx @@ -149,7 +149,13 @@ export default class Stats extends PureComponent {
- {this.getUnlockedCount()}/{this.state.achievements.length} Unlocked + {variables.language.getMessage( + variables.languagecode, + 'modals.main.settings.sections.stats.unlocked', + { + count: this.getUnlockedCount() + '/' + this.state.achievements.length, + }, + )}
{this.state.achievements.map((achievement, index) => { diff --git a/src/components/modals/welcome/WelcomeSections.jsx b/src/components/modals/welcome/WelcomeSections.jsx index ca7376e6..0e4405fc 100644 --- a/src/components/modals/welcome/WelcomeSections.jsx +++ b/src/components/modals/welcome/WelcomeSections.jsx @@ -167,11 +167,15 @@ export default class WelcomeSections extends PureComponent {
- Join our Discord - Talk with the Mue community and developers + + {this.getMessage('modals.welcome.sections.intro.notices.discord_title')} + + + {this.getMessage('modals.welcome.sections.intro.notices.discord_description')} +
- Join + {this.getMessage('modals.welcome.sections.intro.notices.discord_join')}
@@ -179,11 +183,15 @@ export default class WelcomeSections extends PureComponent {
- Contribute on GitHub - Report bugs, add features or donate + + {this.getMessage('modals.welcome.sections.intro.notices.github_title')} + + + {this.getMessage('modals.welcome.sections.intro.notices.github_description')} +
- Open + {this.getMessage('modals.welcome.sections.intro.notices.github_open')} @@ -241,20 +249,25 @@ export default class WelcomeSections extends PureComponent { const style = ( <> - Choose a theme + + {this.getMessage('modals.main.settings.sections.appearance.style.title')} + - Mue currently offers the choice between the legacy styling and the newly released modern - styling. + {this.getMessage('modals.main.settings.sections.appearance.style.description')}
this.changeStyle('legacy')}> - Legacy + + {this.getMessage('modals.main.settings.sections.appearance.style.legacy')} +
this.changeStyle('new')}> - Modern + + {this.getMessage('modals.main.settings.sections.appearance.style.modern')} +
@@ -271,7 +284,6 @@ export default class WelcomeSections extends PureComponent { Date: Tue, 23 Aug 2022 11:05:41 +0100 Subject: [PATCH 2/4] fix: use localised wikipedia for api, remove unused icons --- src/components/modals/main/marketplace/Item.jsx | 3 --- .../modals/main/marketplace/sections/Marketplace.jsx | 1 - src/components/modals/main/tabs/backend/Tab.jsx | 1 - src/components/widgets/quote/Quote.jsx | 4 ++-- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/modals/main/marketplace/Item.jsx b/src/components/modals/main/marketplace/Item.jsx index 4dae4a91..955adfab 100644 --- a/src/components/modals/main/marketplace/Item.jsx +++ b/src/components/modals/main/marketplace/Item.jsx @@ -4,7 +4,6 @@ import Tooltip from '../../../helpers/tooltip/Tooltip'; import ImageCarousel from '../../../helpers/carousel/Carousel'; import { toast } from 'react-toastify'; import { - MdArrowBack, MdIosShare, MdFlag, MdWarning, @@ -13,8 +12,6 @@ import { MdFormatQuote, MdImage, MdTranslate, - MdKeyboardArrowDown, - MdKeyboardArrowUp, MdOutlineKeyboardArrowRight, MdExpandMore, } from 'react-icons/md'; diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/components/modals/main/marketplace/sections/Marketplace.jsx index 132e1a52..051c87bf 100644 --- a/src/components/modals/main/marketplace/sections/Marketplace.jsx +++ b/src/components/modals/main/marketplace/sections/Marketplace.jsx @@ -7,7 +7,6 @@ import { MdOutlineKeyboardArrowRight, MdRefresh, MdOutlineArrowForward, - MdOutlineOpenInNew, } from 'react-icons/md'; import Item from '../Item'; diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx index aa07e7fe..60a8409b 100644 --- a/src/components/modals/main/tabs/backend/Tab.jsx +++ b/src/components/modals/main/tabs/backend/Tab.jsx @@ -22,7 +22,6 @@ import { MdOutlineAssessment as Stats, MdOutlineNewReleases as Changelog, MdInfoOutline as About, - MdEvent as Reminder, MdCode as Sideload, MdAddCircleOutline as Added, MdAddCircleOutline as Create, diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 949d8e22..c39ea1bb 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -115,7 +115,7 @@ export default class Quote extends PureComponent { const authorimgdata = await ( await fetch( - `https://en.wikipedia.org/w/api.php?action=query&titles=${author}&origin=*&prop=pageimages&format=json&pithumbsize=100`, + `https://${variables.languagecode.split('_')[0]}.wikipedia.org/w/api.php?action=query&titles=${author}&origin=*&prop=pageimages&format=json&pithumbsize=100`, ) ).json(); @@ -126,7 +126,7 @@ export default class Quote extends PureComponent { const authorimglicensedata = await ( await fetch( - `https://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:${ + `https://${variables.languagecode.split('_')[0]}.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:${ authorimgdata.query.pages[Object.keys(authorimgdata.query.pages)[0]].pageimage }&origin=*&format=json`, ) From 92ef43bcb69e1d3f52843b686f14f79eae3fd5db Mon Sep 17 00:00:00 2001 From: Alex Sparkes Date: Wed, 24 Aug 2022 19:46:56 +0200 Subject: [PATCH 3/4] Update PhotoInformation.jsx --- .../widgets/background/PhotoInformation.jsx | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index aea608fe..4a6f277f 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -1,5 +1,5 @@ import variables from 'modules/variables'; -import { useState, Fragment } from 'react'; +import { useState } from 'react'; import Favourite from './Favourite'; import { MdInfo, @@ -160,16 +160,13 @@ export default function PhotoInformation({ info, url, api }) { showingPhotoMap = true; return ( - - - location - -
-
+ + location + ); }; @@ -288,20 +285,16 @@ export default function PhotoInformation({ info, url, api }) { )} {info.location && info.location !== 'N/A' ? ( - -
- - {info.location} -
-
+
+ + {info.location} +
) : null} {info.camera && info.camera !== 'N/A' ? ( - -
- - {info.camera} -
-
+
+ + {info.camera} +
) : null}
From 5bf313924ae0fc7cb12c4fffbb3b1e58ec54983a Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Wed, 24 Aug 2022 20:00:10 +0200 Subject: [PATCH 4/4] fix: weather bug --- src/components/widgets/weather/Weather.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/widgets/weather/Weather.jsx b/src/components/widgets/weather/Weather.jsx index 0bef37a0..b6c03085 100644 --- a/src/components/widgets/weather/Weather.jsx +++ b/src/components/widgets/weather/Weather.jsx @@ -149,7 +149,7 @@ export default class Weather extends PureComponent { render() { const weatherType = localStorage.getItem('weatherType'); const enabled = (setting) => { - return (localStorage.getItem(setting) === 'true' && weatherType >= 3) || weatherType == 3; + return (localStorage.getItem(setting) === 'true' && weatherType >= 3) || weatherType === "3"; }; if ( @@ -199,7 +199,7 @@ export default class Weather extends PureComponent { )} )} - {enabled('cloudiness') || weatherType === 3 ? ( + {enabled('cloudiness') ? ( ) : null} - {enabled('windspeed') || weatherType === 3 ? ( + {enabled('windspeed') ? ( ) : null} - {enabled('atmosphericpressure') || weatherType === 3 ? ( + {enabled('atmosphericpressure') ? ( ) : null} - {enabled('weatherdescription') || weatherType === 3 ? ( + {enabled('weatherdescription') ? ( ) : null} - {enabled('visibility') || weatherType === 3 ? ( + {enabled('visibility') ? ( )}
- {weatherType === 3 ? expandedInfo() : null} + {weatherType >= 3 ? expandedInfo() : null} ); }