From 9ed199261a9e1582a656d085cdcedd49c626bebd Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 27 May 2014 12:11:09 +0000 Subject: [PATCH] fix dialog and translations to allow messages with newlines --- etemplate/templates/default/etemplate2.css | 5 +++++ phpgwapi/lang.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index d33235fe96..0dbd842671 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -397,6 +397,11 @@ span.et2_date_duration input.et2_date_duration{ .ui-dialog-content { vertical-align: middle; } +.ui-dialog-content > div { + white-space: pre-wrap; + display: inline-block; + vertical-align: middle; +} /* These change button alignment, but it seems the standard is right-aligned for action buttons, left aligned for "extra" controls .ui-dialog .ui-dialog-buttonpane { diff --git a/phpgwapi/lang.php b/phpgwapi/lang.php index f0bec5aeb0..b76d032434 100644 --- a/phpgwapi/lang.php +++ b/phpgwapi/lang.php @@ -57,7 +57,8 @@ if (!count(translation::$lang_arr)) translation::add_app($_GET['app'], 'en'); } -$content = 'egw.set_lang_arr("'.$_GET['app'].'", '.json_encode(translation::$lang_arr).');'; +// fix for phrases containing \n +$content = 'egw.set_lang_arr("'.$_GET['app'].'", '.str_replace('\\\\n', '\\n', json_encode(translation::$lang_arr)).');'; // we run our own gzip compression, to set a correct Content-Length of the encoded content if (in_array('gzip', explode(',',$_SERVER['HTTP_ACCEPT_ENCODING'])) && function_exists('gzencode'))