feat(SW-706): use Lokalise

This commit is contained in:
Michael Zetterberg
2025-04-09 13:16:45 +02:00
parent 440e1f92df
commit 65932ddfd3
10 changed files with 35595 additions and 6268 deletions
+17
View File
@@ -4,6 +4,8 @@ import { IntlProvider } from "react-intl"
import type { ClientIntlProviderProps } from "@/types/i18n"
const logged: Record<string, boolean> = {}
export default function ClientIntlProvider({
children,
locale,
@@ -15,6 +17,21 @@ export default function ClientIntlProvider({
locale={locale}
defaultLocale={defaultLocale}
messages={messages}
onError={(err) => {
let msg = err.message
if (err.code === "MISSING_TRANSLATION") {
const id = err.descriptor?.id
if (id) {
msg = id
}
}
if (!logged[msg]) {
logged[msg] = true
console.warn(err)
}
}}
>
{children}
</IntlProvider>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,20 @@
{
"WcBpRV": [
{
"type": 1,
"value": "roomSizeMin"
},
{
"type": 0,
"value": "-"
},
{
"type": 1,
"value": "roomSizeMax"
},
{
"type": 0,
"value": " m²"
}
]
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -158,7 +158,7 @@ export async function download(extractPath: string) {
icu_numeric: true,
bundle_structure: "%LANG_ISO%.%FORMAT%",
directory_prefix: "",
filter_data: ["last_reviewed_only"],
filter_data: ["translated", "nonhidden"],
export_empty_as: "skip",
})
performance.mark("lokaliseDownloadInitEnd")