0

I know how to do the translation with Angular XLF files, but it can be configured so that the translation files have the extension XMB.

The steps I took were:

1) Put the i18n tags in the html

2) ng xi18n --output-path src/locale --format=xmb

3) Copy the messages.xmb to another called messesage.it.xmb

4) Config the angular json to new translate

"it": {
         "aot": true,
         "outputPath": "dist/it/",
         "i18nFile": "src/locale/messages.it.xmb",
         "i18nFormat": "xmb",
         "i18nLocale": "it",
         "i18nMissingTranslation": "error"
      }

When you using XLF you had to put the translations in the properties, I think that in the case of XMB it is not necessary to set the target and the translation is placed directly in the , example:

<msg id="homeAboutMainTitle">
    Sobri Nozotris Italian
  </msg>

The problem comes when doing the build gives me an unknown error, does anyone know how to work with the XMB extension?

The error is: An unhandled exception occurred: Unsupported translation file format. See "C:\Users\MyUser\AppData\Local\Temp\ng-u2rhGQ\angular-errors.log" for further details.

juanjinario
  • 596
  • 1
  • 9
  • 24

2 Answers2

0

XLIFF and XMB are different formats, not the same format with different extensions.

XMB is Google specific, and there are not that many tools available for it.

What's wrong with XLIFF?

Mihai Nita
  • 5,547
  • 27
  • 27
0

Both XLIFF and XMB can be used in the process described above but in very different ways. XLIFF holds the original text and the matching translation for each sentence.

XMB holds the original text but when translating, a copy is made of the whole file and the text within the file is replaced with the translated text. It's likely that the error you are receiving is related to something introduced during translation, which is quite common. Translators may inadvertently edit code instead of text or there could be a foreign character added which is causing a break.

Are you able to share the original file, translated file and the error log?

Noel M
  • 11
  • 3