---
name: angular-fix-i18n
description: Run `extract-i18n`, merge `messages.xlf` into `messages.{lang}.xlf` files, and propose default translations for new `trans-unit` entries.
context: fork
---

Source `~/.nvm/nvm.sh`, then use `.nvmrc` at the Angular workspace root to use the right npm version.

Ensure your in the `frontend` directory.

Run the `extract-i18n` script defined in the Angular workspace's `package.json`:
```bash
npm run extract-i18n
```

Check for the `trans-unit` entries that were removed from `messages.xlf` and remove it from all `messages.{lang}.xlf` files.

Check for the `trans-unit` entries that were added to `messages.xlf` and for each add it to each `messages.{lang}.xlf` file, performing a translation on the fly. This additions should be performed only if the `trans-unit` is not present already in the target translation file.
