Skip to content
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

Feature: i18n manifest.json generation #24

Open
jlarmstrongiv opened this issue Oct 4, 2023 · 4 comments
Open

Feature: i18n manifest.json generation #24

jlarmstrongiv opened this issue Oct 4, 2023 · 4 comments

Comments

@jlarmstrongiv
Copy link

jlarmstrongiv commented Oct 4, 2023

I maintain astro-i18n-aut, an internalization (i18n) framework for Astro. Astro itself is preparing to support i18n in core.

It is possible to localize a PWA web manifest, but the current config assumes only one language.

There are issues in other vite-pwa packages describing similar functionality:

It would be wonderful to support i18n in @vite-pwa/astro


In the meantime, would I be able to add it myself if I:

  • disable the manifest with manifest: false, and includeManifestIcons: false,
  • create my own i18n webmanifest files using Astro endpoints
  • use the cli to generate icons
@userquin
Copy link
Member

userquin commented Oct 4, 2023

@jlarmstrongiv you can generate the webmanifest using an endpoint (add proper cache headers, dont cache and must-revalidate: max-age with 0 and must-revalidate, check elk.zone for the headers), you will need to add them via runtimeCaching and will not work offline after first visit (the cache will be created on first request and them cached).

Beware, some OS/browser will have long refresh period and not all features in the webmanifest will be updated: https://web.dev/manifest-updates/

You will need to exclude manifest with false and add the logic to add the webmanifest properly.

@userquin
Copy link
Member

userquin commented Oct 4, 2023

@jlarmstrongiv you can check elk.zone repo:

@jlarmstrongiv
Copy link
Author

Thank you @userquin! That’s extremely helpful.

I really like how your example supports dark mode and is excluded from the service worker cache. Seeing the header examples is helpful too.

@userquin
Copy link
Member

userquin commented Oct 4, 2023

@jlarmstrongiv here some pwa hints (user and develop) https://docs.elk.zone/pwa

Can be found in docs folder in elk repo (nuxt docus)

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

2 participants