sunank200 commented on code in PR #54008:
URL: https://github.com/apache/airflow/pull/54008#discussion_r2251297051


##########
airflow-core/src/airflow/ui/src/i18n/config.ts:
##########
@@ -37,13 +37,17 @@ export const supportedLanguages = [
 export const defaultLanguage = "en";
 export const namespaces = ["common", "dashboard", "dags", "admin", "browse", 
"assets", "components"] as const;
 
+const baseHref = document.querySelector("head > base")?.getAttribute("href") 
?? "";
+const baseUrl = new URL(baseHref, globalThis.location.origin);
+const basePath = new URL(baseUrl).pathname.replace(/\/$/u, "");
+
 void i18n
   .use(Backend)
   .use(LanguageDetector)
   .use(initReactI18next)
   .init({
     backend: {
-      loadPath: "/static/i18n/locales/{{lng}}/{{ns}}.json",
+      loadPath: `${basePath}/static/i18n/locales/{{lng}}/{{ns}}.json`,

Review Comment:
   Reverted it back to original logic: 
https://github.com/apache/airflow/pull/54008/commits/3997e58e36368e999b3d399baf87b19fbe8b0a59
 as it is not handling especial characters properly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to