Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 4fb371f

Browse files
authored
Merge pull request #368 from blueedgetechno/andrewstech-patch-1
Start store translations
2 parents 7d4f447 + 7e2d7c3 commit 4fb371f

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

public/locales/en/translate.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,17 @@
77
"about.alsonot": "This is also not",
88
"about.microsoftcopywrite": "Microsoft, Windows and Other demonstrated Products in this project are trademarks of the Microsoft group of companies",
99
"about.understand": "Ok, I understand",
10-
"about.contact": "contact"
10+
"about.contact": "contact",
11+
"store.featured-app": "Featured Apps",
12+
"store.featured-app.info": "Take your experience to new heights with these must-have apps",
13+
"store.featured-game": "Featured Games",
14+
"store.featured-game.info": "Explore fun to play xbox games and find a new favorite",
15+
"store.featured-film": "Featured Films",
16+
"store.featured-film.info": "Rent or buy the latest hit films and watch them at home or on the go",
17+
"store.free": "FREE",
18+
"store.owned": "Owned",
19+
"store.rent": "Rent",
20+
"store.features": "Features",
21+
"store.ratings": "Ratings and reviews".
22+
"store.description": "Description"
1123
}

src/containers/applications/apps/store.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import './assets/store.scss'
55
import axios from 'axios'
66
import storedata from './assets/store.json'
77
import {installApp} from '../../../actions'
8+
import { useTranslation } from 'react-i18next';
89

910
const geneStar = (item, rv=0)=>{
1011
var url = item.data.url,
@@ -41,6 +42,7 @@ export const MicroStore = ()=>{
4142
const [storeapps, setApps] = useState(storedata)
4243
const [fetchState, setFetch] = useState(0)
4344
const dispatch = useDispatch()
45+
const { t, i18n } = useTranslation()
4446

4547
const clickDispatch = (event)=>{
4648
var action = {
@@ -211,6 +213,7 @@ const DetailPage = ({app})=>{
211213
const stars = geneStar(app)
212214
const reviews = geneStar(app,1)
213215
const dispatch = useDispatch()
216+
const { t, i18n } = useTranslation()
214217

215218
const download = ()=>{
216219
setDown(1)
@@ -278,11 +281,11 @@ const DetailPage = ({app})=>{
278281
</div>
279282
):null}
280283
<div className="briefcont py-2 pb-3">
281-
<div className="text-xs font-semibold">Description</div>
284+
<div className="text-xs font-semibold">{t('store.description')}</div>
282285
<div className="text-xs mt-4"><pre>{app.data.desc}</pre></div>
283286
</div>
284287
<div className="briefcont py-2 pb-3">
285-
<div className="text-xs font-semibold">Ratings and reviews</div>
288+
<div className="text-xs font-semibold">{t('store.ratings')}</div>
286289
<div className="flex mt-4 items-center">
287290
<div className="flex flex-col items-center">
288291
<div className="text-5xl reviewtxt font-bold">{stars}</div>
@@ -307,7 +310,7 @@ const DetailPage = ({app})=>{
307310
</div>
308311
</div>
309312
<div className="briefcont py-2 pb-3">
310-
<div className="text-xs font-semibold">Features</div>
313+
<div className="text-xs font-semibold">{t('store.features')}</div>
311314
<div className="text-xs mt-4"><pre>{app.data.feat}</pre></div>
312315
</div>
313316
</div>
@@ -320,6 +323,7 @@ const FrontPage = (props)=>{
320323
const apprib = useSelector(state => state.globals.apprib)
321324
const gamerib = useSelector(state => state.globals.gamerib)
322325
const movrib = useSelector(state => state.globals.movrib)
326+
const { t, i18n } = useTranslation()
323327

324328
return (
325329
<div className="pagecont w-full absolute top-0">
@@ -343,8 +347,8 @@ const FrontPage = (props)=>{
343347
<div id="apprib" className="frontCont amzApps my-8 py-20 w-auto mx-8 \
344348
flex justify-between noscroll overflow-x-scroll overflow-y-hidden">
345349
<div className="flex w-64 flex-col text-gray-100 h-full px-8">
346-
<div className="text-xl">Featured Apps</div>
347-
<div className="text-xs mt-2">Take your experience to new heights with these must-have apps</div>
350+
<div className="text-xl">{t('store.featured-app')}</div>
351+
<div className="text-xs mt-2">{t('store.featured-app.info')}</div>
348352
</div>
349353
<div className="flex w-max pr-8">
350354
{apprib && apprib.map((x,i)=>{
@@ -362,7 +366,7 @@ const FrontPage = (props)=>{
362366
<Icon className={stars>4?"bluestar":""} fafa="faStar" width={6}/>
363367
<div className="text-xss">{1+x.charCodeAt(3)%5}k</div>
364368
</div>
365-
<div className="text-xss mt-8">{x.charCodeAt(4)%2?"Free":"Owned"}</div>
369+
<div className="text-xss mt-8">{x.charCodeAt(4)%2?"{t('store.free')}":"{t('store.owned')}"}</div>
366370
</div>
367371
)
368372
})}
@@ -372,8 +376,8 @@ const FrontPage = (props)=>{
372376
<div id="gamerib" className="frontCont amzGames my-8 py-20 w-auto mx-8 \
373377
flex justify-between noscroll overflow-x-scroll overflow-y-hidden">
374378
<div className="flex w-64 flex-col text-gray-100 h-full px-8">
375-
<div className="text-xl">Featured Games</div>
376-
<div className="text-xs mt-2">Explore fun to play xbox games and find a new favorite</div>
379+
<div className="text-xl">{t('store.featured-game')}</div>
380+
<div className="text-xs mt-2">{t('store.featured-game.info')}</div>
377381
</div>
378382
<div className="flex w-max pr-8">
379383
{gamerib && gamerib.map((x,i)=>{
@@ -391,7 +395,7 @@ const FrontPage = (props)=>{
391395
<Icon className={stars>4?"bluestar":""} fafa="faStar" width={6}/>
392396
<div className="text-xss">{1+x.charCodeAt(3)%5}k</div>
393397
</div>
394-
<div className="text-xss mt-8">{x.charCodeAt(4)%2?"Free":"Owned"}</div>
398+
<div className="text-xss mt-8">{x.charCodeAt(4)%2?"{t('store.free')}":"{t('store.owned')}"}</div>
395399
</div>
396400
)
397401
})}
@@ -401,8 +405,8 @@ const FrontPage = (props)=>{
401405
<div id="movrib" className="frontCont amzMovies my-8 py-20 w-auto mx-8 \
402406
flex justify-between noscroll overflow-x-scroll overflow-y-hidden">
403407
<div className="flex w-64 flex-col text-gray-100 h-full px-8">
404-
<div className="text-xl">Featured Films</div>
405-
<div className="text-xs mt-2">Rent or buy the latest hit films and watch them at home or on the go</div>
408+
<div className="text-xl">{t('store.featured-film')}</div>
409+
<div className="text-xs mt-2">{t('store.featured-film.info')}</div>
406410
</div>
407411
<div className="flex w-max pr-8">
408412
{movrib && movrib.map((x,i)=>{
@@ -420,7 +424,7 @@ const FrontPage = (props)=>{
420424
<Icon className={stars>4?"bluestar":""} fafa="faStar" width={6}/>
421425
<div className="text-xss">{1+x.charCodeAt(3)%5}k</div>
422426
</div>
423-
<div className="text-xss mt-8">{x.charCodeAt(4)%2?"Rent":"Owned"}</div>
427+
<div className="text-xss mt-8">{x.charCodeAt(4)%2?"{t('store.rent')}":"{t('store.owned')}"}</div>
424428
</div>
425429
)
426430
})}

0 commit comments

Comments
 (0)