🌐(react) add i18n

We need to be able to use localized texts for various components, like for
accessible labels. We decided to setup a lightweight implementation of
localizable to avoid relying on an existing heavy library.
The Provider includes by default full translations for english, and it is
also made to be able to load easily any custom locale directly from the
Provider.
This commit is contained in:
Nathan Vasse
2023-02-20 16:26:30 +01:00
committed by NathanVss
parent 1df3b82571
commit 90feb4ba4a
14 changed files with 322 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ COMPOSE_RUN = $(COMPOSE) run --rm --service-ports
# permission error.
COMPOSE_RUN_NODE = $(COMPOSE_RUN) -e HOME="/tmp" node
YARN = $(COMPOSE_RUN_NODE) yarn
CROWDIN = $(COMPOSE_RUN) crowdin crowdin
# ==============================================================================
# RULES
@@ -54,7 +55,9 @@ install: ## install all repos dependencies.
.PHONY: install
bootstrap: ## install all repos dependencies and build them too.
bootstrap: build
bootstrap: \
env.d/crowdin \
build
.PHONY: bootstrap
dev: ## watch changes in apps and packages.
@@ -82,6 +85,19 @@ deploy: install
@$(YARN) deploy
.PHONY: deploy
# -- Misc
env.d/crowdin:
cp env.d/crowdin.dist env.d/crowdin
# -- Internationalization
crowdin-upload:
@$(CROWDIN) upload sources -c crowdin/config.yml
.PHONY: crowdin-upload
crowdin-download:
@$(CROWDIN) download -c crowdin/config.yml
.PHONY: crowdin-download
clean: ## restore repository state as it was freshly cloned
git clean -idx
.PHONY: clean