Hi Benjamin,

You are almost there. Only need to prefix the UTF string with the
character 'u':

  street = models.CharField(_(u'Straße'), max_length=200)


cheers,
Martin


Martin Bouma
egoactive.com


On 9 jun, 15:15, Benjamin Reitzammer <benja...@squeakyvessel.com>
wrote:
> Hi,
> I'm having a strange problem right now, and I couldn't find any reference yet.
>
> I'm starting with a fresh new project, add a very simple model and
> register this model with the admin app.
> Like the example files below. Point is, that I use translated texts as
> field names.
>
> The problem I'm having: The translated field names, that contain
> umlauts (non-ASCII) are simply not shown in the admin interface. No
> error shows up on the console or elsewhere. The strings (and the HTML
> tags by which they are usually surrounded) are simply missing from the
> admin interface.
>
> The files are correctly UTF encoded. Am I missing something?
>
> Thanks for any advice.
>
> Cheers, Benjamin
>
> Example:
>
> File: models.py
> --------------------
> # -*- coding: utf-8 -*-
> from django.db import models
> from django.utils.translation import ugettext_lazy as _
>
> class Organization(models.Model):
>     name = models.CharField(_('Name'), max_length=200)
>     street = models.CharField(_('Straße'), max_length=200)
>
> File: admin.py
> --------------------
> from .models import Organization
> from django.contrib import admin
>
> class OrganizationAdmin(admin.ModelAdmin):
>     pass
>
> admin.site.register(Organization, OrganizationAdmin)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to