https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15707
--- Comment #77 from Marc Véron <[email protected]> --- (In reply to Kyle M Hall from comment #75) > (In reply to Katrin Fischer from comment #74) > > Talking about these for an example: > > > > + <div class="dialog alert group-added"> > > + [% IF added.branchcode %] > > + <i>[% added.library.branchname %]</i> added to group. > > + [% ELSE %] > > + Group <i>[% added.title %]</i> created. > > + [% END %] > > + </div> > > > > Second example in the po file is: > > - Group > > - created > > Instead of: Group %s created. > > What if we were to take advantage of TT to "hide" the markup for > translations? > Instead of: > Group <i>[% added.title %]</i> created. > we could do this: > Group [% "<i>" _ added.title _ "</i>" %] created. > > That way, we can still emphasize names, but the markup will not show. We > could even create a filter if we standardize this so we could do something > like this: > > Group [% added.title | $KohaSpan id => 'myId' class => 'name' %] created. > > That solves the problem of translations while still allowing us to style > particular elements in a sentence! > > What do you think? That sounds interesting, see: http://template-toolkit.org/docs/manual/Directives.html ---start snip--- You can concatenate strings together using the ' _ ' operator. In Perl 5, the . is used for string concatenation, but in Perl 6, as in the Template Toolkit, the . will be used as the method calling operator and ' _ ' will be used for string concatenation. Note that the operator must be specified with surrounding whitespace which, as Larry says, is construed as a feature: [% copyright = '(C) Copyright' _ year _ ' ' _ author %] You can, of course, achieve a similar effect with double quoted string interpolation. [% copyright = "(C) Copyright $year $author" %] ---end snip--- -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
