From 4f0a8207b10353f3214b9bc60feb463f35e58ae2 Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Tue, 6 Feb 2024 18:44:32 +0000 Subject: [PATCH] style(settings): use variables for localization --- .../main/settings/sections/Greeting.jsx | 18 ++++++++++-------- .../modals/main/settings/sections/Message.jsx | 19 +++++++++---------- .../modals/main/settings/sections/Stats.jsx | 14 ++++++-------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/components/modals/main/settings/sections/Greeting.jsx index 82f2d2ea..9da277e3 100644 --- a/src/components/modals/main/settings/sections/Greeting.jsx +++ b/src/components/modals/main/settings/sections/Greeting.jsx @@ -24,10 +24,12 @@ export default class GreetingSettings extends PureComponent { }; render() { + const GREETING_SECTION = 'modals.main.settings.sections.greeting'; + return ( <>

- {variables.getMessage('modals.main.settings.sections.greeting.birthday_date')} + {variables.getMessage(`${GREETING_SECTION}.birthday_date`)}

- +
@@ -85,7 +84,7 @@ export default class Message extends PureComponent {
- {variables.getMessage('modals.main.settings.sections.message.title')} + {variables.getMessage(`${MESSAGE_SECTION}.title`)} - {variables.getMessage('modals.main.settings.sections.message.no_messages')} + {variables.getMessage(`${MESSAGE_SECTION}.no_messages`)} - {variables.getMessage('modals.main.settings.sections.message.add_some')} + {variables.getMessage(`${MESSAGE_SECTION}.add_some`)}
diff --git a/src/components/modals/main/settings/sections/Stats.jsx b/src/components/modals/main/settings/sections/Stats.jsx index e22cb6e1..8fcb01d3 100644 --- a/src/components/modals/main/settings/sections/Stats.jsx +++ b/src/components/modals/main/settings/sections/Stats.jsx @@ -107,12 +107,12 @@ export default class Stats extends PureComponent { ); + const STATS_SECTION = 'modals.main.settings.sections.stats'; + return ( <>
- - {variables.getMessage('modals.main.settings.sections.stats.title')} - + {variables.getMessage(`${STATS_SECTION}.title`)}
- - {variables.getMessage('modals.main.settings.sections.stats.achievements')} - + {variables.getMessage(`${STATS_SECTION}.achievements`)}
- {variables.getMessage('modals.main.settings.sections.stats.unlocked', { + {variables.getMessage(`${STATS_SECTION}.unlocked`, { count: this.getUnlockedCount() + '/' + this.state.achievements.length, })}