question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Partial translations not lazy loading when using with router-ui resolve

See original GitHub issue

Hi,

I’m trying to get the translations to be loaded lazily by adding the “addPart” within one of the resolve method in my router, but this is not working.

Here is the code:

locales: function($translatePartialLoader, $translate) {
    $translatePartialLoader.addPart('contacts');
    console.log('addPart');
    return $translate.refresh();
}

When I load the application I can see the “addPart” logged in the console, but the translations are not loaded and the file has not been loaded (not present in the network). However, when I navigate within the application the partical is loaded immediately and everything works as excepted.

Do you have any idea why ?

Best regards Daniel

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
DWandcommented, Jan 28, 2015

@ptgamr, do you call the refresh method of the $translate service?

0reactions
islemuscommented, Jun 1, 2015

Indeed, adding a $translateProvider.use(); in the config block solves the issue in 2.7.0

Thanks !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy-loading feature modules - Angular
Setting up a lazy-loaded feature module requires two main steps: Create the feature module with the Angular CLI, using the --route flag. Configure...
Read more >
How to load Angular translate with external modules loaded ...
I solved using in the main app controllert a new function called when the link in the navigation is clicked:
Read more >
Lazy loading and code splitting in Vue.js - Vue School Blog
The answer is easy — lazy loading and code splitting. As the name suggests lazy loading is a process of loading parts (chunks)...
Read more >
Lazy Loading Routes | Vue Router
With webpack #. Sometimes we may want to group all the components nested under the same route into the same async chunk. To...
Read more >
How to Lazy Load in Ionic Angular - Ionic Blog
Lazy loading is expressed through how the Angular routes are setup: ... NoPreloading: Does not perform any preloading of lazily loaded ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found