> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/sass/translator-v1.0.0/dictionary/dictionary.get.md).

# dictionary.get()

The `dictionary.get()` function returns a [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default), optionally from [`$key`](#usdkey-null).

{% code lineNumbers="true" %}

```scss
// Variables.
@forward 'dictionary.variables';
@use 'dictionary.variables' as variables;

// Modules.
@use '../../../map';

// The `translator.dictionary-get()` or `dictionary.get()` function.
@function get($key: null, $default: null) {
  @return if(
    $key,
    if(
      type-of(map.get(variables.$dictionary, $key)) == map,
      map.get(variables.$dictionary, $key),
      $default
    ),
    variables.$dictionary
  );
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/translator/dictionary/_dictionary.get.function.scss>" %}

### Parameters

#### `$key: null`

An optional key to retrieve dictionary from a [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default).

#### `$default: null`

The default returned value if dictionary is `null`.

### Return

The return value is a [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default), optionally from [`$key`](#usdkey-null). If `null` returned value is [`$default`](#usddefault-null).

## Examples

```scss
// Use.
@use '@angular-package/sass/translator';

// Examples.
// Gets the global dictionary
@debug translator.dictionary-get(); // (word: translation)

// Gets the global dictionary of key (not translation)
@debug translator.dictionary-get(word); // null

// Gets nested key
variables.$dictionary: map.merge(variables.$dictionary, (test: (ok: (first: accept, second: do))));
@debug translator.dictionary-get((test, ok)); // (first: accept, second: do)
@debug translator.dictionary-get((word, wrong)); // null

// Gets the `$default`
@debug translator.dictionary-get(word, exist); // exist

```
