maybe translation context? https://docs.djangoproject.com/en/dev/topics/i18n/translation/#contextual-markers
On Thu, Dec 22, 2016 at 9:29 PM, Fergus Cameron <tofer...@gmail.com> wrote: > I personally try to use language agnostic message IDs and translate > everything (i.e. including English). Your idea of appending the > gender is along the same lines and seems logical. > > On 22/12/2016, Uri Even-Chen <u...@speedy.net> wrote: > > Hi Django users, > > > > How do you recommend to use Hebrew gender-related translations? > > > > For example, here are the choices for diet in Speedy Net (notice it's > > currently only used in Speedy Match, but it's part of the profile of > Speedy > > Net): > > > > ``` > > class User(Entity, PermissionsMixin, AbstractBaseUser): > > .... > > GENDER_FEMALE = 1 > > GENDER_MALE = 2 > > GENDER_OTHER = 3 > > GENDER_CHOICES = ( > > (GENDER_FEMALE, _('Female')), > > (GENDER_MALE, _('Male')), > > (GENDER_OTHER, _('Other')), > > ) > > > > DIET_UNKNOWN = 0 > > DIET_VEGAN = 1 > > DIET_VEGETARIAN = 2 > > DIET_CARNIST = 3 > > DIET_CHOICES = ( > > (DIET_UNKNOWN, _('Please select...')), > > (DIET_VEGAN, _('Vegan (eats only plants and fungi)')), > > (DIET_VEGETARIAN, _('Vegetarian (doesn\'t eat fish and meat)')), > > (DIET_CARNIST, _('Carnist (eats animals)')) > > ) > > .... > > gender = models.SmallIntegerField(verbose_name=_('I am'), > > choices=GENDER_CHOICES) > > diet = models.SmallIntegerField(verbose_name=_('diet'), > > choices=DIET_CHOICES, default=DIET_UNKNOWN) > > ``` > > > > And here are the translations: > > ``` > > #: .\accounts\models.py:151 > > msgid "Vegan (eats only plants and fungi)" > > msgstr "טבעוני/ת (אוכל/ת רק צמחים ופטריות)" > > > > #: .\accounts\models.py:152 > > msgid "Vegetarian (doesn't eat fish and meat)" > > msgstr "צמחוני/ת (לא אוכל/ת דגים ובשר)" > > > > #: .\accounts\models.py:153 > > msgid "Carnist (eats animals)" > > msgstr "קרניסט/ית (אוכל/ת חיות)" > > ``` > > > > The correct translations in Hebrew are per gender (female, male or other) > > but in English they are the same. How do you recommend to program it? I > > thought about adding " [female]", " [male]" or " [other]" suffixes to the > > strings and then removing them in the English translations. But then > > English would also require a translation. Is there a better approach? And > > how do I write the model when this feature is gender-related? > > > > The same question is related to any site which has a language where the > > text is gender-related, and a language where it is not. > > > > You can see the code on GitHub: https://github.com/ > urievenchen/speedy-net > > > > Thanks, > > Uri. > > > > *Uri Even-Chen* > > [image: photo] Phone: +972-54-3995700 > > Email: u...@speedy.net > > Website: http://www.speedysoftware.com/uri/en/ > > <http://www.facebook.com/urievenchen> > > <http://plus.google.com/+urievenchen> > > <http://www.linkedin.com/in/urievenchen> < > http://github.com/urievenchen> > > <http://twitter.com/urievenchen> > > > > -- > > 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+unsubscr...@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/CAMQ2MsGv_ > fvj6ijM4rb-Y7XfQeGbPJvd38_7o_LYbiukuhxyrg%40mail.gmail.com. > > 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+unsubscr...@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/CAHCf7OFGAsD5dAWKOwM535U7ChftJ3LLM9BS2u%3DHPm9Oiued_Q% > 40mail.gmail.com. > 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+unsubscr...@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/CAFWa6t%2BwK%2BZBGuayQp8RBpfbC%3DE5QtshfJC13ANMdqru9WCENw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.