Closed Spomky closed 3 weeks ago
Ping @tacman.
This PR will allow to generate multiple translated manifest files.
{locale}
:pwa:
manifest:
enabled: true
locales:
- 'en'
- 'de'
public_url: 'site.{locale}.webmanifest'
{{ pwa(locale=app.request.locale) }}
pwa
e.g. pwa+intl-icu.en.xlf
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
<header>
<tool tool-id="symfony" tool-name="Symfony"/>
</header>
<body>
<trans-unit id="VKDowX61" resname="app.name">
<source>app.name</source>
<target>My PWA</target>
</trans-unit>
</body>
</file>
</xliff>
Shouldn't the locales default to the framework enabled_locales key? That way we don't have to manually keep them in sync.
https://symfony.com/doc/current/reference/configuration/framework.html#enabled-locales
Updated various modules to support localization, primarily adjusting how manifest files are generated and served. Added new "locales" configuration parameter, made necessary adjustments in manifest and service worker compilers. Additionally, refactored the twig runtime to properly handle localized manifest URLs.
Target branch: Resolves issue #