Update translation URL and add frontend docs
This commit is contained in:
parent
a138811ff3
commit
c7c24390b3
4 changed files with 31 additions and 32 deletions
21
frontend/README.md
Normal file
21
frontend/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Crab Fit Frontend
|
||||
|
||||
This is the frontend for Crab Fit, written in TypeScript and SCSS, using Next.js app router.
|
||||
|
||||
## Environment
|
||||
|
||||
Default environment variables are provided in `.env.local`. This should work out of the box while developing with the API. To change or add variables, create a `.env` file which will override any values in `.env.local`.
|
||||
|
||||
## Using VSCode
|
||||
|
||||
If you're using VSCode to edit the frontend, be sure to open the `frontend` folder specifically as your workspace, so you can select the workspace typescript version. This will give you type safety for css modules using the [typescript-plugin-css-modules](https://github.com/mrmckeb/typescript-plugin-css-modules) package.
|
||||
|
||||
## Translations
|
||||
|
||||
Translation files are located in `frontend/src/i18n/locales`. If you need to add any new strings, make sure you only edit the resources in the `en` folder. Any changes to the other languages including translation of new strings and deletion of removed strings are handled by Transifex.
|
||||
|
||||
## Temporal API
|
||||
|
||||
Crab Fit uses the new Temporal API for all date/time calculations and comparisons. Because this API is not yet supported by any browsers, the [@temporal-js/polyfill](https://github.com/js-temporal/temporal-polyfill) library is used, with the intention to remove this eventually once support is stable in all major browsers.
|
||||
|
||||
Note that much of the Temporal logic is run only when necessary, as the polyfill being used is not optimised and will slow down the frontend otherwise.
|
||||
|
|
@ -46,17 +46,5 @@
|
|||
"sass": "^1.63.2",
|
||||
"typescript": "^5.1.3",
|
||||
"typescript-plugin-css-modules": "^5.0.1"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const TranslateDialog = () => {
|
|||
<Button
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href={`https://docs.google.com/forms/d/e/1FAIpQLSd5bcs8LTP_8Ydrh2e4iMlZft5x81qSfAxekuuQET27A2mBhA/viewform?usp=pp_url&entry.1530835706=__other_option__&entry.1530835706.other_option_response=${encodeURIComponent(navigator.language)}`}
|
||||
href="https://explore.transifex.com/crab-fit/crab-fit/"
|
||||
>Help translate!</Button>
|
||||
<Button isSecondary onClick={() => store.dismissDialog()}>Close</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue