Git Product home page Git Product logo

Comments (14)

chrisglass avatar chrisglass commented on July 3, 2024

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.

simonluijk avatar simonluijk commented on July 3, 2024

I'm using django-mothertongue without any problems.
http://pypi.python.org/pypi/django-mothertongue

from django-shop.

migush avatar migush commented on July 3, 2024

@simonluijk: can you please give an example about how to use mothertongue with django shop product model.

from django-shop.

simonluijk avatar simonluijk commented on July 3, 2024

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.

ikresoft avatar ikresoft commented on July 3, 2024

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.

Lacrymology avatar Lacrymology commented on July 3, 2024

@ikresoft would you care to explain what's the incompatibility between those?

from django-shop.

ikresoft avatar ikresoft commented on July 3, 2024

@Lacrymology which one: django-hvad, Mothertongue, simple-translation?

from django-shop.

Lacrymology avatar Lacrymology commented on July 3, 2024

@ikresoft between MotherTongue and PlaceholderFields.

from django-shop.

vdboor avatar vdboor commented on July 3, 2024

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.

byteborg avatar byteborg commented on July 3, 2024

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.

vdboor avatar vdboor commented on July 3, 2024

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.

robcharlwood avatar robcharlwood commented on July 3, 2024

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.

robcharlwood avatar robcharlwood commented on July 3, 2024

PS. @vdboor - Nice work on django-parler, it looks like a great little package! :)

from django-shop.

jrief avatar jrief commented on July 3, 2024

Closed. Please check version 0.9. It uses django-parler to make models multilingual.

from django-shop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.