Feat/i18n crowdin (#752)

* feat: add crowdin and supported languages

* fix: main branch name

* feat: test crowdin integration

* feat: add crowdin config skeleton

* feat: update crowdin.yml

* fix: remove ro translation

* test: en translation

* test: en translation

* New Crowdin translations by Github Action (#735)

Co-authored-by: Crowdin Bot <[email protected]>

* test: en translation

* fix: separate upload/download workflows

* wip

* New Crowdin translations by Github Action (#738)

Co-authored-by: Crowdin Bot <[email protected]>

* wip

* wip

* wip

* wip

* wip

* typo

* wip

* wip

* update crowdin config

* update

* chore: support i18n de,es,fr,it,pt,ru,ro,en

* chore: extract i18n strings

* chore: extract booking components strings for i18n

* wip

* extract more strings

* wip

* fallback to getServerSideProps for now

* New Crowdin translations by Github Action (#874)

Co-authored-by: Crowdin Bot <[email protected]>

* fix: minor fixes on the datepicker

* fix: add dutch lang

* fix: linting issues

* fix: string

* fix: update GHA

* cleanup trpc

* fix linting

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
authored and GitHub committed 2021-10-08 14:43:48 +03:00
1 parent 33a683d4b0
commit 2c9b301b77
46 files changed
+2805 -1876

No files matched your search

+9 -2
View File
@@ -6,8 +6,8 @@ import prisma from "@lib/prisma";
import { i18n } from "../../../next-i18next.config";
export const extractLocaleInfo = async (req: IncomingMessage) => {
const session = await getSession({ req: req });
export const getOrSetUserLocaleFromHeaders = async (req: IncomingMessage) => {
const session = await getSession({ req });
const preferredLocale = parser.pick(i18n.locales, req.headers["accept-language"]);
if (session?.user?.id) {
@@ -58,7 +58,14 @@ interface localeType {
export const localeLabels: localeType = {
en: "English",
fr: "French",
it: "Italian",
ru: "Russian",
es: "Spanish",
de: "German",
pt: "Portuguese",
ro: "Romanian",
nl: "Dutch",
};
export type OptionType = {
+2 -2
View File
@@ -1,10 +1,10 @@
import { useTranslation } from "next-i18next";
type LocaleProps = {
type LocaleProp = {
localeProp: string;
};
export const useLocale = (props: LocaleProps) => {
export const useLocale = (props: LocaleProp) => {
const { i18n, t } = useTranslation("common");
if (i18n.language !== props.localeProp) {