diff --git a/environments/.env.develop b/environments/.env.develop index 9c4baf6..5ae757c 100644 --- a/environments/.env.develop +++ b/environments/.env.develop @@ -10,4 +10,7 @@ AURA_YANDEX_COUNTER_NUMBER=95799066 AURA_PERSONAL_VIDEO_TIME_LIMIT=180 AURA_GA_MEASUREMENT_ID=G-ECQDS5X0EH AURA_UNLEASH_URL=https://unleash.admin.witapps.us/api/frontend -AURA_UNLEASH_CLIENT_KEY=*:development.7f714f98ed6e9128ae3c99906267292a4e34280d1a16becd2f0794b6 \ No newline at end of file +AURA_UNLEASH_CLIENT_KEY=*:development.7f714f98ed6e9128ae3c99906267292a4e34280d1a16becd2f0794b6 + +AURA_TRANSLATIONS_CDN=https://dev.api.aura.witapps.us +WITLAB_TRANSLATIONS_CDN=https://dev.api.aura.witapps.us \ No newline at end of file diff --git a/environments/.env.production b/environments/.env.production index 62b1db1..f448efd 100644 --- a/environments/.env.production +++ b/environments/.env.production @@ -10,4 +10,7 @@ AURA_YANDEX_COUNTER_NUMBER=95799066 AURA_PERSONAL_VIDEO_TIME_LIMIT=100 AURA_GA_MEASUREMENT_ID=G-4N17LL3BB5 AURA_UNLEASH_URL=https://unleash.admin.witapps.us/api/frontend -AURA_UNLEASH_CLIENT_KEY=*:production.381ec8a37c977e928ff5ea8809fd943b7caff4232af6df8443903203 \ No newline at end of file +AURA_UNLEASH_CLIENT_KEY=*:production.381ec8a37c977e928ff5ea8809fd943b7caff4232af6df8443903203 + +AURA_TRANSLATIONS_CDN=https://cdn.aura.witapps.us +WITLAB_TRANSLATIONS_CDN=https://cdn.witlab.app \ No newline at end of file diff --git a/src/api/resources/Session.ts b/src/api/resources/Session.ts index 8e1c4bc..6ede85a 100644 --- a/src/api/resources/Session.ts +++ b/src/api/resources/Session.ts @@ -225,7 +225,7 @@ export interface PayloadGetLocale { } export const getLocaleRequest = (data: PayloadGetLocale) => { - const url = new URL(routes.server.getLocale()); + const url = new URL(routes.server.getLocaleCDN()); const body = JSON.stringify(data); return new Request(url, { method: "POST", diff --git a/src/routes.ts b/src/routes.ts index 7c7111f..d82f514 100755 --- a/src/routes.ts +++ b/src/routes.ts @@ -590,6 +590,14 @@ const routes = { createSession: () => [dApiHost, dApiPrefix, "session"].join("/"), updateSession: (id: string) => [dApiHost, dApiPrefix, "session", id].join("/"), getLocale: () => [dApiHost, dApiPrefix, "session", "locale"].join("/"), + getLocaleCDN: () => { + const currentDomain = window.location.hostname; + const isWitlabDomain = currentDomain.includes('witlab.app'); + const cdnHost = isWitlabDomain + ? import.meta.env.WITLAB_TRANSLATIONS_CDN + : import.meta.env.AURA_TRANSLATIONS_CDN; + return [cdnHost, dApiPrefix, "session", "locale"].join("/"); + }, getPixels: () => [dApiHost, dApiPrefix, "session", "pixels"].join("/"), getFunnel: () => [dApiHost, dApiPrefix, "session", "funnel"].join("/"),