plainblack.com
Username Password
search
Bookmark and Share
Subscribe

International Macro

^International();
^International(key,namespace);

Pull a translated message key from the internationalization system.  By default, it looks in the WebGUI namespace.  A different namespace can be specified as a second, optional argument.

Example: ^International(45,Article);

This Macro may be nested inside other Macros if the message does not contain commas or quotes.

To make typing easier, you can create an alias for the International macro in your WebGUI config file.

"i18n" : "International",

Notes on finding the correct values for this macro:

Because I didn't know how to find the right key and namespace, this is what I ended up doing:

  1. Go to http://i18n.webgui.org/
  2. Download the language pack you want to use.
  3. extract the package
  4. search for the term you want to translate. If that doesn't work, try something shorter. So if you are looking for "administrative" search for admin. Or if you still come out short, translate the string you want to translate, and then search for that. I used translate.google.com
  5. You'll hopefully find something like this:
      'scheduling conflict continue' => {
        'lastUpdated' => '1252530417',
        'message' => 'Click para continuar'
    This is an example from Asset_EventManagementSystem.pm. So to use the international macro, you'd supply:
    ^International(scheduling conflict continue,Asset_EventManagementSystem);
    If you found something like this in the WebGUI.pm file:
    348 => {
        'lastUpdated' => '1291127697',
        'message' => 'Nombre'
      },
    The macro would be:
    ^International(348,WebGUI);

You can use single quotes or double quotes or leave strings without quotes.

notes on translating in javascript

the javascript i18n object does things the opposite way, it accepts (namespace, key) instead of the macro and API standard (key, namespace)

Keywords: i18n macro

Search | Most Popular | Recent Changes | Wiki Home
© 2018 Plain Black Corporation | All Rights Reserved