> 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.set.md).

# dictionary.set()

The `dictionary.set()` function sets the [`$value`](#usdvalue) under the [`$key`](#usdkey) in a [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default).

{% code lineNumbers="true" %}

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

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

// The `translator.dictionary-set()` or `dictionary.set()` function.
@function set($key, $value) {
  variables.$dictionary: map.set(variables.$dictionary, $key, $value);
  @return variables.$dictionary;
}
```

{% endcode %}

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

### Parameters

#### `$key`

A key under which [`$value`](#usdvalue) is set in a [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default).

#### `$value`

A value to set under the [`$key`](#usdkey) of [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default).

### Return

The return value is a [global dictionary](/sass/translator-v1.0.0/dictionary/dictionary.variables.md#usddictionary-default) with updated [`$value`](#usdvalue) in the [`$key`](#usdkey).

## Examples

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

// Examples.
$-dictionary: (
  general: (word: słowo, (wrapper, wrap): owijka, (technology, technologia): tech, color: c),
  class: (prefix: class-prefix, separator: class-separator, suffix: class-suffix, calendars: (calendar: cal), labels: (label: lab)),
  prefix: spectre,
  border: b,
  color: c,
  separator: '-',
  suffix: end,
  outline: o,
  var: (prefix: var-prefix, suffix: var-suffix),
);

// Examples.
// Sets translation of `small` as `sm`
@debug translator.dictionary-set(small, sm); // (word: translation, small: sm)

// Sets the `class` dictionary
@debug translator.dictionary-set(class, map.get($-dictionary, class)); // (word: translation, small: sm, class: (prefix: class-prefix, separator: class-separator, suffix: class-suffix, calendars: (calendar: cal), labels: (label: lab)))

```
