From 9528e72d8f4c240ec557def494103ef0e56be703 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 24 Nov 2024 02:35:45 +0100 Subject: [PATCH 01/12] Added translation dependencies Attemting to resolve this mess --- package.json | 2 + yarn.lock | 227 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 159 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 60d0639c..bc608730 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,8 @@ "mathjax-full": "^3.2.2", "mathjax-react": "^2.0.1", "next": "15.0.3", + "ra-i18n-polyglot": "^5.4.0", + "ra-language-slovak": "^3.6.2", "react": "19.0.0-rc-66855b96-20241106", "react-admin": "^5.4.0", "react-cookie": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index b9b73e63..97c8859b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2900,6 +2900,7 @@ __metadata: languageName: node linkType: hard +"@tanstack/react-query@npm:5.61.0, @tanstack/react-query@npm:^5.21.7": "@tanstack/react-query@npm:5.61.0, @tanstack/react-query@npm:^5.21.7": version: 5.61.0 resolution: "@tanstack/react-query@npm:5.61.0" @@ -4607,10 +4608,19 @@ __metadata: languageName: node linkType: hard +"date-fns@npm:^2.19.0": + version: 2.30.0 + resolution: "date-fns@npm:2.30.0" + dependencies: + "@babel/runtime": ^7.21.0 + checksum: f7be01523282e9bb06c0cd2693d34f245247a29098527d4420628966a2d9aad154bd0e90a6b1cf66d37adcb769cd108cf8a7bd49d76db0fb119af5cdd13644f4 + languageName: node + linkType: hard + "date-fns@npm:^3.6.0": version: 3.6.0 resolution: "date-fns@npm:3.6.0" - checksum: 10/cac35c58926a3b5d577082ff2b253612ec1c79eb6754fddef46b6a8e826501ea2cb346ecbd211205f1ba382ddd1f9d8c3f00bf433ad63cc3063454d294e3a6b8 + checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 languageName: node linkType: hard @@ -6002,10 +6012,17 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^4.0.7": + version: 4.0.7 + resolution: "eventemitter3@npm:4.0.7" + checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 + languageName: node + linkType: hard + "eventemitter3@npm:^5.0.1": version: 5.0.1 resolution: "eventemitter3@npm:5.0.1" - checksum: 10/ac6423ec31124629c84c7077eed1e6987f6d66c31cf43c6fcbf6c87791d56317ce808d9ead483652436df171b526fc7220eccdc9f3225df334e81582c3cf7dd5 + checksum: 543d6c858ab699303c3c32e0f0f47fc64d360bf73c3daf0ac0b5079710e340d6fe9f15487f94e66c629f5f82cd1a8678d692f3dbb6f6fcd1190e1b97fcad36f8 languageName: node linkType: hard @@ -6978,7 +6995,14 @@ __metadata: "inflection@npm:^3.0.0": version: 3.0.0 resolution: "inflection@npm:3.0.0" - checksum: 10/e8aae6abb872a8aa19184a1b84470fff7120806329c78011befcf50bce04a7b0d65012ac373f2cc5caeaaf241874c7ae20a26038ff7dbe0cdae0b863f25b5e02 + checksum: 6a3b21cb011a9bca1c045ef92d199c927cfd8c4b97809152fabc9c325d36789a7499397b50d46157d080efd19843807ac73e38a2fe79d8f2cf291323998fb5b5 + languageName: node + linkType: hard + +"inflection@npm:~1.12.0": + version: 1.12.0 + resolution: "inflection@npm:1.12.0" + checksum: c640917b7c1ef2151df8eed5e7bc1ea6f6dd7b924e86f1add0bf801db55be8b581eb2d3d767a29e439153e4c06b00679a45853ac58c498ea519c4b4bdcd2a775 languageName: node linkType: hard @@ -9631,7 +9655,7 @@ __metadata: languageName: node linkType: hard -"query-string@npm:^7.1.3": +"query-string@npm:^7.1.1, query-string@npm:^7.1.3": version: 7.1.3 resolution: "query-string@npm:7.1.3" dependencies: @@ -9667,9 +9691,33 @@ __metadata: languageName: node linkType: hard -"ra-i18n-polyglot@npm:^5.4.0": +"ra-core@npm:^5.4.0": version: 5.4.0 - resolution: "ra-i18n-polyglot@npm:5.4.0" + resolution: "ra-core@npm:5.4.0" + dependencies: + "@tanstack/react-query": ^5.21.7 + clsx: ^2.1.1 + date-fns: ^3.6.0 + eventemitter3: ^5.0.1 + inflection: ^3.0.0 + jsonexport: ^3.2.0 + lodash: ~4.17.5 + query-string: ^7.1.3 + react-error-boundary: ^4.0.13 + react-is: ^18.2.0 + peerDependencies: + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + react-hook-form: ^7.53.0 + react-router: ^6.22.0 + react-router-dom: ^6.22.0 + checksum: 44554074e5fc180908bd1f444a7d073329042e4c55203ef89f8d3c6c83f13695553b6dd7c89dd6b52016d3adb355887b9d2cd1e12e32fd252341b0e1cb37b9d9 + languageName: node + linkType: hard + +"ra-i18n-polyglot@npm:^4.16.20": + version: 4.16.20 + resolution: "ra-i18n-polyglot@npm:4.16.20" dependencies: node-polyglot: "npm:^2.2.2" ra-core: "npm:^5.4.0" @@ -9677,18 +9725,35 @@ __metadata: languageName: node linkType: hard -"ra-language-english@npm:^5.4.0": +"ra-i18n-polyglot@npm:^5.4.0": version: 5.4.0 - resolution: "ra-language-english@npm:5.4.0" + resolution: "ra-i18n-polyglot@npm:5.4.0" + dependencies: + node-polyglot: ^2.2.2 + ra-core: ^5.4.0 + checksum: 3b277728dce714a80552a459befb37c57df12dccce881e5b198d903e4cbd026decf0e5ed69e21a678ab526b0bcfe970ed410abf53dba30a549b6192455e976ba + languageName: node + linkType: hard + +"ra-language-english@npm:^4.16.20": + version: 4.16.20 + resolution: "ra-language-english@npm:4.16.20" dependencies: ra-core: "npm:^5.4.0" checksum: 10/0c6d885b05f257f2d3a842c2fdf2175c6353e0672d307d7dc0becaaee7827d777eea5ea5948d3b4c8f77facaa0b2ff6f4f2b948833926181c74f3c578b68e714 languageName: node linkType: hard -"ra-ui-materialui@npm:^5.4.0": - version: 5.4.0 - resolution: "ra-ui-materialui@npm:5.4.0" +"ra-language-slovak@npm:^3.6.2": + version: 3.6.2 + resolution: "ra-language-slovak@npm:3.6.2" + checksum: 4f16c11a9268b856b58f68aee8c08b3ad165fbe6bd9914de777b3212cd14a9a42d970fd0da72111cc3ae6e41136a8a327ca171ab573b7e66a152d9228984c70c + languageName: node + linkType: hard + +"ra-ui-materialui@npm:^4.16.20": + version: 4.16.20 + resolution: "ra-ui-materialui@npm:4.16.20" dependencies: "@tanstack/react-query": "npm:^5.21.7" autosuggest-highlight: "npm:^3.1.1" @@ -9787,7 +9852,27 @@ __metadata: languageName: node linkType: hard -"react-hook-form@npm:^7.53.0, react-hook-form@npm:^7.53.2": +"react-error-boundary@npm:^4.0.13": + version: 4.1.2 + resolution: "react-error-boundary@npm:4.1.2" + dependencies: + "@babel/runtime": ^7.12.5 + peerDependencies: + react: ">=16.13.1" + checksum: afe692f1bbbfb5998b49e1001d7682a3cbfdc623dca1318b408e738606f3450d925c28fbbfa5dc84d2cf285d17c2e7f079d59386a27da354dea9c902a935149b + languageName: node + linkType: hard + +"react-hook-form@npm:^7.43.9": + version: 7.43.9 + resolution: "react-hook-form@npm:7.43.9" + peerDependencies: + react: ^16.8.0 || ^17 || ^18 + checksum: 65b94de625f2b7921c4e856bf0abbe142bfe06c052217bd1bcc3a842e2cc37fa3a3e03758119dc038bbcf5edb49e02c29206528b80b201f9a4d601471ef78153 + languageName: node + linkType: hard + +"react-hook-form@npm:^7.53.2": version: 7.53.2 resolution: "react-hook-form@npm:7.53.2" peerDependencies: @@ -11759,64 +11844,66 @@ __metadata: version: 0.0.0-use.local resolution: "webstrom-frontend@workspace:." dependencies: - "@emotion/react": "npm:^11.13.5" - "@emotion/styled": "npm:^11.13.5" - "@mui/icons-material": "npm:^5.16.7" - "@mui/material": "npm:^5.16.7" - "@svgr/webpack": "npm:^8.1.0" - "@tanstack/react-query": "npm:5.61.0" - "@tanstack/react-query-devtools": "npm:5.61.0" - "@testing-library/dom": "npm:^9.3.4" - "@testing-library/jest-dom": "npm:^5.17.0" - "@testing-library/react": "npm:^14.3.1" - "@testing-library/user-event": "npm:^14.5.2" - "@types/jest": "npm:^29.5.14" - "@types/katex": "npm:^0.16.7" - "@types/luxon": "npm:^3.4.2" - "@types/node": "npm:^20.17.7" - "@types/react": "npm:^19.0.0-rc.1" - "@types/react-dom": "npm:^19.0.0-rc.1" - "@types/react-router-dom": "npm:^5.3.3" - "@typescript-eslint/eslint-plugin": "npm:^8.15.0" - "@typescript-eslint/parser": "npm:^8.15.0" - axios: "npm:^1.7.7" - clsx: "npm:^2.1.1" - confusing-browser-globals: "npm:^1.0.11" - eslint: "npm:^8.57.1" - eslint-config-next: "npm:15.0.3" - eslint-config-prettier: "npm:^9.1.0" - eslint-plugin-eslint-comments: "npm:^3.2.0" - eslint-plugin-filenames: "npm:^1.3.2" - eslint-plugin-import: "npm:^2.31.0" - eslint-plugin-jest: "npm:^28.9.0" - eslint-plugin-no-secrets: "npm:^1.1.2" - eslint-plugin-node: "npm:^11.1.0" - eslint-plugin-prettier: "npm:^5.2.1" - eslint-plugin-promise: "npm:^7.1.0" - eslint-plugin-security: "npm:^3.0.1" - eslint-plugin-simple-import-sort: "npm:^12.1.1" - eslint-plugin-unicorn: "npm:^56.0.1" - katex: "npm:^0.16.11" - luxon: "npm:^3.5.0" - mathjax-full: "npm:^3.2.2" - mathjax-react: "npm:^2.0.1" - next: "npm:15.0.3" - prettier: "npm:^3.3.3" - react: "npm:19.0.0-rc-66855b96-20241106" - react-admin: "npm:^5.4.0" - react-cookie: "npm:^4.1.1" - react-dom: "npm:19.0.0-rc-66855b96-20241106" - react-dropzone: "npm:^14.3.5" - react-hook-form: "npm:^7.53.2" - react-markdown: "npm:^9.0.1" - rehype-katex: "npm:^7.0.1" - remark-gfm: "npm:^4.0.0" - remark-math: "npm:^6.0.0" - sass: "npm:^1.81.0" - typed-scss-modules: "npm:^8.0.1" - typescript: "npm:^5.7.2" - unstated-next: "npm:^1.1.0" - usehooks-ts: "npm:^3.1.0" + "@emotion/react": ^11.13.5 + "@emotion/styled": ^11.13.5 + "@mui/icons-material": ^5.16.7 + "@mui/material": ^5.16.7 + "@svgr/webpack": ^8.1.0 + "@tanstack/react-query": 5.61.0 + "@tanstack/react-query-devtools": 5.61.0 + "@testing-library/dom": ^9.3.4 + "@testing-library/jest-dom": ^5.17.0 + "@testing-library/react": ^14.3.1 + "@testing-library/user-event": ^14.5.2 + "@types/jest": ^29.5.14 + "@types/katex": ^0.16.7 + "@types/luxon": ^3.4.2 + "@types/node": ^20.17.7 + "@types/react": ^19.0.0-rc.1 + "@types/react-dom": ^19.0.0-rc.1 + "@types/react-router-dom": ^5.3.3 + "@typescript-eslint/eslint-plugin": ^8.15.0 + "@typescript-eslint/parser": ^8.15.0 + axios: ^1.7.7 + clsx: ^2.1.1 + confusing-browser-globals: ^1.0.11 + eslint: ^8.57.1 + eslint-config-next: 15.0.3 + eslint-config-prettier: ^9.1.0 + eslint-plugin-eslint-comments: ^3.2.0 + eslint-plugin-filenames: ^1.3.2 + eslint-plugin-import: ^2.31.0 + eslint-plugin-jest: ^28.9.0 + eslint-plugin-no-secrets: ^1.1.2 + eslint-plugin-node: ^11.1.0 + eslint-plugin-prettier: ^5.2.1 + eslint-plugin-promise: ^7.1.0 + eslint-plugin-security: ^3.0.1 + eslint-plugin-simple-import-sort: ^12.1.1 + eslint-plugin-unicorn: ^56.0.1 + katex: ^0.16.11 + luxon: ^3.5.0 + mathjax-full: ^3.2.2 + mathjax-react: ^2.0.1 + next: 15.0.3 + prettier: ^3.3.3 + ra-i18n-polyglot: ^5.4.0 + ra-language-slovak: ^3.6.2 + react: 19.0.0-rc-66855b96-20241106 + react-admin: ^4.16.20 + react-cookie: ^4.1.1 + react-dom: 19.0.0-rc-66855b96-20241106 + react-dropzone: ^14.3.5 + react-hook-form: ^7.53.2 + react-markdown: ^9.0.1 + rehype-katex: ^7.0.1 + remark-gfm: ^4.0.0 + remark-math: ^6.0.0 + sass: ^1.81.0 + typed-scss-modules: ^8.0.1 + typescript: ^5.7.2 + unstated-next: ^1.1.0 + usehooks-ts: ^3.1.0 languageName: unknown linkType: soft From 7e19820c3913beb8e6a573955851587182ff95e8 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 24 Nov 2024 02:36:54 +0100 Subject: [PATCH 02/12] Added custom translation provider --- src/components/Admin/Admin.tsx | 8 ++- src/components/Admin/i18nProvider.ts | 5 ++ src/components/Admin/translations/sk_SK.ts | 58 ++++++++++++++++++++++ src/types.d.ts | 1 + 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/components/Admin/i18nProvider.ts create mode 100644 src/components/Admin/translations/sk_SK.ts create mode 100644 src/types.d.ts diff --git a/src/components/Admin/Admin.tsx b/src/components/Admin/Admin.tsx index 2c74438f..de1f3fd7 100644 --- a/src/components/Admin/Admin.tsx +++ b/src/components/Admin/Admin.tsx @@ -3,6 +3,7 @@ import {Admin as ReactAdmin, Resource} from 'react-admin' import {AdminLayout} from './AdminLayout' import {dataProvider} from './dataProvider' +import {myI18nProvider} from './i18nProvider' import {FlatpageCreate} from './resources/base/flat-page/FlatpageCreate' import {FlatpageEdit} from './resources/base/flat-page/FlatpageEdit' import {FlatpageList} from './resources/base/flat-page/FlatpageList' @@ -51,7 +52,12 @@ export const Admin: FC = () => { const authProvider = useAuthProvider() return ( - + sk_SK, 'sk', [{locale: 'sk', name: 'Slovak (sk_SK)'}]) diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts new file mode 100644 index 00000000..4712e4f8 --- /dev/null +++ b/src/components/Admin/translations/sk_SK.ts @@ -0,0 +1,58 @@ +import slovakMessages from "ra-language-slovak" + +export const sk_SK = { + ...slovakMessages, + resources: { + 'cms/post': { + name: 'Príspevky', + fields: { + caption: "Názov", + short_text: "Krátky text", + details: "Detaily", + added_at: "Vytvorené", + visible_after: "Viditeľné po", + visible_until: "Viditeľné do", + sites: "Stránky", + links: "Odkazy", + + } + }, + 'base/flat-page': { + name: 'Test123' + }, + 'competition/competition': { + name: 'Súťaže', + fields: { + name: "Názov", + slug: "Slug", + start_year: "Start Year", + description: "Popis", + rules: "Pravidlá", + competition_type: { + name: "Názov súťaže" + }, + sites: "Stránky", + who_can_participate: "Who Can Participate", + min_years_until_graduation: "min_years_until_graduation" + } + }, + events: '', + semesters: '', + series: '', + problems: '', + solutions: '', + schools: '', + }, + + controls: { + create: '', + edit: '', + export: '', + show: '', + back_to_list: '', + back_home: '', + logout: 'Odhlásiť sa', + test: 'Test' + }, + +} diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 00000000..add9880e --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1 @@ +declare module 'ra-language-slovak' From 00e8866a6ecb68b9f388d8954851a33b1e5fe1bc Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 24 Nov 2024 02:37:22 +0100 Subject: [PATCH 03/12] Fixed lint issues --- src/components/Admin/translations/sk_SK.ts | 80 +++++++++++----------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index 4712e4f8..96e6840d 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -1,4 +1,4 @@ -import slovakMessages from "ra-language-slovak" +import slovakMessages from 'ra-language-slovak' export const sk_SK = { ...slovakMessages, @@ -6,53 +6,51 @@ export const sk_SK = { 'cms/post': { name: 'Príspevky', fields: { - caption: "Názov", - short_text: "Krátky text", - details: "Detaily", - added_at: "Vytvorené", - visible_after: "Viditeľné po", - visible_until: "Viditeľné do", - sites: "Stránky", - links: "Odkazy", - - } + caption: 'Názov', + short_text: 'Krátky text', + details: 'Detaily', + added_at: 'Vytvorené', + visible_after: 'Viditeľné po', + visible_until: 'Viditeľné do', + sites: 'Stránky', + links: 'Odkazy', + }, }, 'base/flat-page': { - name: 'Test123' + name: 'Test123', }, 'competition/competition': { name: 'Súťaže', fields: { - name: "Názov", - slug: "Slug", - start_year: "Start Year", - description: "Popis", - rules: "Pravidlá", + name: 'Názov', + slug: 'Slug', + start_year: 'Start Year', + description: 'Popis', + rules: 'Pravidlá', competition_type: { - name: "Názov súťaže" + name: 'Názov súťaže', }, - sites: "Stránky", - who_can_participate: "Who Can Participate", - min_years_until_graduation: "min_years_until_graduation" - } - }, - events: '', - semesters: '', - series: '', - problems: '', - solutions: '', - schools: '', + sites: 'Stránky', + who_can_participate: 'Who Can Participate', + min_years_until_graduation: 'min_years_until_graduation', + }, }, - - controls: { - create: '', - edit: '', - export: '', - show: '', - back_to_list: '', - back_home: '', - logout: 'Odhlásiť sa', - test: 'Test' - }, - + events: '', + semesters: '', + series: '', + problems: '', + solutions: '', + schools: '', + }, + + controls: { + create: '', + edit: '', + export: '', + show: '', + back_to_list: '', + back_home: '', + logout: 'Odhlásiť sa', + test: 'Test', + }, } From 8ce9c33038dde1a07dec66ece7c3f7401155c312 Mon Sep 17 00:00:00 2001 From: Viliam Geffert <60324080+vgeffer@users.noreply.github.com> Date: Sun, 24 Nov 2024 01:09:54 +0100 Subject: [PATCH 04/12] Season code now maps to strings (#481) * Season code now maps to strings * Moved string mappings to separate component Still trying to fix this mess --- .../Admin/resources/competition/semester/SemesterList.tsx | 2 ++ .../Admin/resources/competition/semester/SemesterShow.tsx | 3 +++ .../resources/competition/semester/seasonCodeStrings.ts | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 src/components/Admin/resources/competition/semester/seasonCodeStrings.ts diff --git a/src/components/Admin/resources/competition/semester/SemesterList.tsx b/src/components/Admin/resources/competition/semester/SemesterList.tsx index 0a61357a..9e021703 100644 --- a/src/components/Admin/resources/competition/semester/SemesterList.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterList.tsx @@ -13,6 +13,8 @@ import { import {DateTimeField} from '@/components/Admin/custom/DateTimeField' import {SeasonCodeField} from '@/components/Admin/custom/SeasonCodeField' +import {seasonCodeStrings} from './seasonCodeStrings' + export const SemesterList: FC = () => ( diff --git a/src/components/Admin/resources/competition/semester/SemesterShow.tsx b/src/components/Admin/resources/competition/semester/SemesterShow.tsx index 34e56d22..f71a4fe2 100644 --- a/src/components/Admin/resources/competition/semester/SemesterShow.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterShow.tsx @@ -3,6 +3,7 @@ import { ArrayField, BooleanField, Datagrid, + FunctionField, NumberField, ReferenceArrayField, ReferenceField, @@ -17,6 +18,8 @@ import {MyShow} from '@/components/Admin/custom/MyShow' import {SeasonCodeField} from '@/components/Admin/custom/SeasonCodeField' import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField' +import {seasonCodeStrings} from './seasonCodeStrings' + export const SemesterShow: FC = () => ( diff --git a/src/components/Admin/resources/competition/semester/seasonCodeStrings.ts b/src/components/Admin/resources/competition/semester/seasonCodeStrings.ts new file mode 100644 index 00000000..92d94ac5 --- /dev/null +++ b/src/components/Admin/resources/competition/semester/seasonCodeStrings.ts @@ -0,0 +1,5 @@ +export const seasonCodeStrings = [ + {id: 0, name: 'Zimný'}, + {id: 1, name: 'Letný'}, + {id: 2, name: 'Iný'}, +] From 0ff6a413ac4c558b5eb2f61b5bbb09ca082c9ac1 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 24 Nov 2024 13:20:13 +0100 Subject: [PATCH 05/12] Added translations for resources and resource fields ugh... why? --- src/components/Admin/AdminLayout.tsx | 11 +- .../Admin/resources/cms/post/PostEdit.tsx | 2 +- .../Admin/resources/cms/post/PostList.tsx | 6 +- .../EventRegistrationList.tsx | 4 +- .../EventRegistrationShow.tsx | 4 +- .../resources/competition/event/EventList.tsx | 1 - .../competition/semester/SemesterList.tsx | 3 - .../competition/solution/SolutionList.tsx | 4 +- .../personal/profiles/ProfileCreate.tsx | 8 +- .../personal/profiles/ProfileList.tsx | 8 +- .../personal/profiles/ProfileShow.tsx | 8 +- src/components/Admin/translations/sk_SK.ts | 137 ++++++++++++++++-- 12 files changed, 148 insertions(+), 48 deletions(-) diff --git a/src/components/Admin/AdminLayout.tsx b/src/components/Admin/AdminLayout.tsx index e1189d53..d6f5c83e 100644 --- a/src/components/Admin/AdminLayout.tsx +++ b/src/components/Admin/AdminLayout.tsx @@ -2,12 +2,12 @@ import {Home, Logout} from '@mui/icons-material/' import {Button, Stack, Typography} from '@mui/material' import {useRouter} from 'next/router' import {FC, PropsWithChildren} from 'react' -import {AppBar, Layout, useLogout} from 'react-admin' +import {AppBar, Layout, useLogout, useTranslate} from 'react-admin' const AppMenuBar = () => { const router = useRouter() const logout = useLogout() - + const translate = useTranslate() return ( { @@ -34,6 +34,7 @@ const AppMenuBar = () => { } export const AdminLayout: FC = ({children}) => { + const translate = useTranslate() return ( <> {children} @@ -50,7 +51,7 @@ export const AdminLayout: FC = ({children}) => { }} > - Všetky časy sú uvedené v časovom pásme Europe/Bratislava + {translate('content.footer.timezone_message')} diff --git a/src/components/Admin/resources/cms/post/PostEdit.tsx b/src/components/Admin/resources/cms/post/PostEdit.tsx index 5ec4d2a8..ee50d050 100644 --- a/src/components/Admin/resources/cms/post/PostEdit.tsx +++ b/src/components/Admin/resources/cms/post/PostEdit.tsx @@ -9,7 +9,7 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput' export const PostEdit: FC = () => ( - + diff --git a/src/components/Admin/resources/cms/post/PostList.tsx b/src/components/Admin/resources/cms/post/PostList.tsx index 11956552..c6e4a203 100644 --- a/src/components/Admin/resources/cms/post/PostList.tsx +++ b/src/components/Admin/resources/cms/post/PostList.tsx @@ -15,11 +15,7 @@ export const PostList: FC = () => ( - - source="links" - label="Link count" - render={(record) => record && {record['links'].length}} - /> + source="links" render={(record) => record && {record['links'].length}} /> ) diff --git a/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx b/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx index 1f896b01..0e36204e 100644 --- a/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx +++ b/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx @@ -11,8 +11,8 @@ export const EventRegistrationList: FC = () => ( label="Meno a priezvisko" render={(record: EventRegistration) => `${record.profile.first_name} ${record.profile.last_name}`} /> - - + + diff --git a/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx b/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx index 0992ecdf..b70c09a3 100644 --- a/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx +++ b/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx @@ -12,8 +12,8 @@ export const EventRegistrationShow: FC = () => ( label="Meno a priezvisko" render={(record: EventRegistration) => `${record.profile.first_name} ${record.profile.last_name}`} /> - - + + diff --git a/src/components/Admin/resources/competition/event/EventList.tsx b/src/components/Admin/resources/competition/event/EventList.tsx index 8fa6e69a..5a14ee64 100644 --- a/src/components/Admin/resources/competition/event/EventList.tsx +++ b/src/components/Admin/resources/competition/event/EventList.tsx @@ -18,7 +18,6 @@ export const EventList: FC = () => ( source="publication_set" - label="Publication count" render={(record) => record && {record['publication_set'].length}} /> diff --git a/src/components/Admin/resources/competition/semester/SemesterList.tsx b/src/components/Admin/resources/competition/semester/SemesterList.tsx index 9e021703..7f2a8c06 100644 --- a/src/components/Admin/resources/competition/semester/SemesterList.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterList.tsx @@ -29,17 +29,14 @@ export const SemesterList: FC = () => ( source="series_set" - label="Series count" render={(record) => record && {record['series_set'].length}} /> source="publication_set" - label="Publication count" render={(record) => record && {record['publication_set'].length}} /> source="late_tags" - label="Late tags count" render={(record) => record && {record['late_tags'].length}} /> diff --git a/src/components/Admin/resources/competition/solution/SolutionList.tsx b/src/components/Admin/resources/competition/solution/SolutionList.tsx index 66977286..78151647 100644 --- a/src/components/Admin/resources/competition/solution/SolutionList.tsx +++ b/src/components/Admin/resources/competition/solution/SolutionList.tsx @@ -10,8 +10,8 @@ export const SolutionList: FC = () => ( label="Má nahraté riešenie" render={(record) => record && } /> - - + + ) diff --git a/src/components/Admin/resources/personal/profiles/ProfileCreate.tsx b/src/components/Admin/resources/personal/profiles/ProfileCreate.tsx index 06ab0963..37344fe5 100644 --- a/src/components/Admin/resources/personal/profiles/ProfileCreate.tsx +++ b/src/components/Admin/resources/personal/profiles/ProfileCreate.tsx @@ -11,13 +11,13 @@ export const ProfileCreate: FC = () => ( }} > - - + + - + - + diff --git a/src/components/Admin/resources/personal/profiles/ProfileList.tsx b/src/components/Admin/resources/personal/profiles/ProfileList.tsx index 24e61972..6a947115 100644 --- a/src/components/Admin/resources/personal/profiles/ProfileList.tsx +++ b/src/components/Admin/resources/personal/profiles/ProfileList.tsx @@ -4,10 +4,10 @@ import {Datagrid, List, ReferenceField, TextField} from 'react-admin' export const ProfileList: FC = () => ( - - - - + + + + diff --git a/src/components/Admin/resources/personal/profiles/ProfileShow.tsx b/src/components/Admin/resources/personal/profiles/ProfileShow.tsx index 69392172..600aa3ce 100644 --- a/src/components/Admin/resources/personal/profiles/ProfileShow.tsx +++ b/src/components/Admin/resources/personal/profiles/ProfileShow.tsx @@ -6,10 +6,10 @@ import {MyShow} from '@/components/Admin/custom/MyShow' export const ProfileShow: FC = () => ( - - - - + + + + diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index 96e6840d..1f5c99dd 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -1,7 +1,9 @@ import slovakMessages from 'ra-language-slovak' export const sk_SK = { - ...slovakMessages, + ra: { + ...slovakMessages.ra, + }, resources: { 'cms/post': { name: 'Príspevky', @@ -17,7 +19,14 @@ export const sk_SK = { }, }, 'base/flat-page': { - name: 'Test123', + name: 'flat-pages', + fields: { + id: 'ID', + url: 'URL', + title: 'Názov', + content: 'Obsah', + sites: 'Stránky', + }, }, 'competition/competition': { name: 'Súťaže', @@ -35,22 +44,120 @@ export const sk_SK = { min_years_until_graduation: 'min_years_until_graduation', }, }, - events: '', - semesters: '', - series: '', - problems: '', - solutions: '', - schools: '', + 'competition/event': { + name: 'competition/event', + fields: { + competition: 'Súťaž', + year: 'Ročník', + season_code: 'season_code', + school_year: 'Školský rok', + start: 'Začiatok', + end: 'Koniec', + location: 'location', + additional_name: 'additional_name', + registration_link: { + id: 'ID', + url: 'Odkaz na registráciu', + start: 'registration_link.start', + end: 'registration_link.end', + additional_info: 'Ďalšie informácie', + }, + publication_set: 'Pubikácie', + }, + }, + 'competition/semester': { + name: 'competition/semester', + fields: { + competition: 'Súťaž', + year: 'Ročník', + season_code: 'season_code', + school_year: 'Školský rok', + start: 'Začiatok', + end: 'Koniec', + complete: 'complete', + additional_name: 'AddditionalName', + registration_link: 'Odkaz na registráciu', + series_set: 'Série', + publication_set: 'Publikácie', + late_tags: 'late_tags', + }, + }, + 'competition/series': { + name: 'competition/series', + fields: { + semester: 'Semester', + deadline: 'Deadline', + order: 'Poradie', + complete: 'Complete', + problems: 'Úlohy', + }, + }, + 'competition/problem': { + name: 'Úlohy', + fields: { + series: 'Séria', + order: 'Poradie', + text: 'Zadanie', + image: 'Obrázok', + num_comments: 'Počet komentárov', + }, + }, + 'competition/solution': { + name: 'Riešenia', + fields: { + problem: 'Úloha', + semester_registration: 'Riešiteľ', + late_tag: 'Po termíne', + is_online: 'Internetové riešenie', + solution: 'Riešenie', + }, + }, + 'competition/event-registration': { + name: 'event-registration', + fields: { + school: { + abbreviation: 'Škola', + }, + grade: { + tag: 'Ročník', + }, + event: 'Event', + }, + }, + 'personal/schools': { + name: 'Školy', + fields: { + name: 'Názov školy', + street: 'Ulica', + city: 'Mesto', + zip_code: 'PSČ', + district: 'Okres', + abbreviation: 'Skratka školy', + email: 'Email', + }, + }, + 'personal/profiles': { + name: 'Uživateľské profily', + fields: { + first_name: 'Meno', + last_name: 'Priezvisko', + school: { + verbose_name: 'Škola', + }, + grade: 'Ročník', + }, + }, }, controls: { - create: '', - edit: '', - export: '', - show: '', - back_to_list: '', - back_home: '', + back_home: 'Späť na hlavnú stránku', logout: 'Odhlásiť sa', - test: 'Test', + }, + + content: { + labels: {}, + footer: { + timezone_message: 'Všetky časy sú uvedené v časovom pásme Europe/Bratislava', + }, }, } From 8d51169803aa00e851c7672f0611d1f155e49cfe Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 24 Nov 2024 13:31:28 +0100 Subject: [PATCH 06/12] Added tab labels --- .../Admin/resources/base/flat-page/FlatpageCreate.tsx | 4 ++-- .../Admin/resources/base/flat-page/FlatpageEdit.tsx | 4 ++-- .../Admin/resources/cms/post/PostCreate.tsx | 6 +++--- src/components/Admin/resources/cms/post/PostEdit.tsx | 6 +++--- src/components/Admin/resources/cms/post/PostShow.tsx | 4 ++-- .../competition/competition/CompetitionShow.tsx | 4 ++-- .../Admin/resources/competition/event/EventShow.tsx | 4 ++-- .../resources/competition/problems/ProblemCreate.tsx | 2 +- .../resources/competition/problems/ProblemEdit.tsx | 2 +- .../resources/competition/semester/SemesterEdit.tsx | 2 +- .../resources/competition/semester/SemesterShow.tsx | 8 ++++---- .../resources/competition/series/SeriesCreate.tsx | 2 +- .../Admin/resources/competition/series/SeriesEdit.tsx | 2 +- .../Admin/resources/competition/series/SeriesShow.tsx | 4 ++-- src/components/Admin/translations/sk_SK.ts | 11 ++++++++++- 15 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/components/Admin/resources/base/flat-page/FlatpageCreate.tsx b/src/components/Admin/resources/base/flat-page/FlatpageCreate.tsx index 75354d3d..8cb82d8e 100644 --- a/src/components/Admin/resources/base/flat-page/FlatpageCreate.tsx +++ b/src/components/Admin/resources/base/flat-page/FlatpageCreate.tsx @@ -8,14 +8,14 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput' export const FlatpageCreate: FC = () => ( - + - + diff --git a/src/components/Admin/resources/base/flat-page/FlatpageEdit.tsx b/src/components/Admin/resources/base/flat-page/FlatpageEdit.tsx index 63deb7fe..f7f2fd40 100644 --- a/src/components/Admin/resources/base/flat-page/FlatpageEdit.tsx +++ b/src/components/Admin/resources/base/flat-page/FlatpageEdit.tsx @@ -8,14 +8,14 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput' export const FlatpageEdit: FC = () => ( - + - + diff --git a/src/components/Admin/resources/cms/post/PostCreate.tsx b/src/components/Admin/resources/cms/post/PostCreate.tsx index 3d4dba39..6e23776e 100644 --- a/src/components/Admin/resources/cms/post/PostCreate.tsx +++ b/src/components/Admin/resources/cms/post/PostCreate.tsx @@ -10,7 +10,7 @@ export const PostCreate: FC = () => { return ( - + @@ -19,7 +19,7 @@ export const PostCreate: FC = () => { - + @@ -27,7 +27,7 @@ export const PostCreate: FC = () => { - + diff --git a/src/components/Admin/resources/cms/post/PostEdit.tsx b/src/components/Admin/resources/cms/post/PostEdit.tsx index ee50d050..0873c292 100644 --- a/src/components/Admin/resources/cms/post/PostEdit.tsx +++ b/src/components/Admin/resources/cms/post/PostEdit.tsx @@ -9,7 +9,7 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput' export const PostEdit: FC = () => ( - + @@ -18,7 +18,7 @@ export const PostEdit: FC = () => ( - + @@ -26,7 +26,7 @@ export const PostEdit: FC = () => ( - + diff --git a/src/components/Admin/resources/cms/post/PostShow.tsx b/src/components/Admin/resources/cms/post/PostShow.tsx index 7ccbe2eb..b8cc260f 100644 --- a/src/components/Admin/resources/cms/post/PostShow.tsx +++ b/src/components/Admin/resources/cms/post/PostShow.tsx @@ -8,7 +8,7 @@ import {SitesArrayField} from '@/components/Admin/custom/SitesArrayField' export const PostShow: FC = () => ( }> - + @@ -19,7 +19,7 @@ export const PostShow: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/competition/CompetitionShow.tsx b/src/components/Admin/resources/competition/competition/CompetitionShow.tsx index a0b68d22..d70c824e 100644 --- a/src/components/Admin/resources/competition/competition/CompetitionShow.tsx +++ b/src/components/Admin/resources/competition/competition/CompetitionShow.tsx @@ -22,7 +22,7 @@ import {UpcomingOrCurrentEvent} from './UpcomingOrCurrentEvent' export const CompetitionShow: FC = () => ( - + @@ -38,7 +38,7 @@ export const CompetitionShow: FC = () => ( - + `/competition/event/${id}/show`}> diff --git a/src/components/Admin/resources/competition/event/EventShow.tsx b/src/components/Admin/resources/competition/event/EventShow.tsx index e7d98c67..2a4b434e 100644 --- a/src/components/Admin/resources/competition/event/EventShow.tsx +++ b/src/components/Admin/resources/competition/event/EventShow.tsx @@ -17,7 +17,7 @@ import {SeasonCodeField} from '@/components/Admin/custom/SeasonCodeField' export const EventShow: FC = () => ( - + @@ -34,7 +34,7 @@ export const EventShow: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/problems/ProblemCreate.tsx b/src/components/Admin/resources/competition/problems/ProblemCreate.tsx index 358b4d9a..34079f67 100644 --- a/src/components/Admin/resources/competition/problems/ProblemCreate.tsx +++ b/src/components/Admin/resources/competition/problems/ProblemCreate.tsx @@ -17,7 +17,7 @@ export const ProblemCreate: FC = () => ( }} > - + diff --git a/src/components/Admin/resources/competition/problems/ProblemEdit.tsx b/src/components/Admin/resources/competition/problems/ProblemEdit.tsx index 54c84ce7..ca9d2e9c 100644 --- a/src/components/Admin/resources/competition/problems/ProblemEdit.tsx +++ b/src/components/Admin/resources/competition/problems/ProblemEdit.tsx @@ -17,7 +17,7 @@ export const ProblemEdit: FC = () => ( }} > - + diff --git a/src/components/Admin/resources/competition/semester/SemesterEdit.tsx b/src/components/Admin/resources/competition/semester/SemesterEdit.tsx index 9101918b..f9e77692 100644 --- a/src/components/Admin/resources/competition/semester/SemesterEdit.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterEdit.tsx @@ -27,7 +27,7 @@ export const SemesterEdit: FC = () => ( }} > - + diff --git a/src/components/Admin/resources/competition/semester/SemesterShow.tsx b/src/components/Admin/resources/competition/semester/SemesterShow.tsx index f71a4fe2..61715520 100644 --- a/src/components/Admin/resources/competition/semester/SemesterShow.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterShow.tsx @@ -23,7 +23,7 @@ import {seasonCodeStrings} from './seasonCodeStrings' export const SemesterShow: FC = () => ( - + @@ -36,7 +36,7 @@ export const SemesterShow: FC = () => ( - + `/competition/series/${id}/show`}> @@ -51,7 +51,7 @@ export const SemesterShow: FC = () => ( - + @@ -66,7 +66,7 @@ export const SemesterShow: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/series/SeriesCreate.tsx b/src/components/Admin/resources/competition/series/SeriesCreate.tsx index 4cbeb220..5b3ca9e0 100644 --- a/src/components/Admin/resources/competition/series/SeriesCreate.tsx +++ b/src/components/Admin/resources/competition/series/SeriesCreate.tsx @@ -7,7 +7,7 @@ import {MyDateTimeInput} from '@/components/Admin/custom/MyDateTimeInput' export const SeriesCreate: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/series/SeriesEdit.tsx b/src/components/Admin/resources/competition/series/SeriesEdit.tsx index dc77f93d..e49759eb 100644 --- a/src/components/Admin/resources/competition/series/SeriesEdit.tsx +++ b/src/components/Admin/resources/competition/series/SeriesEdit.tsx @@ -14,7 +14,7 @@ export const SeriesEdit: FC = () => ( }} > - + diff --git a/src/components/Admin/resources/competition/series/SeriesShow.tsx b/src/components/Admin/resources/competition/series/SeriesShow.tsx index a5ad39db..9352f2b6 100644 --- a/src/components/Admin/resources/competition/series/SeriesShow.tsx +++ b/src/components/Admin/resources/competition/series/SeriesShow.tsx @@ -17,7 +17,7 @@ import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField' export const SeriesShow: FC = () => ( - + @@ -25,7 +25,7 @@ export const SeriesShow: FC = () => ( - + diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index 1f5c99dd..a0dcd0e1 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -155,7 +155,16 @@ export const sk_SK = { }, content: { - labels: {}, + labels: { + general: 'Generala', + preview: 'Náhľad', + links: 'Odkazy', + publications: 'Publikácie', + series: 'Série', + late_tags: 'Late_tags', + problems: 'Úlohy', + history_events: 'History_Events', + }, footer: { timezone_message: 'Všetky časy sú uvedené v časovom pásme Europe/Bratislava', }, From 3b2838bd534a2acdbcb87eb6cb60833a4472aa97 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sun, 24 Nov 2024 13:48:49 +0100 Subject: [PATCH 07/12] Added label translations --- src/components/Admin/custom/LatexPreview.tsx | 2 +- src/components/Admin/custom/MyEditActions.tsx | 2 +- src/components/Admin/custom/MyShowActions.tsx | 2 +- .../competition/competition/CompetitionEdit.tsx | 2 +- .../competition/competition/CompetitionList.tsx | 4 ++-- .../competition/competition/CompetitionShow.tsx | 3 +-- .../competition/UpcomingOrCurrentEvent.tsx | 3 +-- .../event-registration/EventRegistrationList.tsx | 2 +- .../event-registration/EventRegistrationShow.tsx | 2 +- .../resources/competition/event/EventCreate.tsx | 4 ++-- .../Admin/resources/competition/event/EventEdit.tsx | 4 ++-- .../resources/competition/problems/ProblemList.tsx | 2 +- .../resources/competition/series/SeriesList.tsx | 2 +- .../competition/solution/SolutionCreate.tsx | 4 ++-- .../resources/competition/solution/SolutionEdit.tsx | 4 ++-- .../resources/competition/solution/SolutionList.tsx | 2 +- .../resources/competition/solution/SolutionShow.tsx | 4 ++-- src/components/Admin/translations/sk_SK.ts | 12 ++++++++++++ 18 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/components/Admin/custom/LatexPreview.tsx b/src/components/Admin/custom/LatexPreview.tsx index 5a77b7ee..25f6d9b7 100644 --- a/src/components/Admin/custom/LatexPreview.tsx +++ b/src/components/Admin/custom/LatexPreview.tsx @@ -7,7 +7,7 @@ export const LatexPreview: FC = ({source}) => { if (!source) return null return ( - + {({formData}) => { const data = formData[source] diff --git a/src/components/Admin/custom/MyEditActions.tsx b/src/components/Admin/custom/MyEditActions.tsx index d3dc95b8..d4864a91 100644 --- a/src/components/Admin/custom/MyEditActions.tsx +++ b/src/components/Admin/custom/MyEditActions.tsx @@ -24,7 +24,7 @@ export const MyEditActions: FC = () => { we want to link to the specific show tab, not just resource show */} {/* @ts-ignore */} - + ) } diff --git a/src/components/Admin/custom/MyShowActions.tsx b/src/components/Admin/custom/MyShowActions.tsx index bd801d7b..96b66f07 100644 --- a/src/components/Admin/custom/MyShowActions.tsx +++ b/src/components/Admin/custom/MyShowActions.tsx @@ -21,7 +21,7 @@ export const MyShowActions: FC = () => { return ( - + ) } diff --git a/src/components/Admin/resources/competition/competition/CompetitionEdit.tsx b/src/components/Admin/resources/competition/competition/CompetitionEdit.tsx index 6e7c25fb..dc85f310 100644 --- a/src/components/Admin/resources/competition/competition/CompetitionEdit.tsx +++ b/src/components/Admin/resources/competition/competition/CompetitionEdit.tsx @@ -12,7 +12,7 @@ export const CompetitionEdit: FC = () => ( - + diff --git a/src/components/Admin/resources/competition/competition/CompetitionList.tsx b/src/components/Admin/resources/competition/competition/CompetitionList.tsx index b7963725..5e8914c0 100644 --- a/src/components/Admin/resources/competition/competition/CompetitionList.tsx +++ b/src/components/Admin/resources/competition/competition/CompetitionList.tsx @@ -12,13 +12,13 @@ export const CompetitionList: FC = () => ( - + source="history_events" - label="History events count" + label="content.labels.history_events_count" render={(record) => record && {record['history_events'].length}} /> diff --git a/src/components/Admin/resources/competition/competition/CompetitionShow.tsx b/src/components/Admin/resources/competition/competition/CompetitionShow.tsx index d70c824e..127ab35c 100644 --- a/src/components/Admin/resources/competition/competition/CompetitionShow.tsx +++ b/src/components/Admin/resources/competition/competition/CompetitionShow.tsx @@ -29,7 +29,7 @@ export const CompetitionShow: FC = () => ( - + @@ -49,7 +49,6 @@ export const CompetitionShow: FC = () => ( source="publication_set" - label="Publication count" render={(record) => record && {record['publication_set'].length}} /> diff --git a/src/components/Admin/resources/competition/competition/UpcomingOrCurrentEvent.tsx b/src/components/Admin/resources/competition/competition/UpcomingOrCurrentEvent.tsx index 408036fd..5359a13c 100644 --- a/src/components/Admin/resources/competition/competition/UpcomingOrCurrentEvent.tsx +++ b/src/components/Admin/resources/competition/competition/UpcomingOrCurrentEvent.tsx @@ -20,7 +20,7 @@ export const UpcomingOrCurrentEvent: FC = () => { return ( redirect('show', 'competition/event', record.upcoming_or_current_event.competition)} sx={{cursor: 'pointer'}} > @@ -39,7 +39,6 @@ export const UpcomingOrCurrentEvent: FC = () => { source="publication_set" - label="Publication count" // optional access because of weird behavior of nested FunctionFields for null record render={(record) => record && {record['publication_set']?.length}} /> diff --git a/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx b/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx index 0e36204e..d3287a00 100644 --- a/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx +++ b/src/components/Admin/resources/competition/event-registration/EventRegistrationList.tsx @@ -8,7 +8,7 @@ export const EventRegistrationList: FC = () => ( `${record.profile.first_name} ${record.profile.last_name}`} /> diff --git a/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx b/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx index b70c09a3..9a8f20c8 100644 --- a/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx +++ b/src/components/Admin/resources/competition/event-registration/EventRegistrationShow.tsx @@ -9,7 +9,7 @@ export const EventRegistrationShow: FC = () => ( `${record.profile.first_name} ${record.profile.last_name}`} /> diff --git a/src/components/Admin/resources/competition/event/EventCreate.tsx b/src/components/Admin/resources/competition/event/EventCreate.tsx index 6c97bd91..38ce9610 100644 --- a/src/components/Admin/resources/competition/event/EventCreate.tsx +++ b/src/components/Admin/resources/competition/event/EventCreate.tsx @@ -29,10 +29,10 @@ export const EventCreate: FC = () => { setIncludeRegLink(e.target.checked)} />} - label="Pridať registračný link" + label="content.labels.reg_link_add" /> {includeRegLink && ( - + <> diff --git a/src/components/Admin/resources/competition/event/EventEdit.tsx b/src/components/Admin/resources/competition/event/EventEdit.tsx index 45d8f744..5dd98c33 100644 --- a/src/components/Admin/resources/competition/event/EventEdit.tsx +++ b/src/components/Admin/resources/competition/event/EventEdit.tsx @@ -31,10 +31,10 @@ export const EventEdit: FC = () => { setIncludeRegLink(e.target.checked)} />} - label="Upraviť registračný link" + label="content.labels.reg_link_add" /> {includeRegLink && ( - + <> diff --git a/src/components/Admin/resources/competition/problems/ProblemList.tsx b/src/components/Admin/resources/competition/problems/ProblemList.tsx index 325594d5..c4c3f5c7 100644 --- a/src/components/Admin/resources/competition/problems/ProblemList.tsx +++ b/src/components/Admin/resources/competition/problems/ProblemList.tsx @@ -20,7 +20,7 @@ export const ProblemList: FC = () => ( - label="Má vzorák" + label="content.labels.has_vzorak" render={(record) => record && } /> diff --git a/src/components/Admin/resources/competition/series/SeriesList.tsx b/src/components/Admin/resources/competition/series/SeriesList.tsx index db0fc971..3aeaee65 100644 --- a/src/components/Admin/resources/competition/series/SeriesList.tsx +++ b/src/components/Admin/resources/competition/series/SeriesList.tsx @@ -11,7 +11,7 @@ export const SeriesList: FC = () => ( - label="Problem count" + label="content.labels.problem_count" render={(record) => record && {record['problems'].length}} /> diff --git a/src/components/Admin/resources/competition/solution/SolutionCreate.tsx b/src/components/Admin/resources/competition/solution/SolutionCreate.tsx index ffb4d46e..8aa0a0bb 100644 --- a/src/components/Admin/resources/competition/solution/SolutionCreate.tsx +++ b/src/components/Admin/resources/competition/solution/SolutionCreate.tsx @@ -24,10 +24,10 @@ export const SolutionCreate: FC = () => ( - + - + ) diff --git a/src/components/Admin/resources/competition/solution/SolutionEdit.tsx b/src/components/Admin/resources/competition/solution/SolutionEdit.tsx index b5eb9789..f3708274 100644 --- a/src/components/Admin/resources/competition/solution/SolutionEdit.tsx +++ b/src/components/Admin/resources/competition/solution/SolutionEdit.tsx @@ -24,10 +24,10 @@ export const SolutionEdit: FC = () => ( - + - + ) diff --git a/src/components/Admin/resources/competition/solution/SolutionList.tsx b/src/components/Admin/resources/competition/solution/SolutionList.tsx index 78151647..f861b9ed 100644 --- a/src/components/Admin/resources/competition/solution/SolutionList.tsx +++ b/src/components/Admin/resources/competition/solution/SolutionList.tsx @@ -7,7 +7,7 @@ export const SolutionList: FC = () => ( - label="Má nahraté riešenie" + label="content.labels.has_solution" render={(record) => record && } /> diff --git a/src/components/Admin/resources/competition/solution/SolutionShow.tsx b/src/components/Admin/resources/competition/solution/SolutionShow.tsx index c0331c1e..6e043c08 100644 --- a/src/components/Admin/resources/competition/solution/SolutionShow.tsx +++ b/src/components/Admin/resources/competition/solution/SolutionShow.tsx @@ -9,8 +9,8 @@ export const SolutionShow: FC = () => ( - - + + ) diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index a0dcd0e1..fb66ec01 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -164,6 +164,18 @@ export const sk_SK = { late_tags: 'Late_tags', problems: 'Úlohy', history_events: 'History_Events', + back_to_list: 'Späť na list', + competition_type: 'competition_type', + history_events_count: 'HE count', + name: 'Meno a priezvisko', + reg_link: 'Odkaz na registráciu', + reg_link_add: 'Pridať odkaz na registráciu', + problem_count: 'Počet úloh', + is_online: 'Internetové riešenie?', + is_late: 'Riešenie po termíne?', + next_event: 'Prebiehajúca alebo najbližšia akcia', + has_vzorak: 'Má vzorák', + has_solution: 'Má nahraté riešenie', }, footer: { timezone_message: 'Všetky časy sú uvedené v časovom pásme Europe/Bratislava', From d3008bf0e359bc998c6d524bd9e0fe944c002dc4 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Fri, 13 Dec 2024 19:11:57 +0100 Subject: [PATCH 08/12] Improved translations --- src/components/Admin/translations/sk_SK.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index fb66ec01..463005ff 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -19,7 +19,7 @@ export const sk_SK = { }, }, 'base/flat-page': { - name: 'flat-pages', + name: 'Ploché stránky', fields: { id: 'ID', url: 'URL', @@ -45,7 +45,7 @@ export const sk_SK = { }, }, 'competition/event': { - name: 'competition/event', + name: 'Udalosti', fields: { competition: 'Súťaž', year: 'Ročník', @@ -66,7 +66,7 @@ export const sk_SK = { }, }, 'competition/semester': { - name: 'competition/semester', + name: 'Semestre', fields: { competition: 'Súťaž', year: 'Ročník', @@ -83,7 +83,7 @@ export const sk_SK = { }, }, 'competition/series': { - name: 'competition/series', + name: 'Série', fields: { semester: 'Semester', deadline: 'Deadline', @@ -113,7 +113,7 @@ export const sk_SK = { }, }, 'competition/event-registration': { - name: 'event-registration', + name: 'Registácia do súťaží', fields: { school: { abbreviation: 'Škola', @@ -156,7 +156,7 @@ export const sk_SK = { content: { labels: { - general: 'Generala', + general: 'Všeobecné', preview: 'Náhľad', links: 'Odkazy', publications: 'Publikácie', @@ -165,7 +165,7 @@ export const sk_SK = { problems: 'Úlohy', history_events: 'History_Events', back_to_list: 'Späť na list', - competition_type: 'competition_type', + competition_type: 'Typ súťaže', history_events_count: 'HE count', name: 'Meno a priezvisko', reg_link: 'Odkaz na registráciu', From fc4d867d121260c868ee403cf838e5a08663f428 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Fri, 13 Dec 2024 23:41:28 +0100 Subject: [PATCH 09/12] Fixed yarn.lock --- yarn.lock | 224 ++++++++++++++++++------------------------------------ 1 file changed, 73 insertions(+), 151 deletions(-) diff --git a/yarn.lock b/yarn.lock index 97c8859b..cc6dce21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2900,7 +2900,6 @@ __metadata: languageName: node linkType: hard -"@tanstack/react-query@npm:5.61.0, @tanstack/react-query@npm:^5.21.7": "@tanstack/react-query@npm:5.61.0, @tanstack/react-query@npm:^5.21.7": version: 5.61.0 resolution: "@tanstack/react-query@npm:5.61.0" @@ -4608,19 +4607,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.19.0": - version: 2.30.0 - resolution: "date-fns@npm:2.30.0" - dependencies: - "@babel/runtime": ^7.21.0 - checksum: f7be01523282e9bb06c0cd2693d34f245247a29098527d4420628966a2d9aad154bd0e90a6b1cf66d37adcb769cd108cf8a7bd49d76db0fb119af5cdd13644f4 - languageName: node - linkType: hard - "date-fns@npm:^3.6.0": version: 3.6.0 resolution: "date-fns@npm:3.6.0" - checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 + checksum: 10/cac35c58926a3b5d577082ff2b253612ec1c79eb6754fddef46b6a8e826501ea2cb346ecbd211205f1ba382ddd1f9d8c3f00bf433ad63cc3063454d294e3a6b8 languageName: node linkType: hard @@ -6012,17 +6002,10 @@ __metadata: languageName: node linkType: hard -"eventemitter3@npm:^4.0.7": - version: 4.0.7 - resolution: "eventemitter3@npm:4.0.7" - checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 - languageName: node - linkType: hard - "eventemitter3@npm:^5.0.1": version: 5.0.1 resolution: "eventemitter3@npm:5.0.1" - checksum: 543d6c858ab699303c3c32e0f0f47fc64d360bf73c3daf0ac0b5079710e340d6fe9f15487f94e66c629f5f82cd1a8678d692f3dbb6f6fcd1190e1b97fcad36f8 + checksum: 10/ac6423ec31124629c84c7077eed1e6987f6d66c31cf43c6fcbf6c87791d56317ce808d9ead483652436df171b526fc7220eccdc9f3225df334e81582c3cf7dd5 languageName: node linkType: hard @@ -6995,14 +6978,7 @@ __metadata: "inflection@npm:^3.0.0": version: 3.0.0 resolution: "inflection@npm:3.0.0" - checksum: 6a3b21cb011a9bca1c045ef92d199c927cfd8c4b97809152fabc9c325d36789a7499397b50d46157d080efd19843807ac73e38a2fe79d8f2cf291323998fb5b5 - languageName: node - linkType: hard - -"inflection@npm:~1.12.0": - version: 1.12.0 - resolution: "inflection@npm:1.12.0" - checksum: c640917b7c1ef2151df8eed5e7bc1ea6f6dd7b924e86f1add0bf801db55be8b581eb2d3d767a29e439153e4c06b00679a45853ac58c498ea519c4b4bdcd2a775 + checksum: 10/e8aae6abb872a8aa19184a1b84470fff7120806329c78011befcf50bce04a7b0d65012ac373f2cc5caeaaf241874c7ae20a26038ff7dbe0cdae0b863f25b5e02 languageName: node linkType: hard @@ -9655,7 +9631,7 @@ __metadata: languageName: node linkType: hard -"query-string@npm:^7.1.1, query-string@npm:^7.1.3": +"query-string@npm:^7.1.3": version: 7.1.3 resolution: "query-string@npm:7.1.3" dependencies: @@ -9691,33 +9667,9 @@ __metadata: languageName: node linkType: hard -"ra-core@npm:^5.4.0": +"ra-i18n-polyglot@npm:^5.4.0": version: 5.4.0 - resolution: "ra-core@npm:5.4.0" - dependencies: - "@tanstack/react-query": ^5.21.7 - clsx: ^2.1.1 - date-fns: ^3.6.0 - eventemitter3: ^5.0.1 - inflection: ^3.0.0 - jsonexport: ^3.2.0 - lodash: ~4.17.5 - query-string: ^7.1.3 - react-error-boundary: ^4.0.13 - react-is: ^18.2.0 - peerDependencies: - react: ^18.0.0 || ^19.0.0 - react-dom: ^18.0.0 || ^19.0.0 - react-hook-form: ^7.53.0 - react-router: ^6.22.0 - react-router-dom: ^6.22.0 - checksum: 44554074e5fc180908bd1f444a7d073329042e4c55203ef89f8d3c6c83f13695553b6dd7c89dd6b52016d3adb355887b9d2cd1e12e32fd252341b0e1cb37b9d9 - languageName: node - linkType: hard - -"ra-i18n-polyglot@npm:^4.16.20": - version: 4.16.20 - resolution: "ra-i18n-polyglot@npm:4.16.20" + resolution: "ra-i18n-polyglot@npm:5.4.0" dependencies: node-polyglot: "npm:^2.2.2" ra-core: "npm:^5.4.0" @@ -9725,19 +9677,9 @@ __metadata: languageName: node linkType: hard -"ra-i18n-polyglot@npm:^5.4.0": +"ra-language-english@npm:^5.4.0": version: 5.4.0 - resolution: "ra-i18n-polyglot@npm:5.4.0" - dependencies: - node-polyglot: ^2.2.2 - ra-core: ^5.4.0 - checksum: 3b277728dce714a80552a459befb37c57df12dccce881e5b198d903e4cbd026decf0e5ed69e21a678ab526b0bcfe970ed410abf53dba30a549b6192455e976ba - languageName: node - linkType: hard - -"ra-language-english@npm:^4.16.20": - version: 4.16.20 - resolution: "ra-language-english@npm:4.16.20" + resolution: "ra-language-english@npm:5.4.0" dependencies: ra-core: "npm:^5.4.0" checksum: 10/0c6d885b05f257f2d3a842c2fdf2175c6353e0672d307d7dc0becaaee7827d777eea5ea5948d3b4c8f77facaa0b2ff6f4f2b948833926181c74f3c578b68e714 @@ -9747,13 +9689,13 @@ __metadata: "ra-language-slovak@npm:^3.6.2": version: 3.6.2 resolution: "ra-language-slovak@npm:3.6.2" - checksum: 4f16c11a9268b856b58f68aee8c08b3ad165fbe6bd9914de777b3212cd14a9a42d970fd0da72111cc3ae6e41136a8a327ca171ab573b7e66a152d9228984c70c + checksum: 10/e707ed6519349d56ec10005c72ab31e1ec98ff59894a64c44e2c82faab116eaaabe08188de0fd18fdfbf1057284aa239b19de5e29580da5caa241542d94484ba languageName: node linkType: hard -"ra-ui-materialui@npm:^4.16.20": - version: 4.16.20 - resolution: "ra-ui-materialui@npm:4.16.20" +"ra-ui-materialui@npm:^5.4.0": + version: 5.4.0 + resolution: "ra-ui-materialui@npm:5.4.0" dependencies: "@tanstack/react-query": "npm:^5.21.7" autosuggest-highlight: "npm:^3.1.1" @@ -9852,27 +9794,7 @@ __metadata: languageName: node linkType: hard -"react-error-boundary@npm:^4.0.13": - version: 4.1.2 - resolution: "react-error-boundary@npm:4.1.2" - dependencies: - "@babel/runtime": ^7.12.5 - peerDependencies: - react: ">=16.13.1" - checksum: afe692f1bbbfb5998b49e1001d7682a3cbfdc623dca1318b408e738606f3450d925c28fbbfa5dc84d2cf285d17c2e7f079d59386a27da354dea9c902a935149b - languageName: node - linkType: hard - -"react-hook-form@npm:^7.43.9": - version: 7.43.9 - resolution: "react-hook-form@npm:7.43.9" - peerDependencies: - react: ^16.8.0 || ^17 || ^18 - checksum: 65b94de625f2b7921c4e856bf0abbe142bfe06c052217bd1bcc3a842e2cc37fa3a3e03758119dc038bbcf5edb49e02c29206528b80b201f9a4d601471ef78153 - languageName: node - linkType: hard - -"react-hook-form@npm:^7.53.2": +"react-hook-form@npm:^7.53.0, react-hook-form@npm:^7.53.2": version: 7.53.2 resolution: "react-hook-form@npm:7.53.2" peerDependencies: @@ -11844,66 +11766,66 @@ __metadata: version: 0.0.0-use.local resolution: "webstrom-frontend@workspace:." dependencies: - "@emotion/react": ^11.13.5 - "@emotion/styled": ^11.13.5 - "@mui/icons-material": ^5.16.7 - "@mui/material": ^5.16.7 - "@svgr/webpack": ^8.1.0 - "@tanstack/react-query": 5.61.0 - "@tanstack/react-query-devtools": 5.61.0 - "@testing-library/dom": ^9.3.4 - "@testing-library/jest-dom": ^5.17.0 - "@testing-library/react": ^14.3.1 - "@testing-library/user-event": ^14.5.2 - "@types/jest": ^29.5.14 - "@types/katex": ^0.16.7 - "@types/luxon": ^3.4.2 - "@types/node": ^20.17.7 - "@types/react": ^19.0.0-rc.1 - "@types/react-dom": ^19.0.0-rc.1 - "@types/react-router-dom": ^5.3.3 - "@typescript-eslint/eslint-plugin": ^8.15.0 - "@typescript-eslint/parser": ^8.15.0 - axios: ^1.7.7 - clsx: ^2.1.1 - confusing-browser-globals: ^1.0.11 - eslint: ^8.57.1 - eslint-config-next: 15.0.3 - eslint-config-prettier: ^9.1.0 - eslint-plugin-eslint-comments: ^3.2.0 - eslint-plugin-filenames: ^1.3.2 - eslint-plugin-import: ^2.31.0 - eslint-plugin-jest: ^28.9.0 - eslint-plugin-no-secrets: ^1.1.2 - eslint-plugin-node: ^11.1.0 - eslint-plugin-prettier: ^5.2.1 - eslint-plugin-promise: ^7.1.0 - eslint-plugin-security: ^3.0.1 - eslint-plugin-simple-import-sort: ^12.1.1 - eslint-plugin-unicorn: ^56.0.1 - katex: ^0.16.11 - luxon: ^3.5.0 - mathjax-full: ^3.2.2 - mathjax-react: ^2.0.1 - next: 15.0.3 - prettier: ^3.3.3 - ra-i18n-polyglot: ^5.4.0 - ra-language-slovak: ^3.6.2 - react: 19.0.0-rc-66855b96-20241106 - react-admin: ^4.16.20 - react-cookie: ^4.1.1 - react-dom: 19.0.0-rc-66855b96-20241106 - react-dropzone: ^14.3.5 - react-hook-form: ^7.53.2 - react-markdown: ^9.0.1 - rehype-katex: ^7.0.1 - remark-gfm: ^4.0.0 - remark-math: ^6.0.0 - sass: ^1.81.0 - typed-scss-modules: ^8.0.1 - typescript: ^5.7.2 - unstated-next: ^1.1.0 - usehooks-ts: ^3.1.0 + "@emotion/react": "npm:^11.13.5" + "@emotion/styled": "npm:^11.13.5" + "@mui/icons-material": "npm:^5.16.7" + "@mui/material": "npm:^5.16.7" + "@svgr/webpack": "npm:^8.1.0" + "@tanstack/react-query": "npm:5.61.0" + "@tanstack/react-query-devtools": "npm:5.61.0" + "@testing-library/dom": "npm:^9.3.4" + "@testing-library/jest-dom": "npm:^5.17.0" + "@testing-library/react": "npm:^14.3.1" + "@testing-library/user-event": "npm:^14.5.2" + "@types/jest": "npm:^29.5.14" + "@types/katex": "npm:^0.16.7" + "@types/luxon": "npm:^3.4.2" + "@types/node": "npm:^20.17.7" + "@types/react": "npm:^19.0.0-rc.1" + "@types/react-dom": "npm:^19.0.0-rc.1" + "@types/react-router-dom": "npm:^5.3.3" + "@typescript-eslint/eslint-plugin": "npm:^8.15.0" + "@typescript-eslint/parser": "npm:^8.15.0" + axios: "npm:^1.7.7" + clsx: "npm:^2.1.1" + confusing-browser-globals: "npm:^1.0.11" + eslint: "npm:^8.57.1" + eslint-config-next: "npm:15.0.3" + eslint-config-prettier: "npm:^9.1.0" + eslint-plugin-eslint-comments: "npm:^3.2.0" + eslint-plugin-filenames: "npm:^1.3.2" + eslint-plugin-import: "npm:^2.31.0" + eslint-plugin-jest: "npm:^28.9.0" + eslint-plugin-no-secrets: "npm:^1.1.2" + eslint-plugin-node: "npm:^11.1.0" + eslint-plugin-prettier: "npm:^5.2.1" + eslint-plugin-promise: "npm:^7.1.0" + eslint-plugin-security: "npm:^3.0.1" + eslint-plugin-simple-import-sort: "npm:^12.1.1" + eslint-plugin-unicorn: "npm:^56.0.1" + katex: "npm:^0.16.11" + luxon: "npm:^3.5.0" + mathjax-full: "npm:^3.2.2" + mathjax-react: "npm:^2.0.1" + next: "npm:15.0.3" + prettier: "npm:^3.3.3" + ra-i18n-polyglot: "npm:^5.4.0" + ra-language-slovak: "npm:^3.6.2" + react: "npm:19.0.0-rc-66855b96-20241106" + react-admin: "npm:^5.4.0" + react-cookie: "npm:^4.1.1" + react-dom: "npm:19.0.0-rc-66855b96-20241106" + react-dropzone: "npm:^14.3.5" + react-hook-form: "npm:^7.53.2" + react-markdown: "npm:^9.0.1" + rehype-katex: "npm:^7.0.1" + remark-gfm: "npm:^4.0.0" + remark-math: "npm:^6.0.0" + sass: "npm:^1.81.0" + typed-scss-modules: "npm:^8.0.1" + typescript: "npm:^5.7.2" + unstated-next: "npm:^1.1.0" + usehooks-ts: "npm:^3.1.0" languageName: unknown linkType: soft From f40e4ae6637bf1b937d2b6b97ee6538fc93ef159 Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Sat, 14 Dec 2024 13:43:15 +0100 Subject: [PATCH 10/12] fix typo --- src/components/Admin/translations/sk_SK.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index 463005ff..1d707457 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -113,7 +113,7 @@ export const sk_SK = { }, }, 'competition/event-registration': { - name: 'Registácia do súťaží', + name: 'Registrácia do súťaží', fields: { school: { abbreviation: 'Škola', From fe5685319c68048026d8a42e2e9ecec6338110bf Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Sat, 14 Dec 2024 13:50:10 +0100 Subject: [PATCH 11/12] fix typo --- src/components/Admin/translations/sk_SK.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index 1d707457..5563660d 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -62,7 +62,7 @@ export const sk_SK = { end: 'registration_link.end', additional_info: 'Ďalšie informácie', }, - publication_set: 'Pubikácie', + publication_set: 'Publikácie', }, }, 'competition/semester': { From 511a56cab976d379b8006761df0953ccd23e770b Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sat, 14 Dec 2024 14:30:27 +0100 Subject: [PATCH 12/12] Translation improvements --- src/components/Admin/custom/SeasonCodeField.tsx | 6 ++++-- .../competition/semester/SemesterList.tsx | 2 -- .../competition/semester/SemesterShow.tsx | 3 --- .../competition/semester/seasonCodeStrings.ts | 5 ----- src/components/Admin/seasonCodeStrings.ts | 6 +++--- src/components/Admin/translations/sk_SK.ts | 17 +++++++++++++++-- 6 files changed, 22 insertions(+), 17 deletions(-) delete mode 100644 src/components/Admin/resources/competition/semester/seasonCodeStrings.ts diff --git a/src/components/Admin/custom/SeasonCodeField.tsx b/src/components/Admin/custom/SeasonCodeField.tsx index ef821dad..5c8ed45c 100644 --- a/src/components/Admin/custom/SeasonCodeField.tsx +++ b/src/components/Admin/custom/SeasonCodeField.tsx @@ -1,14 +1,16 @@ import {FC} from 'react' -import {FunctionField, FunctionFieldProps} from 'react-admin' +import {FunctionField, FunctionFieldProps, useTranslate} from 'react-admin' import {seasonCodeStrings} from '../seasonCodeStrings' export const SeasonCodeField: FC> = ({source, ...rest}) => { + const translate = useTranslate() + return ( { - return `${seasonCodeStrings[record.season_code].name ?? ''}` + return translate(seasonCodeStrings[record.season_code].name ?? '') }} {...rest} /> diff --git a/src/components/Admin/resources/competition/semester/SemesterList.tsx b/src/components/Admin/resources/competition/semester/SemesterList.tsx index 7f2a8c06..729e617f 100644 --- a/src/components/Admin/resources/competition/semester/SemesterList.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterList.tsx @@ -13,8 +13,6 @@ import { import {DateTimeField} from '@/components/Admin/custom/DateTimeField' import {SeasonCodeField} from '@/components/Admin/custom/SeasonCodeField' -import {seasonCodeStrings} from './seasonCodeStrings' - export const SemesterList: FC = () => ( diff --git a/src/components/Admin/resources/competition/semester/SemesterShow.tsx b/src/components/Admin/resources/competition/semester/SemesterShow.tsx index 61715520..30473017 100644 --- a/src/components/Admin/resources/competition/semester/SemesterShow.tsx +++ b/src/components/Admin/resources/competition/semester/SemesterShow.tsx @@ -3,7 +3,6 @@ import { ArrayField, BooleanField, Datagrid, - FunctionField, NumberField, ReferenceArrayField, ReferenceField, @@ -18,8 +17,6 @@ import {MyShow} from '@/components/Admin/custom/MyShow' import {SeasonCodeField} from '@/components/Admin/custom/SeasonCodeField' import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField' -import {seasonCodeStrings} from './seasonCodeStrings' - export const SemesterShow: FC = () => ( diff --git a/src/components/Admin/resources/competition/semester/seasonCodeStrings.ts b/src/components/Admin/resources/competition/semester/seasonCodeStrings.ts deleted file mode 100644 index 92d94ac5..00000000 --- a/src/components/Admin/resources/competition/semester/seasonCodeStrings.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const seasonCodeStrings = [ - {id: 0, name: 'Zimný'}, - {id: 1, name: 'Letný'}, - {id: 2, name: 'Iný'}, -] diff --git a/src/components/Admin/seasonCodeStrings.ts b/src/components/Admin/seasonCodeStrings.ts index 92d94ac5..496a989d 100644 --- a/src/components/Admin/seasonCodeStrings.ts +++ b/src/components/Admin/seasonCodeStrings.ts @@ -1,5 +1,5 @@ export const seasonCodeStrings = [ - {id: 0, name: 'Zimný'}, - {id: 1, name: 'Letný'}, - {id: 2, name: 'Iný'}, + {id: 0, name: 'content.seasons.winter'}, + {id: 1, name: 'content.seasons.summer'}, + {id: 2, name: 'content.seasons.other'}, ] diff --git a/src/components/Admin/translations/sk_SK.ts b/src/components/Admin/translations/sk_SK.ts index 5563660d..46f12e6d 100644 --- a/src/components/Admin/translations/sk_SK.ts +++ b/src/components/Admin/translations/sk_SK.ts @@ -3,6 +3,14 @@ import slovakMessages from 'ra-language-slovak' export const sk_SK = { ra: { ...slovakMessages.ra, + page: { + ...slovakMessages.ra.page, + list: '%{name}', + }, + sort: { + ASC: 'Vzostupne', + DESC: 'Zostupne', + }, }, resources: { 'cms/post': { @@ -18,7 +26,7 @@ export const sk_SK = { links: 'Odkazy', }, }, - 'base/flat-page': { + 'cms/flat-page': { name: 'Ploché stránky', fields: { id: 'ID', @@ -113,7 +121,7 @@ export const sk_SK = { }, }, 'competition/event-registration': { - name: 'Registrácia do súťaží', + name: 'Registrácie do súťaží', fields: { school: { abbreviation: 'Škola', @@ -180,5 +188,10 @@ export const sk_SK = { footer: { timezone_message: 'Všetky časy sú uvedené v časovom pásme Europe/Bratislava', }, + seasons: { + winter: 'Zimný', + summer: 'Letný', + other: 'Iný', + }, }, }