You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Jeroen van der Wal (JIRA)" <ji...@apache.org> on 2015/03/04 21:32:40 UTC

[jira] [Created] (ISIS-1070) Add header and handle double quotes in translations.pot file

Jeroen van der Wal created ISIS-1070:
----------------------------------------

             Summary: Add header and handle double quotes in translations.pot file 
                 Key: ISIS-1070
                 URL: https://issues.apache.org/jira/browse/ISIS-1070
             Project: Isis
          Issue Type: Improvement
          Components: Core
    Affects Versions: core-1.8.0
            Reporter: Jeroen van der Wal
            Assignee: Dan Haywood
            Priority: Minor
             Fix For: core-1.9.0


Some translation services are more picky about the format of the .pot file than others. I countered two issues when trying a different service:

1. Add compliant header
More about headers in this paper [1]  and the gettext documentation [2]. I've successfully managed to upload a .pot file to a translation service by adding this header: 
{code}
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2015-03-04 12:52+0100\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"
{code}

2. Escape quotes

Some services can't deal with quotes in the translatable string:
{code}
msgid "<a href="#">Accept using your data for research</a>"
{code}
One could argue that is this particular example the html should not be exposed to the translator but it's imaginable that quotes are uses in string that are presented to the user.

Escaping with a backslash allowed me to upload the .pot file: 
{code}
msgid "<a href=\"#\">Accept using your data for research</a>"
{code}
 
[1] http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html
[2] https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html#Header-Entry



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)