Method: I18n::Inflector::API_Strict#true_token

Defined in:
lib/i18n-inflector/api_strict.rb

#true_token(token, kind) ⇒ Symbol? #true_token(token, kind, locale) ⇒ Symbol? Also known as: resolve_alias

Gets true token for the given token belonging to a strict kind. If the token is an alias it will be resolved and a true token (target) will be returned.

Overloads:

  • #true_token(token, kind) ⇒ Symbol?

    Uses the current locale and the given kind to get a real token for the given token. If the token is an alias it will be resolved and a true token (target) will be returned.

    Parameters:

    • token (Symbol, String)

      the identifier of the checked token

    • kind (Symbol, String)

      the identifier of a kind

    Returns:

    • (Symbol, nil)

      the true token or nil

  • #true_token(token, kind, locale) ⇒ Symbol?

    Uses the given locale and kind to get a real token for the given token. If the token is an alias it will be resolved and a true token (target) will be returned.

    Parameters:

    • token (Symbol, String)

      the identifier of the checked token

    • kind (Symbol, String)

      the identifier of a kind

    • locale (Symbol)

      the locale to use

    Returns:

    • (Symbol, nil)

      the true token or nil

Returns:

  • (Symbol, nil)

    the true token or nil

Raises:

[View source]

341
342
343
344
345
# File 'lib/i18n-inflector/api_strict.rb', line 341

def true_token(*args)
  token, kind, locale = tkl_args(args)
  return nil if (token.nil? || kind.nil?)
  data_safe(locale).get_true_token(token, kind)
end