Skip to content

Bug: Scope names cannot contain some basic characters? #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
mikoet opened this issue May 26, 2021 · 3 comments
Open
2 tasks done

Bug: Scope names cannot contain some basic characters? #451

mikoet opened this issue May 26, 2021 · 3 comments

Comments

@mikoet
Copy link

mikoet commented May 26, 2021

Current behavior

In an Angular component I want to make use of lazy loaded translations.

This works (scope name: "dftpa"):
<h2 mat-dialog-title *transloco="let t; scope: 'dftpa'">{{ t('dftpa.title') }}</h2>

Those do not work (scope names: "d:ftpa", "d_ftpa", "d!ftpa"):
<h2 mat-dialog-title *transloco="let t; scope: 'd:ftpa'">{{ t('d:ftpa.title') }}</h2>
<h2 mat-dialog-title *transloco="let t; scope: 'd_ftpa'">{{ t('d_ftpa.title') }}</h2>
<h2 mat-dialog-title *transloco="let t; scope: 'd!ftpa'">{{ t('d!ftpa.title') }}</h2>

In the network tab of my browser inspectation I can see that Transloco does indeed load the lazy translation files, but for scopes that contain either ":", "_" or "!" it does not do the actual translations.

Expected behavior

I would have excepted the latter three snippets to work just like the first one.

Minimal reproduction of the problem with instructions

You just need to add ":", "_" or "!" into the scope name of a lazy loaded translation bundle.

Environment

- Transloco version: 2.20.1
- Angular version: 10.2.4 (updating to 11.x did not work last time, I'd have to investigage more)

For Tooling issues:


- Node version: v16.1.0
- Platform:  Mac

Browser:

  • Chrome (desktop) version 91.0.4472.77
  • Safari (desktop) version 14.0.3
@mikoet mikoet changed the title Bug: Bug: Scope names cannot contain some basic characters May 29, 2021
@mikoet mikoet changed the title Bug: Scope names cannot contain some basic characters Bug: Scope names cannot contain some basic characters? May 29, 2021
@itayod
Copy link
Contributor

itayod commented Jun 9, 2021

@mikoet please take a look at this section in the docs, that might solve your problem

@Remls
Copy link

Remls commented Aug 3, 2022

Above link is broken, but I believe it has now been moved here.

@shaharkazaz
Copy link
Collaborator

@mikoet Does the alias resolves your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants