# lang/set
Store a translation template under `(lang, app/phrase)`, replacing any prior value. Publishes a change event on the `"lang"` pub/sub topic and writes the app's catalog back to its source lang file. Returns the stored value.
## Syntax
[lang/set $lang "app/phrase" $template]
## Parameters
- `$lang` — language code (string or keyword)
- `"app/phrase"` — catalog key: app name, `/`, phrase
- `$template` — template string; `{name}` placeholders fill positionally, `{{` escapes a literal `{`
## Examples
[lang/set :es "chat/welcome" "Hola, {name}"] # → "Hola, {name}" [lang/set :en "chat/quit" "Quit"]
## Returns
The stored template string. `%Err{:message}` when fewer than three args are given, a lang/key argument is not a string or keyword, the value is not a string, the key lacks `app/phrase` form, or the catalog is out of memory.
Subscribers receive `%{ :app :lang :phrase :value :old }` under `:data`. Write-back is atomic (temp file + rename) and targets the file the app was loaded from; when no source is registered it defaults to `packages/<app>/lang.dft`.
## See Also
`lang/get`, `lang/unset`, `lang/load`