Comments (14)
That's a very good, but also very difficult question to answer... As you discovered the approach with django-hvad and django-nani don't work so well because both them and django-polymorphic patch the queryset object...
Generally I try to create my Products to have a Language field, and basically have several sets of products (the rest of the translation is handled with normal "static" translation methods.
I would love to find a better solution though.
from django-shop.
I'm using django-mothertongue without any problems.
http://pypi.python.org/pypi/django-mothertongue
from django-shop.
@simonluijk: can you please give an example about how to use mothertongue with django shop product model.
from django-shop.
Here is a striped down version of what I have in my shop. I am using a branch of django-shop that has commits from #125. If you don't, copy the fields over from BaseProduct.
from django.conf import settings
from mothertongue.models import MothertongueModelTranslate
from shop.models_bases import BaseProduct
class Product(BaseProduct, MothertongueModelTranslate):
translated_fields = ('name', 'description', 'meta_description')
translation_set = 'translations'
class ProductTranslation(models.Model):
language = models.CharField(max_length=5, choices=settings.LANGUAGES[1:])
name = models.CharField(_(u'Name'), max_length=128)
description = models.TextField(_(u'Description'), blank=True)
meta_description = models.TextField(_(u'Meta description'), blank=True)
def __unicode__(self):
return '%s@%s' % (self.name, self.language)
from django-shop.
I have a problem using MotherTongue because I connect my product with django-cms PlaceholderField, and only solution I found is simple-translation
from django-shop.
@ikresoft would you care to explain what's the incompatibility between those?
from django-shop.
@Lacrymology which one: django-hvad, Mothertongue, simple-translation?
from django-shop.
@ikresoft between MotherTongue and PlaceholderFields.
from django-shop.
Due to the frustration of integration django-polymorphic with django-hvad, I just developed django-parler
which doesn't suffer from these problems. It also plays nice with others and from the outside it works like hvad. This would solve the django-shop integration too.
Please let me know, in case you have any feedback: https://github.com/edoburu/django-parler
from django-shop.
Made a quick check on a custom product model which chokes on the query_set from the ModelAdmin:
ImproperlyConfigured: PolymorphicQuerySet class does not inherit from TranslatableQuerySet
. Don't have time though to dig in further, just to let you know, vdboor.
from django-shop.
Well, how about class MyQuerySet(TranslatableQuerySet, PolymorphicQuerySet): pass
? :-) If you file an issue in https://github.com/edoburu/django-parler, I can help you out over there, so we keep this bugreport clean. I'm using polymorphic+mptt+parler succesfully in production and co-maintain django-polymorphic together with @chrisglass.
from django-shop.
Hi All,
I am actually the core developer of django-mothertongue
and I am glad that some of you have managed to integrate it successfully with the awesome django-shop
. :) I myself have used mothertongue with django-shop
with no issues. However, I wasn't using things like PlaceholderField
and was not integrating with other 3rd party packages.
I just thought I would drop in my 2 pence worth to let you all know that my new model translation package django-c3po
is in the final stages of development. It follows on from mothertongue and keeps the same 'easy to use' functionality. However it has improved admin functionality, full import/export commands with natural key lookups and also plays very nicely with polymorphic models and even works across deferred foreign keys using the excellent django-dfk
package. It's currently a private repo over on Bitbucket, but once its ready for an initial release I shall be open sourcing it here and on Bitbucket.
There are a lot of great model translation projects for Django but none of them seem to do everything really well. :)
I shall keep you all posted.
Many thanks,
Rob
from django-shop.
PS. @vdboor - Nice work on django-parler, it looks like a great little package! :)
from django-shop.
Closed. Please check version 0.9. It uses django-parler to make models multilingual.
from django-shop.
Related Issues (20)
- Overridden AdminSite
- Supporting filter_backends option for ProductRetrieveView
- OperationalError at / no such table: cms_urlconfrevision HOT 1
- "Can not add/subtract money in different currencies." HOT 4
- Decoupling Django Shop from Django CMS HOT 11
- Is there a way to checkout without billing or shipping addresses? HOT 1
- Bug with endless scrolling when there are has offset HOT 6
- Missing phonenumber option in link plugin
- Cannot install: No module named weakref
- Clear Cart functionality (aka delete all items in Cart at once)
- pipenv run ./manage.py initialize_shop_demo [ERROR] HOT 2
- Django 3.2 HOT 2
- filterChanged() not working
- Is project still active? HOT 2
- An admin for model "User" has to be registered to be referenced by FolderAdmin.autocomplete_fields HOT 2
- Multi-Tenancy Doc is not finished
- error while installation HOT 1
- Install error while parsing `--sequential` requirements HOT 2
- Problem with css variables HOT 2
- Django-shop elasticsearch bug "Unexpected queryset model" HOT 3
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-shop.