Built on top of create-react-app
- make sure your current working directory is
./frontend npm install- install the dependenciesnpm run start- run app in dev mode- 🚀open http://localhost:3000 to view it in the browser, HMR enabled 🚀
(the admin user login credentials are username:
adminpassword:admin)
npm run test and npm run lint
To have your GraphQL operations properly typed, you have to generate the typescript types via following:
- add a graphql query the component (preferably to
queries.tsnext to the component file) - run
npm run generate:types - import the generated type to your component from
./src/__generated__/types.ts
- add a language locale string to
localesin./i18next-parser.config.js - add translations JSON import to resources in
./src/i18n.ts - translate the whole JSON to the language you have chosen
- add/change the languages available to select in
./src/components/LanguageSwitch/LanguageSwitch.tsx
If you add any text string and you want that string translated, follow these steps:
- add a translated string to a component, e.g.:
import { useTranslation } from 'react-i18next';
...
const { t } = useTranslation();
return <div>{t('This is going to be translated')}</div>
...- save that file
- run
npm run extract:translations - if the string wasnt translated yet, it will appear in
./src/locales/cs/translation.json