getTranslation method

String? getTranslation(
  1. Map<String, Object> args
)

Get translation

Implementation

String? getTranslation(Map<String, Object> args) {
  var parsedContent = parser.parse(value);
  if (parsedContent == null) {
    return null;
  }

  var contentType = _getContentType(parsedContent, args);

  switch (contentType) {
    case ContentType.literal:
      {
        return value;
      }
    case ContentType.argument:
      {
        return _generateArgumentContent(parsedContent, args);
      }
    case ContentType.plural:
      {
        return _generatePluralContent(parsedContent, args);
      }
    case ContentType.gender:
      {
        return _generateGenderContent(parsedContent, args);
      }
    case ContentType.select:
      {
        return _generateSelectContent(parsedContent, args);
      }
    case ContentType.compound:
      {
        return _generateCompoundContent(parsedContent, args);
      }
    default:
      {
        return null;
      }
  }
}