Fixed path for loading resource bundles (#3074)
This commit is contained in:
parent
09d7194f9b
commit
108f4048bd
1 changed files with 4 additions and 1 deletions
|
@ -5,6 +5,7 @@ import type KeycloakAdminClient from "@keycloak/keycloak-admin-client";
|
||||||
|
|
||||||
import environment from "./environment";
|
import environment from "./environment";
|
||||||
import { getAuthorizationHeaders } from "./utils/getAuthorizationHeaders";
|
import { getAuthorizationHeaders } from "./utils/getAuthorizationHeaders";
|
||||||
|
import { addTrailingSlash } from "./util";
|
||||||
|
|
||||||
export const DEFAULT_LOCALE = "en";
|
export const DEFAULT_LOCALE = "en";
|
||||||
|
|
||||||
|
@ -18,7 +19,9 @@ const initOptions = async (
|
||||||
): Promise<InitOptions> => {
|
): Promise<InitOptions> => {
|
||||||
const constructLoadPath: LoadPathOption = (_, namespaces) => {
|
const constructLoadPath: LoadPathOption = (_, namespaces) => {
|
||||||
if (namespaces[0] === "overrides") {
|
if (namespaces[0] === "overrides") {
|
||||||
return `/admin/realms/${adminClient.realmName}/localization/{{lng}}?useRealmDefaultLocaleFallback=true`;
|
return `${addTrailingSlash(adminClient.baseUrl)}admin/realms/${
|
||||||
|
adminClient.realmName
|
||||||
|
}/localization/{{lng}}?useRealmDefaultLocaleFallback=true`;
|
||||||
} else {
|
} else {
|
||||||
return `${environment.resourceUrl}/resources/{{lng}}/{{ns}}.json`;
|
return `${environment.resourceUrl}/resources/{{lng}}/{{ns}}.json`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue