murattkoc commented on issue #38178: URL: https://github.com/apache/superset/issues/38178#issuecomment-3943041793
@DosuBot > Hi [@murattkoc](https://github.com/murattkoc)! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. > > This is a [known issue in Superset 6.0.0](https://github.com/apache/superset/discussions/34885) where the login page doesn't load translations correctly for unauthenticated users. The error `"Failed to fetch language pack... Unexpected token '<'"` happens because the frontend is trying to fetch a deprecated `/superset/language_pack/` endpoint that no longer exists in 6.0.0. > > **Workaround for v6.0.0** - Add this to your `superset_config.py`: > > from superset.translations.utils import get_language_pack > > def bootstrap_overrides(bootstrap_data): > bootstrap_data["locale"] = "tr" > bootstrap_data["language_pack"] = get_language_pack("tr") > return bootstrap_data > > COMMON_BOOTSTRAP_OVERRIDES_FUNC = bootstrap_overrides > This explicitly loads the Turkish language pack for unauthenticated users. If that doesn't work, try using `"tr_TR"` instead of `"tr"` (depending on how your translation files are named). > > [PR #36893](https://github.com/apache/superset/pull/36893) has fixed this issue but it was merged after v6.0.0, so you'll need to use the workaround until you upgrade to a newer release. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0ee1358f-4602-4ae7-a6e9-be1e18b315ab?feedback_type=other) > > [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20is%20a%20%5Bknown%20issue%20in%20Superset%206.0.0%5D%28https%3A//github.com/apache/superset/discussions/34885%29%20where%20the%20login%20page%20doesn%27t%20load%20translations%20correctly%20for%20unauthenticated%20users.%20The%20error%20%60%22Failed%20to%20fetch%20language%20pack...%20Unexpected%20token%20%27%3C%27%22%60%20happens%20because%20the%20frontend%20is%20trying%20to%20fetch%20a%20deprecated%20%60/superset/language_pack/%60%20endpoint%20that%20no%20longer%20exists%20in %206.0.0.%0A%0A%2A%2AWorkaround%20for%20v6.0.0%2A%2A%20-%20Add%20this%20to%20your%20%60superset_config.py%60%3A%0A%0A%60%60%60python%0Afrom%20superset.translations.utils%20import%20get_language_pack%0A%0Adef%20bootstrap_overrides%28bootstrap_data%29%3A%0A%20%20%20%20bootstrap_data%5B%22locale%22%5D%20%3D%20%22tr%22%0A%20%20%20%20bootstrap_data%5B%22language_pack%22%5D%20%3D%20get_language_pack%28%22tr%22%29%0A%20%20%20%20return%20bootstrap_data%0A%0ACOMMON_BOOTSTRAP_OVERRIDES_FUNC%20%3D%20bootstrap_overrides%0A%60%60%60%0A%0AThis%20explicitly%20loads%20the%20Turkish%20language%20pack%20for%20unauthenticated%20users.%20If%20that%20doesn%27t%20work%2C%20try%20using%20%60%22tr_TR%22%60%20instead%20of%20%60%22tr%22%60%20%28depending%20on%20how%20your%20translation%20files%20are%20named%29.%0A%0A%5BPR%20%2336893%5D%28https%3A//github.com/apache/superset/pull/36893%29%20has%20fixed%20this%20issue%20but%20it%20was%20merged%20after%20v6.0.0%2C%20so%20you%27ll%20need%20to%20use%20the%20worka round%20until%20you%20upgrade%20to%20a%20newer%20release.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38178) @ -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
