Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Localization msgmerge error

Tags:

python

django

po

I have a medium sized Django project and was using Django Translation . While i run the command django-admin.py makemessages -l fr . I get the below error while using french.

CommandError: errors happened while running msgmerge
msgmerge: input file doesn't contain a header entry with a charset specification

Where to Specify the charset specification and What to specify in that ?

like image 356
user3383301 Avatar asked Jul 24 '14 16:07

user3383301


People also ask

What is Gettext_lazy in Django?

gettext_lazy is a callable within the django. utils. translation module of the Django project.

How to translate in Django?

In order to make a Django project translatable, you have to add a minimal number of hooks to your Python code and templates. These hooks are called translation strings.

What is Django Mo?

django created . mo files which he uses to get translated strings. MO files: MO, or Machine Object is a binary data file that contains object data referenced by a program. It is typically used to translate program code, and may be loaded or imported into the GNU gettext program. created files.


1 Answers

It is just the normal boiler-plate PO-file header. Something like:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-05-18 20:44+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

You should probably look for the header in an existing french PO-file.

The error is probably caused by an app having no internationalized strings.

like image 60
Robert Jørgensgaard Engdahl Avatar answered Oct 11 '22 20:10

Robert Jørgensgaard Engdahl