Message function for i18n.

@param {String} id
@param {String} language
@param {Object} [data]
@return {String}
437667
function message (id, language, data) {
  var genericMessage = 'GenericError'
  var self = this || message
  var str, key, subtag

  if (!self.hasOwnProperty(language)) {
    subtag = language && language.match(/.+?(?=-)/)
    if (subtag) subtag = subtag[0]
    if (self.hasOwnProperty(subtag)) language = subtag
    else language = self.defaultLanguage
  }

  str = self[language].hasOwnProperty(id) ?
    self[language][id] :
    self[language][genericMessage] || self.en[genericMessage]

  if (typeof str === 'string')
    for (key in data)
      str = str.replace('{' + key + '}', data[key])

  if (typeof str === 'function')
    str = str(data)

  return str
}
1352262
def tableinfo(tableid, lang=DEFAULT_LANGUAGE):
    
    request = Request('tableinfo', tableid, lang=lang)

    return Tableinfo(request.json, lang=lang)
768770
function language(node) {
  var className = node.properties.className || []
  var length = className.length
  var index = -1
  var value

  while (++index < length) {
    value = className[index]

    if (value === 'no-highlight' || value === 'nohighlight') {
      return false
    }

    if (value.slice(0, 5) === 'lang-') {
      return value.slice(5)
    }

    if (value.slice(0, 9) === 'language-') {
      return value.slice(9)
    }
  }

  return null
}
732855
public function trans($id, array $parameters = [], $domain = null, $locale = null)
    {
        if (null === $locale) {
            $locale = $this->getLocale();
        }

        if (null === $domain) {
            $domain = 'messages';
        }

        if (!isset($this->catalogues[$locale])) {
            $this->loadCatalogue($locale);
        }

        // Change translation domain to 'messages' if a translation can't be found in the
        // current domain
        if ('messages' !== $domain && false === $this->catalogues[$locale]->has((string) $id, $domain)) {
            $domain = 'messages';
        }

        return strtr($this->catalogues[$locale]->get((string) $id, $domain), $parameters);
    }
68115
function(userId, conversationId, callback) {
      if (!userId) return callback(new Error(utils.i18n.conversations.userId));
      conversationId = utils.toUUID(conversationId);
      if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
      utils.debug('Conversation getFromUser: ' + userId + ', ' + conversationId);

      request.get({
        path: '/users/' + querystring.escape(userId) + '/conversations/' + conversationId
      }, callback);
    }
1006365
static function removeLanguage( $id )
    {
        $language = eZContentLanguage::fetch( $id );
        if ( $language )
        {
            return $language->removeThis();
        }
        else
        {
            return false;
        }
    }
431957
@Transformer(requireTemplate = true)
    public static String i18n(Object key, Object... args) {
        return i18n(null, key, args);
    }
749670
public static UniversalIdStrQueueMessage newInstance(String id, String content) {
        UniversalIdStrQueueMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
1046201
@Route(method = HttpMethod.GET, uri = "i18n/{key}")
    public Result getMessage(@Parameter("key") String key, @QueryParameter("locale") Locale locale) {
        String message;
        if (locale != null && !locale.equals(InternationalizationService.DEFAULT_LOCALE)) {
            message = service.get(locale, key);
        } else {
            message = service.get(context().request().languages(), key);
        }

        if (message != null) {
            return ok(message).as(MimeTypes.TEXT);
        } else {
            return notFound("No message for " + key).as(MimeTypes.TEXT);
        }
    }
1028635
public static String getMessage(String key, String bundle) {
        if (!messagesBundles.containsKey(bundle)) {
            if (Context.getLocale() == null) {
                messagesBundles.put(bundle, ResourceBundle.getBundle("i18n/" + bundle, Locale.getDefault()));
            } else {
                messagesBundles.put(bundle, ResourceBundle.getBundle("i18n/" + bundle, Context.getLocale()));
            }

        }
        return messagesBundles.get(bundle).getString(key);
    }
1215397
public static String getMessage(String code, Object... args) {
		return getMessage(I18nUtils.getLocale(), code, args);
	}
523465
private Long getLanguageId(final String _language)
    {
        Long ret = null;
        try {
            final QueryBuilder queryBldr = new QueryBuilder(CIAdmin.Language);
            queryBldr.addWhereAttrEqValue(CIAdmin.Language.Language, _language);
            final InstanceQuery query = queryBldr.getQuery();
            query.executeWithoutAccessCheck();
            if (query.next()) {
                ret = query.getCurrentValue().getId();
            } else {
                ret = insertNewLanguage(_language);
            }
        } catch (final EFapsException e) {
            DBPropertiesUpdate.LOG.error("getLanguageId()", e);
        }
        return ret;
    }
813100
function(messageId, conversationId, callback) {
      if (!messageId) return callback(new Error(utils.i18n.messages.mid));
      messageId = utils.toUUID(messageId);
      if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
      conversationId = utils.toUUID(conversationId);
      utils.debug('Message get: ' + messageId + ', ' + conversationId);
      request.get({
        path: '/conversations/' + conversationId + '/messages/' + messageId
      }, callback);
    }
883866
public static function update(array $s, string $id): string
    {
        $languages = Languages::getPairs();
        if (!$languages) {
            // No languages
            return '';
        }

        if (!is_array($s) || !$s) {
            // No string supplied
            return '';
        }

        if ($id && ($translation_object = TranslationRepository::findOneEntityById($id))) {
            // Found existing translation
            $data = [];

            foreach ($s as $k => $v) {
                if (!isset($languages[$k])) {
                    // No language
                    $v = NULL;
                }

                $data[$k] = $v;
            }

            $translation_object
                ->loadDataFromArray($data)
                ->save();

            return $id;
        }

        // Need to create new
        return self::save($s);
    }
1361712
function getLanguageFilter(languageId) {
        return function languageFilter(file) {
            var id = LanguageManager.getLanguageForPath(file.fullPath).getId();
            if (typeof languageId === "string") {
                return (id === languageId);
            } else {
                return (languageId.indexOf(id) !== -1);
            }
        };
    }
1305513
def traduction(request, page_id, language_id):
    """"""
    page = Page.objects.get(pk=page_id)
    lang = language_id
    placeholders = get_placeholders(page.get_template())
    language_error = (
        Content.objects.get_content(page, language_id, "title")
        is None
    )
    return render(request, 'pages/traduction_helper.html', {
        'page': page,
        'lang': lang,
        'language_error': language_error,
        'placeholders': placeholders,
    })
1170118
function Message(data, source){
	source = source || {}
	this.data = data
	this.key = source.key
	this.sourceChannel = source.name
}