-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(Datepicker): Hidden calendar button not in the selected language #25021
Comments
Since the |
How can we change it then? I showed a screenshot of the demo in the ticket, but I have the same issue in my code.
… Le 10 juin 2022 à 12:52, Zach Arend ***@***.***> a écrit :
Since the Close calendar string comes from the MatDatepickerIntl and is not hard-coded, this seems to be an issue with the demo, rather than the date picker itself.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
This demo needs to implement proving a different value for
Community contributions are welcome :). If your code only needs french and doesn't need English, you can provide
|
Thank you for your answer. I’m not to sure how you can change the injected value on the click event, but I got the general.
For now, I solved my issue by providing a factory for the overided class who subscribe on a language change event to switch label.
But I must admit, I’m curious about the ‘When clicking "Dynamically switch to French", inject MatDatepickerIntlFrinstead’? How do you change the injector dynamically? I did not see any function to do so within the DateAdapter?
… Le 17 juin 2022 à 13:21, Zach Arend ***@***.***> a écrit :
This demo needs to implement proving a different value for MatDatepickerIntl because that is where the "Close calendar" string comes from. Here are roughly the steps that need to happen to implement this in the demo.
extend MatDatepickerIntl with French strings
class MatDatepickerIntlFr extends MatDatepickerIntl {
closeCalendar: "
Fermer le calendrier"
// ...
}
Inject MatDatepickerIntl into the example.
When clicking "Dynamically switch to French", inject MatDatepickerIntlFr instead
Community contributions are welcome :).
If your code only needs french and doesn't need English, you can provide MatDatepickerIntlFr in your code. there would be no need to change it dynmically. The code would look something like:
provide: MatDatepickerIntl, useClass: MatDatepickerIntlFr
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
I believe this should be doable with a factory provider. Provide the locale as a dependency to the factory provider. The factory returns an instance of either |
I will try solve. |
Hey @maykonpacheco, are you still working on that issue? |
@GKosheev yes, do you have any suggestion? |
Talked though this with @amysorto , will be improving the example. |
Just an update on this, seems like there needs to be changes done on the to the datepicker-base.ts file. When locale updates happen, the class does not re-evaluate the value of the close calendar button. I think moving the initialization of the |
You can do intl.changes.next() after changing the value of the close button text so that the service knows something needs to be updated (MatDatepickerIntl docs). |
Is this issue still open? I would like to work on this. |
Hello @Gua00va , I believe this issue is still open, and you are welcome to work on it. -Zach |
…d up in lazy-loaded modules Along the same lines as angular#12934, where the consumer-provided instance was not being picked up within lazy-loaded modules. The fix also resolves an issue with the close button text when switching to French language in components-examples. fixes angular#25021
…ing picked up in lazy-loaded modules Along the same lines as angular#12934, where the consumer-provided instance was not being picked up within lazy-loaded modules. The fix also resolves an issue with the close button text when switching to French language in components-examples. fixes angular#25021
…ing picked up in lazy-loaded modules Along the same lines as angular#12934, where the consumer-provided instance was not being picked up within lazy-loaded modules. The fix also resolves an issue with the close button text when switching to French language in components-examples. fixes angular#25021
…ing picked up in lazy-loaded modules Along the same lines as angular#12934, where the consumer-provided instance was not being picked up within lazy-loaded modules. The fix also resolves an issue with the close button text when switching to French language in components-examples. fixes angular#25021
…ing picked up in lazy-loaded modules Along the same lines as angular#12934, where the consumer-provided instance was not being picked up within lazy-loaded modules. The fix also resolves an issue with the close button text when switching to French language in components-examples. fixes angular#25021
…ing picked up in lazy-loaded modules Along the same lines as angular#12934, where the consumer-provided instance was not being picked up within lazy-loaded modules. The fix also resolves an issue with the close button text when switching to French language in components-examples. fixes angular#25021
Previously, the close calendar label was not updating correctly when switching languages. This commit fixes that issue. Fixes: angular#25021
I believe this issue is still open, and you are welcome to work on it. |
i want to work on this issues please assign me issue |
function setCloseButtonLocale(locale) { switch (locale) { |
@piyushsrvastava, I wanted to bring to your attention that a pull request has already been submitted. #26738 |
Previously, the close calendar label was not updating correctly when switching languages. This commit fixes that issue. Fixes: #25021
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
Description
When the locale changes for the datepicker, the calendar switch to the appropriate language. But the hidden 'Close calendar' button stay in english. This is an issue for accessibility, especially for reader application.
Reproduction
Steps to reproduce:
Expected Behavior
The label and content of the button should be in the language specified by the locale.
Actual Behavior
The hidden button stay in english
Environment
The text was updated successfully, but these errors were encountered: