From e13d6a7f4a55c8ffc54698af38ffcca262b0206f Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Sun, 3 Jul 2022 17:14:56 +0300 Subject: [PATCH] Translate table headers --- .drone.yml | 8 ++++---- app/pages/home/Table.js | 15 +++++++++------ app/public/locales/en/home.json | 6 +++++- app/public/locales/ru/home.json | 6 +++++- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.drone.yml b/.drone.yml index 05e71da..1798dd0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -51,11 +51,11 @@ steps: - chmod 400 ~/.ssh/id_rsa - scp -o StrictHostKeyChecking=no -r ./app/.next webmaster@warframe.center:~/warframe-center/app/.next - | - ssh -o StrictHostKeyChecking=no webmaster@warframe.center " - "[ -s ~/.nvm/nvm.sh ] && source ~/.nvm/nvm.sh" - nvm use default + ssh -o StrictHostKeyChecking=no webmaster@warframe.center ' + "[ -s ~/.nvm/nvm.sh ] && source ~/.nvm/nvm.sh" && + nvm use default && pm2 restart warframe-center-app-3000 - " + ' depends_on: - install dependencies diff --git a/app/pages/home/Table.js b/app/pages/home/Table.js index dd1f663..cccfef4 100644 --- a/app/pages/home/Table.js +++ b/app/pages/home/Table.js @@ -1,10 +1,11 @@ import { Component } from 'react' import { DataGrid } from '@mui/x-data-grid' import { Link, Typography, Box } from '@mui/material' +import { withTranslation } from 'react-i18next' import Moment from 'react-moment' -export default class Table extends Component { - constructor ({ scanResults }) { +class Table extends Component { + constructor ({ scanResults, t }) { super() this.scanResults = scanResults.map(row => ({ ...row, @@ -13,7 +14,7 @@ export default class Table extends Component { this.columns = [ { field: 'name', - headerName: 'Name', + headerName: t('name'), flex: 2, renderCell: (cellValues) => { return ( @@ -43,17 +44,17 @@ export default class Table extends Component { }, { field: 'partsPrice', - headerName: 'Parts Price', + headerName: t('parts_price'), flex: 1 }, { field: 'setPrice', - headerName: 'Set Price', + headerName: t('set_price'), flex: 1 }, { field: 'difference', - headerName: 'Difference', + headerName: t('difference'), flex: 1 } ] @@ -91,3 +92,5 @@ export default class Table extends Component { ) } } + +export default withTranslation('home')(Table) diff --git a/app/public/locales/en/home.json b/app/public/locales/en/home.json index c07b2de..1d1b5b3 100644 --- a/app/public/locales/en/home.json +++ b/app/public/locales/en/home.json @@ -1,3 +1,7 @@ { - "description": "Find a profitable difference between the price of the set and the price of the sum of it's parts." + "description": "Find a profitable difference between the price of the set and the price of the sum of it's parts.", + "name": "Name", + "parts_price": "Parts Price", + "set_price": "Set Price", + "difference": "Difference" } \ No newline at end of file diff --git a/app/public/locales/ru/home.json b/app/public/locales/ru/home.json index 6399d05..2b4d39a 100644 --- a/app/public/locales/ru/home.json +++ b/app/public/locales/ru/home.json @@ -1,3 +1,7 @@ { - "description": "Находи выгодную разницу между ценой набора и ценой его частей по отдельности." + "description": "Находи выгодную разницу между ценой набора и ценой его частей по отдельности.", + "name": "Наименование", + "parts_price": "Цена частей", + "set_price": "Цена набора", + "difference": "Разница" } \ No newline at end of file