Python Forum

Full Version: Error while executing makemessages command
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!
I'm creating multilingual website.

When I try to execute:
$python manage.py makemessages -l de
I get an error:

CommandError: errors happened while running msguniq
msguniq: \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \xabASCII\xbb \u0432 \xabUTF-8\xbb.  msguniq \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 iconv(). \u042d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0431\u0435\u0437 iconv().
From makemessages -v3 I have, that program:
processing file views.py
and then crashes. So, I think that problem is in views:)

views:

@login_required
@require_http_methods(["GET"])
def userprofile(request):
  return render(request, 'userprofile.html', {
    'user': request.user, 
    'form': UserProfileForm(instance=request.user)
  })

@login_required
def insights(request):
  return render_to_response('insights.html', {'client': request.user.client, 'user': request.user})
If I just run this app, everything works fine, but not on makemessages. Should I change somehow this methods to make multilingual site?
(Jan-04-2018, 10:19 AM)sonic911 Wrote: [ -> ]Hello!
I'm creating multilingual website.

When I try to execute:
$python manage.py makemessages -l de
I get an error:

CommandError: errors happened while running msguniq
msguniq: \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \xabASCII\xbb \u0432 \xabUTF-8\xbb.  msguniq \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 iconv(). \u042d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0431\u0435\u0437 iconv().
From makemessages -v3 I have, that program:
processing file views.py
and then crashes. So, I think that problem is in views:)

views:

@login_required
@require_http_methods(["GET"])
def userprofile(request):
  return render(request, 'userprofile.html', {
    'user': request.user, 
    'form': UserProfileForm(instance=request.user)
  })

@login_required
def insights(request):
  return render_to_response('insights.html', {'client': request.user.client, 'user': request.user})
If I just run this app, everything works fine, but not on makemessages. Should I change somehow these methods to make a multilingual site?

Yes, NameError: name 'login_required' is not defined
login_required is imported, so I don't need to define it. I found, that problem is that it is impossible to translate block from ascii to UTF-8, because iconv() is not configured(just decoded error's unicode).