-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Single PWA with i18n #43796
Copy link
Copy link
Closed as not planned
Labels
area: i18nIssues related to localization and internationalizationIssues related to localization and internationalizationarea: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area: i18nIssues related to localization and internationalizationIssues related to localization and internationalizationarea: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Which @angular/* package(s) are relevant/releated to the feature request?
localize, service-worker
Description
Following up on this post on stackoverflow.
After adding internationalization (
i18n) to our app we run into the big problem of backwards compatibility. Before addingi18nwe had our service worker at the root folder and after addingi18nwe now have a separate service worker for each language we translated the app into. This is a problem because a user that installed the app prior to this change will not correctly get updates because the old service worker will not be able to find the new service worker.This is the default behavior of Angular and left us with the decision that we either have to tell all our users that they will have to uninstall and re-install the app or add a service worker in the root folder that automatically takes care of the migration and leave it deployed until all users are migrated. Theses solutions are rather unsatisfying, poorly documented and mean that a we would have to go through the same struggle again if we decide to remove the
i18nor take a different approach for it.Proposed solution
It would be great if Angular would not enforce to use the one-PWA-per-language approach but rather leave this as a choice to the developer. This would make the transition from a single- to a multi-language app much easier and leaves the option open to also go back to the previous approach (no
i18n).This could be configured through the compiler options in the
angular.jsonfile. E.g.rootServiceWorker: true.Alternatives considered
Alternatively, it would be great if Angular provided a guide or a predefined service worker (similar to the
safety-worker.js) that allows a easy migration of the PWAs wheni18nis introduced.