From 01932c1a585307432cb9cb462f70b37e38867ea5 Mon Sep 17 00:00:00 2001 From: andrewstech Date: Tue, 29 Mar 2022 22:30:42 +0100 Subject: [PATCH 1/3] Start store translations --- src/containers/applications/apps/store.js | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/containers/applications/apps/store.js b/src/containers/applications/apps/store.js index f679d72ec..c22006659 100644 --- a/src/containers/applications/apps/store.js +++ b/src/containers/applications/apps/store.js @@ -5,6 +5,7 @@ import './assets/store.scss' import axios from 'axios' import storedata from './assets/store.json' import {installApp} from '../../../actions' +import { useTranslation } from 'react-i18next'; const geneStar = (item, rv=0)=>{ var url = item.data.url, @@ -41,6 +42,7 @@ export const MicroStore = ()=>{ const [storeapps, setApps] = useState(storedata) const [fetchState, setFetch] = useState(0) const dispatch = useDispatch() + const { t, i18n } = useTranslation(); const clickDispatch = (event)=>{ var action = { @@ -278,11 +280,11 @@ const DetailPage = ({app})=>{ ):null}
-
Description
+
{t('store.description')}
{app.data.desc}
-
Ratings and reviews
+
{t('store.ratings')}
{stars}
@@ -307,7 +309,7 @@ const DetailPage = ({app})=>{
-
Features
+
{t('store.features')}
{app.data.feat}
@@ -343,8 +345,8 @@ const FrontPage = (props)=>{
-
Featured Apps
-
Take your experience to new heights with these must-have apps
+
{t('store.featured-app')}
+
{t('store.featured-app.info')}
{apprib && apprib.map((x,i)=>{ @@ -362,7 +364,7 @@ const FrontPage = (props)=>{ 4?"bluestar":""} fafa="faStar" width={6}/>
{1+x.charCodeAt(3)%5}k
-
{x.charCodeAt(4)%2?"Free":"Owned"}
+
{x.charCodeAt(4)%2?"{t('store.free')}":"{t('store.owned')}"}
) })} @@ -372,8 +374,8 @@ const FrontPage = (props)=>{
-
Featured Games
-
Explore fun to play xbox games and find a new favorite
+
{t('store.featured-game')}
+
{t('store.featured-game.info')}
{gamerib && gamerib.map((x,i)=>{ @@ -391,7 +393,7 @@ const FrontPage = (props)=>{ 4?"bluestar":""} fafa="faStar" width={6}/>
{1+x.charCodeAt(3)%5}k
-
{x.charCodeAt(4)%2?"Free":"Owned"}
+
{x.charCodeAt(4)%2?"{t('store.free')}":"{t('store.owned')}"}
) })} @@ -401,8 +403,8 @@ const FrontPage = (props)=>{
-
Featured Films
-
Rent or buy the latest hit films and watch them at home or on the go
+
{t('store.featured-film')}
+
{t('store.featured-film.info')}
{movrib && movrib.map((x,i)=>{ @@ -420,7 +422,7 @@ const FrontPage = (props)=>{ 4?"bluestar":""} fafa="faStar" width={6}/>
{1+x.charCodeAt(3)%5}k
-
{x.charCodeAt(4)%2?"Rent":"Owned"}
+
{x.charCodeAt(4)%2?"{t('store.rent')}":"{t('store.owned')}"}
) })} From 7a8f7b082a28fe4759fa222532bfe38c4dc2d729 Mon Sep 17 00:00:00 2001 From: andrewstech Date: Tue, 29 Mar 2022 22:37:31 +0100 Subject: [PATCH 2/3] Update store.js --- src/containers/applications/apps/store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/containers/applications/apps/store.js b/src/containers/applications/apps/store.js index c22006659..2cc5b949e 100644 --- a/src/containers/applications/apps/store.js +++ b/src/containers/applications/apps/store.js @@ -42,7 +42,7 @@ export const MicroStore = ()=>{ const [storeapps, setApps] = useState(storedata) const [fetchState, setFetch] = useState(0) const dispatch = useDispatch() - const { t, i18n } = useTranslation(); + const { t, i18n } = useTranslation() const clickDispatch = (event)=>{ var action = { @@ -213,6 +213,7 @@ const DetailPage = ({app})=>{ const stars = geneStar(app) const reviews = geneStar(app,1) const dispatch = useDispatch() + const { t, i18n } = useTranslation() const download = ()=>{ setDown(1) @@ -322,6 +323,7 @@ const FrontPage = (props)=>{ const apprib = useSelector(state => state.globals.apprib) const gamerib = useSelector(state => state.globals.gamerib) const movrib = useSelector(state => state.globals.movrib) + const { t, i18n } = useTranslation() return (
From 7e2d7c3e08161bfb9b311f56dd5ed4e6989cda2e Mon Sep 17 00:00:00 2001 From: andrewstech Date: Tue, 29 Mar 2022 23:03:16 +0100 Subject: [PATCH 3/3] Add English translations --- public/locales/en/translate.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/public/locales/en/translate.json b/public/locales/en/translate.json index 686abc087..e8540e765 100644 --- a/public/locales/en/translate.json +++ b/public/locales/en/translate.json @@ -7,5 +7,17 @@ "about.alsonot": "This is also not", "about.microsoftcopywrite": "Microsoft, Windows and Other demonstrated Products in this project are trademarks of the Microsoft group of companies", "about.understand": "Ok, I understand", - "about.contact": "contact" + "about.contact": "contact", + "store.featured-app": "Featured Apps", + "store.featured-app.info": "Take your experience to new heights with these must-have apps", + "store.featured-game": "Featured Games", + "store.featured-game.info": "Explore fun to play xbox games and find a new favorite", + "store.featured-film": "Featured Films", + "store.featured-film.info": "Rent or buy the latest hit films and watch them at home or on the go", + "store.free": "FREE", + "store.owned": "Owned", + "store.rent": "Rent", + "store.features": "Features", + "store.ratings": "Ratings and reviews". + "store.description": "Description" }