Interface Translation Add
interface_translation_addAdd a Drupal interface translation for a source string and langcode, creating the source string if missing and clearing the locale cache so new text appears immediately.
Instructions
Add an interface translation for one source string.
Written through Locale's own string storage -- createString() /
createTranslation() plus save() -- which is what locale:import
does with a .po file, one entry at a time. There is no
locale:translate:* command to run instead.
If the source string is not one Drupal has already collected, it is created too and the reply says so: a translation nobody will ever look up is worth knowing about. The locale lookup cache is invalidated, so the new text is visible without a cache rebuild.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| context | No | ||
| langcode | Yes | ||
| translation | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||