Search code examples
pythondjangopo

Django Localization msgmerge error


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 ?


Solution

  • 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.