Source code of CSAuto website. ( CSAuto repo )
- jinja templates
- markdown-it-py for rendering FAQ and Changelog from main repo
- picocss as css framework
- Vercel for deploy
- httpx as main HTTP client (mainly for GitHub)
- loguru to log
- Also, FastAPI and Uvicorn for live debugging
- python-dotenv for reading .env files
- Babel for help with localizing
- Font Awesome svg icons
- Scoop svg logo by @xmha97
Requirements:
- Python 3.12
- Poetry
Firstly, you need to install dependencies (ofc, after cloning and going to dir) and activate shell
poetry install --with dev --no-root
poetry shell
LOGURU_LEVEL
- Used by loguru. For more loguru envvars see this
- Default:
DEBUG
- Value:
TRACE
,DEBUG
,INFO
CSAUTO_BASE_URL
- Needed for canonical urls, Open Graph and etc.
- Default:
https://csauto.vercel.app/
- Value: https url to website. If web does not have simple domain (
example.github.io/cs-auto
), you must put trailing slash to the end of it (likehttps://example.github.io/cs-auto/
)
CSAUTO_GH_REPO
- Used by GH reference parser
- Default:
MurkyYT/CSAuto
CSAUTO_DEFAULT_BRANCH
- Used for accessing files on main repo like
FullChangelog.MD
orREADME.md
- Default:
master
- Used for accessing files on main repo like
CSAUTO_DISABLE_META
- Disables all meta tags to escape any misunderstandings with search indexers
- Default: False
- Value: Boolean (
True
/False
or1
/0
)
CSAUTO_LIVE_PROVIDER
README.md
andFullChangelog.md
provider. If you decide to switch this tolocal
, you must specify where they are throughCSAUTO_CHANGELOG
,CSAUTO_README_EN
andCSAUTO_README_RU
- Default:
github
- Value:
github
orlocal
CSAUTO_LOAD_GH_CACHE
- Toggles GitHub data cache saving into
gh_cache.json
- Default: False
- Value: Boolean (
True
/False
or1
/0
)
- Toggles GitHub data cache saving into
Translate CSAuto first
-
Language codes with territories are undesirable
ru_MD➡ ruen_CA➡ en
-
Use
<br>
to go to new line -
If you see closing tag in original, you must write same closing tag in translation
-
Extract strings
pybabel -v extract -F .\babel.cfg -o ".\languages\messages.pot" --project "csauto-web" --sort-by-file .
-
Init new language
pybabel init -d .\languages\ -i .\languages\messages.pot -l {LOCALE}
-
How to update
pybabel update -d .\languages\ -i .\languages\messages.pot -l {LOCALE}
-
Compile .po to .mo
pybabel compile -d .\languages\
Steps to manually add new language:
- Extract strings
- Init new language
- Edit lines in
shared.py
- Add support for translations
- Add WebLate support