-
Notifications
You must be signed in to change notification settings - Fork 242
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
Incorrect language loaded for Spanish (Argentina) #5257
Comments
is this the only app where this happens? |
what's your locale set to? |
Hi! have same problem..same calendar version and i see this request with Firefox debug tools when my user have Spanish (Argentina) as Language: is taking Arabic locale ? in case of Chile i get this: In case of Mexico this: Thanks. |
This happened to me with version 4.3.4 and the workaround was setting language to spanish from Spaint es_ES. |
Hello, any update in this issue ? do you need to test anything else so we can provide more information ? thanks. |
Same thing here, with 27.0.1 and es_ar locale. |
This bug is very easy to reproduce - just change your language to Spanish (Argentina) and visit the calendar page. I haven't had a chance to properly test, but for anyone who has a dev environment setup - I'm pretty sure the bug is with the
|
@TeaDrinkingProgrammer 👀 ^ :) Do we need better handling for these special cases? |
I have done some more digging and found something which seems so obvious now: we can just parse the locale string with Momentjs:
moment.locale('en-nz'); // 'en' Right now, we are splitting it manually and trying to parse the seperate two-letter codes: E.G en-nz Nz -> failsz tries next code es-ar ar -> succeeds (chooses arabic) Should I try seeing if I can refactor the code to use this method? I can't get to it now but I can look into it in a few weeks. |
I can try it out this week. One question - do we need the 'await import()' code to actually import the file or is that just there to test whether or not it is available? |
That's a great question. I don't actually know. That was what I wanted to test. If you want some test locales, I would suggest: en-us, en-de, es-ar |
My impression based on the docs is that we don't need the import statement - moment should be loading these locales for us. But... I think there is some kind of timing issue going on. Here's what I'm testing:
And here's what I'm seeing in the console: In other words, when the code runs, it always returns "en" no matter what I give it. But after the page has loaded, it works as expected. Any suggestions? |
This more lightly modified code works as I would expect it to:
I see that there is discussion about replacing the moment library altogether so maybe getting an imperfect fix is better than trying to make the moment library behave properly? Also, it seems like there may be some bigger language/locale issues in Nextcloud core. For example, while testing I noticed this: In the United States, the week starts on Sunday (a locale setting right?): But if we change the language to German while keeping the Enlighs (US) locale, the the week start date changes: I think the day should continue starting on Sunday as long as English (US) is selected for locale. At this point, though, I'm not really sure ??? |
I agree with the discussion about the fix, let's keep it temporary because Momentjs should be replaced anyway. The week should indeed start on monday with German and en-us locale. Could you show logs for that setting? |
I just made a pull request for the simpler change. Should this new bug be opened against Nextcloud core instead of the calendar app? It seems to happen even with the calendar app disabled. Also I see three very similar sounding open bugs:
Here is my config:
|
Signed-off-by: Jamie McClelland <[email protected]>
Signed-off-by: Jamie McClelland <[email protected]>
Steps to reproduce
Expected behavior
Entries in the Calendar shoud be in Argentinian Spanish (es_AR)
Actual behaviour
Entries appear to be in an Arabic language (ar?) instead
Calendar app version
4.3.4
CalDAV-clients used
No response
Browser
Opera 99, Firefox 113
Client operating system
Ubuntu, Fedora
Server operating system
CentOS 7.9
Web server
Apache
Database engine version
MySQL
PHP engine version
PHP 7.4
Nextcloud version
25.0.6
Updated from an older installed version or fresh install
Updated from an older version
List of activated apps
Nextcloud configuration
Web server error log
No response
Log file
No response
Browser log
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: