Tags:
create new tag
view all tags

SID-01855: MAKETEXT arguments

Status: Answered Answered TWiki version: 4.2.3 Perl version: 5.8.8
Category: CategoryInternationalization Server OS: Last update: 10 years ago

I ran into an oddity with MAKETEXT that I'm not sure how to handle.

I have a string of the form "Something about [_1] [_2]", where_1 can be "Boston, Massachusetts". _1 is from an external data source.

If I generate MAKETEXT{ "Something about [_1]" args="Boston, Massachusetts, today"}, obviously the args will be misinterpreted.

How is this handled? Is the ',' quotable somehow? (Shouldn't the API for MAKETEXT be arg1="string" arg2="string", ...?)

I had a similar issue with substituting a (span -title="...") (a href="...") (/a) stuff (/span).

The better-than-nothing approach is to concatenate MAKETEXT --, but obviously while that flags translations, it doesn't make them easy. One should be able to interpolate...

-- Timothe Litt - 2014-01-13

Discussion and Answer

I agree, the parameter API is strange and not so useful.

Using the current spec, you need to entity-escape the commas if you get arguments that may contain commas. That is, escape comma with ,.

-- Peter Thoeny - 2014-01-13

On double quotes in arguments, you need to escape them with backslash, or replace by single quotes.

-- Peter Thoeny - 2014-01-13

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title MAKETEXT arguments
SupportCategory CategoryInternationalization
TWiki version 4.2.3
Server OS

Web server

Perl version 5.8.8
Browser & version

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2014-01-13 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.