Removal of L10nLocation Interface and L10nRoutingModule
Closed this issue · 2 comments
Hello @robisim74,
Our main application has been using your library since Angular v2, and we have consistently followed the significant updates to the library's API. However, we are now in a situation where we want to have our custom localized paths (e.g., fr/fr or fr/en), but with the L10nRoutingModule and the L10nLocation class removed, it seems more complicated.
Why were the L10nLocation interface and the L10nRoutingModule removed?
Also, why are there now default non-localized routes enforced?
Can custom localized paths still be achieved?
Thank you for your assistance.
Best regards,
Hi @0nza1101,
L10nRoutingModule
has been removed because many devs encountered several problems with its approach (url replacing).
The new suggested approach, without url replacing, but with manual url management, can be found here: https://github.com/robisim74/angular-l10n?tab=readme-ov-file#localized-routing and in the example app in this repo.
If in your case the old approach worked, and you want to continue using it without breaking changes, you can copy the classes into your project:
https://github.com/robisim74/angular-l10n/blob/angular_v15/projects/angular-l10n/src/lib/services/l10n-location.ts
https://github.com/robisim74/angular-l10n/blob/angular_v15/projects/angular-l10n/src/lib/services/l10n-routing.service.ts
https://github.com/robisim74/angular-l10n/blob/angular_v15/projects/angular-l10n/src/lib/modules/l10n-routing.module.ts
https://github.com/robisim74/angular-l10n/blob/angular_v15/projects/angular-l10n/src/lib/services/l10n-loader.ts
In the same branch you can also find the types you need to complete the porting.
I managed to get it working like before, the module is well decoupled from the rest, thanks for the suggestion.