File: 1013_fix-smarty-gettext-tags-recognition.patch

package info (click to toggle)
gosa 2.7.4%2Breloaded3-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 38,716 kB
  • sloc: php: 87,789; perl: 14,364; xml: 4,987; javascript: 4,127; sh: 887; pascal: 306; sql: 263; python: 162; makefile: 76
file content (17 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Description: Correctly recognize smarty-gettext parameters in {t} blocks
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Abstract:
 Also make {t} blocks translatable that contain parameters, e.g.
 {t escape=no}{/t}, {t 1=<phpcode>}Translate %1{/t}, etc.

--- a/gosa-core/update-locale
+++ b/gosa-core/update-locale
@@ -19,7 +19,7 @@
 
   for template in $(find . -name '*.tpl'); do
     echo "* converting .tpl files: $(basename $template)"
-    sed -e 's/{t}/<?php $t= _("/g;s!{/t}!");?>!g' $template > $template.new
+    sed -re 's!\{t(|\ [a-z0-9]+=.*)\}([^\{]*)\{/t\}!<?php $t=_("\2{/t}!g;s!\{/t\}!");?>!g' $template > $template.new
     mv $template.new $template
   done