question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛[BUG] Layout:false does not inject locale into components

See original GitHub issue

🐛 bug 描述

In routes.ts when layout:false the locale is not injected into ANTD Pro Components.

📷 复现步骤 Steps to reproduce

Observe here: https://preview.pro.ant.design/user/login/ the Login button remains in Chinese even if language is changed.

🏞 期望结果 Expected results

The button language should change.

💻 复现代码 Reproduce the code

If we have
(pay attention to layout:false)

    {
      path: '/user',
      routes: [
        {
          path: '/user/login',
          layout: false,
          name: 'login',
          component: './user/Login',
        },
...

The locale is ‘default’ which is just Chinese. image

If we have layout:true

    {
      path: '/user',
      routes: [
        {
          path: '/user/login',
          layout: true,
          name: 'login',
          component: './user/Login',
        },
...

layout_true

© 版本信息

  • Ant Design Pro 版本: 5
  • umi 版本 3.5.2
  • 浏览器环境
  • 开发环境 Windows 10

🚑 其他信息

Issue #9179

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
adrinrcommented, Dec 19, 2021

After waiting for a fix for it, I managed to solve my issue following the submitter configuration https://procomponents.ant.design/en-US/components/form/

Good to know. But this more of a hack then a solution. The behaviours logic is hidden. It should be done in the demo to demonstrate.

Completely agree, I just posted the workaround. It would be great if this can be reopen and properly fixed

0reactions
jaybceecommented, Dec 18, 2021

After waiting for a fix for it, I managed to solve my issue following the submitter configuration https://procomponents.ant.design/en-US/components/form/

Good to know. But this more of a hack then a solution. The behaviours logic is hidden. It should be done in the demo to demonstrate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layouts and Rendering in Rails - Ruby on Rails Guides
Layouts and Rendering in Rails. This guide covers the basic layout features of Action Controller and Action View. After reading this guide, you...
Read more >
Get current locale in a child component - vue.js - Stack Overflow
I've installed vue-i18n in cli ui. The translation with $t("message") is working but I have error when i try to access to i18n.locale....
Read more >
Bugzilla for localizers - Documentation for Mozilla localizers
Triage localization bugs. Follow the Bugzilla component for your locale; Saved searches; Confirm and close bugs. Bugzilla is the system used to track...
Read more >
The Ultimate Guide to Angular Localization | Phrase
It's no surprise that Angular has robust built-in i18n support. ... Add to cart ... How do I configure the supported locales in...
Read more >
I18n with Storybook - JS.ORG
Let's use i18next to extend Storybook with a locale switcher in the toolbar to choose which locale is shared with your components. Follow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found