-
Notifications
You must be signed in to change notification settings - Fork 634
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
Localization broken in field-date #1530
Comments
I am pretty sure this is actually a bug. You don't describe how your code changes the locale, but I added import * as Fr from 'blockly/msg/fr';
Blockly.setLocale(Fr); to the top of I believe the problem is in static loadLanguage_() {
for (const prop in goog.i18n) {
if (prop.startsWith('DateTimeSymbols_')) {
const lang = prop.substr(16).toLowerCase().replace('_', '.');
// E.g. 'DateTimeSymbols_pt_BR' -> 'pt.br'
if (goog.getObjectByName(lang, Blockly.Msg)) {
goog.i18n.DateTimeSymbols = goog.i18n[prop];
break;
}
}
}
} As far as I can tell this is expecting to find a property named I'm not really sure how this could ever have worked. Did |
Looks like the snippet above (ie cc @BeksOmega |
Is there a way to force the native date picker to use a specific locale by code other than the browser locale? |
It looks like we don't have a way to force the locale of the date picker. However, if there's a mismatch between Blockly locale and browser locale there's a good chance that the browser locale is the user's actual preferred locale, and that they will understand the month strings that are available. This seems acceptable, given that it allows us to not implement a custom date picker (or import one from elsewhere, as we did with the Closure UI library). |
It's more a question than a bug.
I would like to know how to change the local in @blockly/field-date ?
When I set 'fr', this change "today" but not the month.
![image](https://user-images.githubusercontent.com/10244725/214940618-79441b81-0dda-44ad-a9c3-e42179a13bf9.png)
Thanks
The text was updated successfully, but these errors were encountered: