Namespacing problem with i18n-ally and Transloco

Discussão em 'Angular' iniciado por Knut Marius, Setembro 9, 2025.

  1. Knut Marius

    Knut Marius Guest

    Set up Transloco for an Angular app, and I want to use i18n-ally to be able to see and edit the i18n resources directly from the code files.

    However, I'm having a problem getting the path matching functionaltiy in i18n-ally to work with keys that have optional namespace/scope.

    Say I have a base set of translations in /i18n/en.json , and a separate scope in /i18n/myscope/en.json

    Using the pathMatcher

    "i18n-ally.pathMatcher": "{namespace}/{locale}.json"


    Now it will work with namespaced keys like "myscope.title", but it will not be able to resolve just "title" from the base file. If I remove the namespace from the pathMatcher, only the base file will be used, and not the scoped ones.

    It seems to me that pathMatcher does not support passing multiple matchers, so are there other good options to get this to work? I would like to avoid forcing a namespace on the base translations, if possible.

    If not, are there other good vscode plugins similar to i18n-ally that will ease the work of dealing with translation files in Angular code?

    Continue reading...

Compartilhe esta Página