You are here

function i18nstrings_location in Internationalization 6

Get location string from context.

Returns the location for the locale table for a string context.

6 calls to i18nstrings_location()
i18nstrings_add_string in i18nstrings/i18nstrings.module
Add source string to the locale tables for translation.
i18nstrings_context in i18nstrings/i18nstrings.module
Convert context string in a context object.
i18nstrings_params in i18nstrings/i18nstrings.module
Get message parameters from context and string.
i18nstrings_translate_object in i18nstrings/i18nstrings.module
Translate object properties.
i18nstrings_update_context in i18nstrings/i18nstrings.module
Update context for strings.

... See full list

File

i18nstrings/i18nstrings.module, line 818
Internationalization (i18n) package - translatable strings.

Code

function i18nstrings_location($context) {
  if (is_string($context)) {
    $context = i18nstrings_context($context);
  }
  $location[] = !empty($context->type) ? $context->type : '';

  // The value may be zero so we check first with is_numeric()
  if (isset($context->objectid) && (is_numeric($context->objectid) || !empty($context->objectid))) {
    $location[] = $context->objectid;
    if (!empty($context->property)) {
      $location[] = $context->property;
    }
  }
  return implode(':', $location);
}