Tags:
create new tag
view all tags
ALERT! NOTE: This is a DistributionDocument.
  • Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content.
  • Put questions and suggestions concerning the documentation of this topic in the comments section below.
  • Use the Support web for problems you are having using TWiki.
  • Use the Sandbox web to evaluate & test TWiki.

MAKETEXT -- translate text using TWiki's I18N infrastructure

  • Text in MAKETEXT is translated into another language at page view time if the user activates a language other than the default English language.
  • Syntax: %MAKETEXT{"string" args="..."}%
  • Supported parameters:
    Parameter Description Default
    "text" or string="text" The text to be displayed. none
    args="param1, param2" a comma-separated list of arguments to be interpolated in the string, replacing the [_N] placeholders in it. none
  • Examples:
    • %MAKETEXT{string="Notes:"}%
      expands to
      Notes:
    • %MAKETEXT{"If you have any questions, please contact [_1]." args="%WIKIWEBMASTER%"}%
      expands to
      If you have any questions, please contact info@twikiPLEASENOSPAM.org.
    • %MAKETEXT{"Did you want to ~[~[[_1]~]~[reset [_2]'s password~]~]?" args="%SYSTEMWEB%.ResetPassword, %WIKINAME%"}%
      expands to
      Did you want to reset TWikiGuest's password?
  • Notes:
    • TWiki will translate the string to the current user's language only if it has such string in its translation table for that language.
    • Ampersands (&) followed by one letter (one of a...z, A...Z -- say, X) in the translatable string will be translated to <span class='twikiAccessKey'>X</span>. This is used to implement access keys. If you want to write an actual amperstand that stays just before a letter, write two consecutive amperstands (&&): they will be transformed in just one.
    • Square brackets ~[ and ~] in the text have a special meaning and need to be escaped using ~[ and ~], respectively.
    • Translatable string starting with underscores (_) are reserved. You must not use translatable phrases starting with an underscore.
    • Make sure that the translatable string is constant. Specially, do not include %VARIABLES% inside the translatable strings - string would not get translated because variables get expanded before the %MAKETEXT{...}% itself is handled.
  • Category: DevelopmentVariables, FormattingAndRenderingVariables
  • Related: TWiki:Codev.UserInterfaceInternationalisation (on TWiki.org), CPAN:Locale::Maketext (Maketext documentation)



Comments & Questions about this Distribution Document Topic

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2014-12-16 - 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.