-
Notifications
You must be signed in to change notification settings - Fork 46
I added I18N support to flatblocks #10
base: master
Are you sure you want to change the base?
Conversation
The only issue I can think of is that it requires that either you are using the RequestContext or that you add a line to your templates once you upgrade. Probably will break some users sites until they have done this (I output a string to the page to check their logs). May be able to add some code that "ignores" the language if cannot get it, but then new users may run into a situation where it isn't working and they don't know why. |
Thank you :-) The update path is a real issue, though, in my opinion. Is there any real reason why the language couldn't be made completely optional? Also imo the field should also be nullable to make the upgrade easier. |
Yep, missed that. Let me mess around a bit more and see what can be done! Will ping back within a week |
Fixed error happening when app is part of project during first syncdb Added required values to test project
additional errors where needed
I went through the upgrade path, starting with your version and upgrading to mine, and made sure that all the errors made sense for them as well as working nicely for a new install. An upgrade requires that the user adds columns, but that seems pretty standard for module upgrades. Let me know what you think. |
Thank you :-) I will hopefully get to it this weekend or before. I also already have a patch for south integration lying around here somewhere so it might make a good mix with your changes :-) |
|
…ge selector to test project home.
On the other stuff, feel free to use this code or not... I needed it for a project I am doing and have put about as much time in as I can. Thanks! |
I'm now using django-hvad/nani in one of my projects and it seems like a nice solution to a really annoying problem. Perhaps there is a nice and easy way to get this integrated :-) |
pull request
Conflicts: flatblocks/admin.py flatblocks/models.py
Hi! if 'django.middleware.locale.LocaleMiddleware' not in settings.MIDDLEWARE_CLASSES:
logger.warning("For i18n support in flatblocks you must have django.middleware.locale.LocaleMiddleware in your MIDDLEWARE_CLASSES")
else:
lang = get_language() Well, it is rather nice to recieve a warnging like that, BUT for me (and other people who have a custom middleware instead of django.middleware.locale.LocaleMiddleware) it is a problem - I use Django CMS and it requires me not to use it and gives me some other middleware. I suggest to just use get_language to get language :) and not to obligate user to use LocaleMiddleware: if 'django.middleware.locale.LocaleMiddleware' not in settings.MIDDLEWARE_CLASSES:
logger.warning("For i18n support in flatblocks you must have django.middleware.locale.LocaleMiddleware in your MIDDLEWARE_CLASSES")
# yep, we still recieve a warning!)
lang = get_language() |
added Django 1.7 migrations
I went through the whole project and updated everything. I verified that all test cases work. Let me know if anything is missing. I am running this new version on our site and all seems to be working well.