Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1070

Add header and handle double quotes in translations.pot file

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: core-1.8.0
    • Fix Version/s: 1.11.0
    • Component/s: Core
    • Labels:
      None

      Description

      Some translation services are more picky about the format of the .pot file than others. I encountered 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:

      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"
      

      2. Escape quotes

      Some services can't deal with quotes in the translatable string:

      msgid "<a href="#">Accept using your data for research</a>"
      

      One could argue that is this particular example the html should not be exposed to the translator but it's imaginable that quotes are used in strings that are presented to the user.

      Escaping with a backslash allowed me to upload the .pot file:

      msgid "<a href=\"#\">Accept using your data for research</a>"
      

      [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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jcvanderwal Jeroen van der Wal
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: