From 540098cd3d3be988cd0a002bd2832494e2932fc0 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 11 Aug 2014 08:13:47 -0500
Subject: [PATCH] i18n: Fix incorrect creation of PO file

---
 include/staff/templates/dynamic-form.tmpl.php | 2 +-
 setup/cli/modules/i18n.php                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/staff/templates/dynamic-form.tmpl.php b/include/staff/templates/dynamic-form.tmpl.php
index d44d3062b..98a277674 100644
--- a/include/staff/templates/dynamic-form.tmpl.php
+++ b/include/staff/templates/dynamic-form.tmpl.php
@@ -57,7 +57,7 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?>
             if (($a = $field->getAnswer()) && $a->isDeleted()) {
                 ?><a class="action-button danger overlay" title="Delete this data"
                     href="#delete-answer"
-                    onclick="javascript:if (confirm('You sure?'))
+                    onclick="javascript:if (confirm('<?php echo __('You sure?'); ?>'))
                         $.ajax({
                             url: 'ajax.php/form/answer/'
                                 +$(this).data('entryId') + '/' + $(this).data('fieldId'),
diff --git a/setup/cli/modules/i18n.php b/setup/cli/modules/i18n.php
index 8edb5c955..d219eb245 100644
--- a/setup/cli/modules/i18n.php
+++ b/setup/cli/modules/i18n.php
@@ -435,7 +435,7 @@ class i18n_Compiler extends Module {
         // Unescape single quote (') and escape unescaped double quotes (")
         $string = preg_replace(array("`\\\(['$])`", '`(?<!\\\)"`'), array("$1", '\"'), $string);
         // Preserve embedded newlines -- preserve up to on
-        $string = preg_replace("`\n\s*`u", "\\n\n", $string);
+        $string = preg_replace("`\n`u", "\\n\n", $string);
         // Word-wrap long lines
         $string = rtrim(preg_replace('/(?=[\s\p{Ps}])(.{1,76})(\s|$|(\p{Ps}))/uS',
             "$1$2\n", $string), "\n");
-- 
GitLab