Comments (8)
Hi, thanks for reporting this. Are you using usel10n
? If so, then I would hope that the language
in self.options
is set properly on line 206
of the same file. I don't have a completely understanding of it though.
from django-datetime-widget.
Yes, I'm using usel10n
parameter and yes, I'm getting right locale file (Russian).
But if I need to switch to another language (English), I'm still getting Russian locale file.
I think this is because self.options
doesn't updates during language switch.
from django-datetime-widget.
Hi, sorry, I'm trying to understand as I don't have much experience with locales. I think you have usel10n
set to True
and you're getting the Russian because that is you're current locale, but you'd like to use the English language set anyway? Does it make sense to disable usel10n
and set the language yourself?
from django-datetime-widget.
did you add 'django.middleware.locale.LocaleMiddleware', in your MIDDLEWARE_CLASSES list in settings.py?
Read here for more informations https://docs.djangoproject.com/en/dev/ref/middleware/#django.middleware.locale.LocaleMiddleware
from django-datetime-widget.
Yes, django.middleware.locale.LocaleMiddleware
is in MIDDLEWARE_CLASSES
list in settings.py.
When I switch language, function get_language()
returns correct code but self.options['language']
still has the old initial value.
from django-datetime-widget.
I have this issue too. Locale middleware, l10n, i18n and tz support are enabled.
Switching the language causes the form to fail validation. Switching back to the previous language works though.
from django-datetime-widget.
In my case, localization works well when you change your LANGUAGE_CODE
to desire language in settings.py
. The first time widget is loaded, it triggers the __init__
method of PickerWidgetMixin
class, wich contains self.options['language'] = get_supported_language(get_language())
and show it well. When you change language settings at request level (in my case, with a cookie that alerts django to swich language) it doesn't trigger again, so I think the trick is here, triggerig this method per each request or setting widget js to desire language.
Any ideas?
from django-datetime-widget.
I have also affected by this. I used @MuR solution but it would be better if there was a pull request and merge this feature with master.
@MuR thanks for the fix by the way.
from django-datetime-widget.
Related Issues (20)
- Change icons HOT 1
- using Now as startDate HOT 1
- Duplicate ID in rendered widgets
- Time Disabled
- Use display names configured in user settings instead of usernames (if provided)
- Date format conversion to python miss many formats
- startDate and endDate Options
- Improve documentation
- Not working in Django 2.1 HOT 4
- Readme > format doesn't show available month options
- Suggestion for Django 1.8+: DurationWidget
- startDate, endDate and daysOfWeekDisabled not working HOT 2
- Back to 1899 HOT 7
- todayBtn needs to be added to boolean list HOT 1
- Add option to not style input as readonly HOT 3
- Next month, Prev month buttons not showing HOT 1
- Blackout dates, hours
- Inconsistency with boolean values HOT 1
- Multiple widgets in a single form HOT 1
- Error on Django 1.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-datetime-widget.