Django French translation - how to handle single quotes in translation strings?

I am using Python 3.5.2 and Django 1.10.

I got a french .po file and can run the compilemessages command without getting any errors.

However, when I launch the site, many pages refuse to load.

I suspect this is because the French .po file contains many single quotes (') in translation strings.

For example,

#: .\core\constants\address_country_style_types.py:274
msgid "Ascension Island"
msgstr "Île de l'Ascension"

      

I remember reading somewhere (but can't find this link anywhere) that single quotes must have a leading or leading slash in front of them. So I tried this, but when I ran the compilemessage command I got the error:

C:\Users\me\desktop\myapp\myapp\locale\fr\LC_MESSAGES\django.po:423:18: invalid control sequence

      

So how do I escape the French single quote in the line?

here is the header of my french .po file:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-04 12:55+1000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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"

      

+3


source to share


1 answer


I'm not sure what is the cause of this problem (is it possible that the translator has distorted the file in some way?).

However, a workaround, instead of using the standard single quote mark '

, I used this single quote (taken from characters in MS Word):





I still need to test this with a French translator, but it looks and works fine.

I hope this helps someone.

+1


source







All Articles