Thursday, December 29, 2016

Re: How do I translate site.name to other languages?

Hi,

with django-modeltranslation you can add translations to any model, even if it's built-in in Django, but the problem is that migrations are being created in site-packages, outside our git repo, and this would cause issues upgrading Django itself.

(speedy_net)net$ ./manage.py makemigrations
Migrations for 'sites':
  /Users/xtr/.virtualenvs/speedy_net/lib/python3.5/site-packages/django/contrib/sites/migrations/0003_auto_20161229_1018.py:
    - Change managers on site
    - Add field name_en to site
    - Add field name_he to site

Is there a way to move the migrations to inside our git repo?

Thanks,
Uri.


Uri Even-Chen  
photo Phone: +972-54-3995700
Email: uri@speedy.net
Website: http://www.speedysoftware.com/uri/en/
    

On Mon, Dec 26, 2016 at 1:00 AM, Melvyn Sopacua <m.r.sopacua@gmail.com> wrote:

Hi Uri,

 

On Thursday 22 December 2016 19:40:15 Uri Even-Chen wrote:

 

> We have our site.name and other site names (we have 4 sites in Django

> right now) in templates such as base.html. The site is taken from

> model Site (```from django.contrib.sites.models import Site```).

 

Untested, but since Site is a Django Model, have a look at Django Model Translation. I suspect once you get the idea, you'll use it throughout the project.

--

Melvyn Sopacua

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1672133.RzSWr4WvZz%40devstation.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMQ2MsH6ZqiK7voGAWhuQedzZPcLV7KX_Ri%3DJxwFmBhGZfosWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment