mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 10:51:02 +00:00
feat: parse locale before ww init
This commit is contained in:
@@ -120,11 +120,16 @@ export function App() {
|
|||||||
async (token?: string, locale?: string) => {
|
async (token?: string, locale?: string) => {
|
||||||
if (wokwondersRef.current) return;
|
if (wokwondersRef.current) return;
|
||||||
|
|
||||||
|
const possibleLocales = ["en", "pt", "ru"];
|
||||||
|
|
||||||
|
const parsedLocale =
|
||||||
|
possibleLocales.find((l) => l === locale?.slice(0, 2)) ?? "en";
|
||||||
|
|
||||||
wokwondersRef.current = new WorkWondersSdk();
|
wokwondersRef.current = new WorkWondersSdk();
|
||||||
await wokwondersRef.current.init({
|
await wokwondersRef.current.init({
|
||||||
organization: "hydra",
|
organization: "hydra",
|
||||||
token,
|
token,
|
||||||
locale,
|
locale: parsedLocale,
|
||||||
});
|
});
|
||||||
|
|
||||||
await wokwondersRef.current.initChangelogWidget();
|
await wokwondersRef.current.initChangelogWidget();
|
||||||
|
|||||||
Reference in New Issue
Block a user