- Issue created by @Grevil
- 🇩🇪Germany Anybody Porta Westfalica
Wouldn't this simply mean to make the config values translatable and add the config translation form for such values?
And then use these values for the different paths?Anyway I'm still not sure how to handle manifest.jsons for such cases correctly in general. Perhaps we should take a look at large multilang websites providing manifest.jsons?
- 🇩🇪Germany Grevil
But we should make clear to the user, that the translation of both "scope" and "start_url" needs to specify the website's language paths. As well as a few other config values. We should really carefully look over each config entry and check if and how a translated value could look like.
- 🇩🇪Germany Anybody Porta Westfalica
Yeah, I think this is an indeed complex and complicated issue we should handle with care. No quick shots.
- 🇩🇪Germany Grevil
Ok I did some researching and these are my thoughts on the config keys to translate:
Manifest Settings:
- site_name => Yes
- short_name => Yes
- description => Yes
- categories => Might eventually make sense, there is a list of known categories here: https://www.w3.org/TR/manifest-app-info/#categories-member, but users might want to add language specific categories? Lets further discuss this.
- start_url => Yes, translation could have the different site language prefixes (e.g. "/en" or "mypwa/de").
- scope => Yes, translation could have the different site language prefixes (e.g. "/en" or "mypwa/de").
- lang => Remove this config entirely.
- theme_color => No
- background_color => No
- display => No
- orientation => No
- default_image => No
- cross_origin => No
Service Worker Settings:
- urls_to_cache => Needs further discussion. Currently, these urls are already language prefixed through our serviceworker.js (specifically through "getLanguagePathPrefix()"). BUT It seems like the logic there won't do anything, if the response is prefixed with something like 'myApp/en', since it uses url.pathname.startsWith(`/${langcode}`) to specify the used langcode.
- urls_to_exclude => Needs further discussion, see above.
- offline_page => Yes, translation could have the different site language prefixes (e.g. "/en" or "mypwa/de").
- cache_version => No
- skip_waiting => No
At first look, what do you think about this @Anybody?
- 🇩🇪Germany Anybody Porta Westfalica
Re:
- categories No translation, as it's always EN (technical name)
- lang => Remove this config entirely. => I don't think so, as this might be important for the client. Perhaps we should return the Drupal language value by default, if no value entered, but allow to override the automatism by entering an overwrite string (translatable)?
- urls_to_cache => No (only makes things harder and the list can just be merged)
- urls_to_exclude => No (same as above)
Totally agree with the rest!
- 🇩🇪Germany Grevil
lang => Remove this config entirely. => I don't think so
I digress. "lang" isn't used anywhere in the module. But WAIT! This is really unusual... I just wanted to comment, that "lang" is NOT a valid manifest.json member, but it actually is! But for some reason it is only specified in https://www.w3.org/TR/appmanifest/#lang-member but not listed on the mdn page: https://developer.mozilla.org/en-US/docs/Web/Manifest. That is really weird... But I guess we should trust the w3c standard? But I am wondering, if this is even properly implemented for most modern browsers, if it isn't listed as a valid key in the mdn docs...
Furthermore, we should take a look at https://www.w3.org/TR/appmanifest/#dir-member, which is ALSO not listed on the mdn docs... need feedback on this.
I forgot we can use the asterisk inside "urls_to_cache", so I agree, "NO" would be better. BUT we should change the getLanguagePathPrefix() implementation.
- 🇩🇪Germany Anybody Porta Westfalica
PS: But please add an example and link to https://www.w3.org/TR/appmanifest/#lang-member
otherwise it might be unclear which format is expected. - 🇩🇪Germany Grevil
Re #8 then I think for now, just make it optional and translatable, so the user can chose to leave it out
There currently isn't a form element for 'lang' and the config entry isn't used. I'd say we remove it for now. We can reintroduce it later if needed.
- last update
over 1 year ago 9 pass - @grevil opened merge request.
- Status changed to Needs review
over 1 year ago 2:29pm 8 September 2023 - 🇩🇪Germany Grevil
All done. I am unsure, if we need to add functionality to the update hook, since a few of these configs were originally translatable.
Furthermore, do we need any description changes? What do you think @Anybody? Please review for now.
- Status changed to Needs work
over 1 year ago 2:58pm 8 September 2023 - 🇩🇪Germany Anybody Porta Westfalica
- 🇩🇪Germany Anybody Porta Westfalica
As just discussed, please also add "dir" with "ltr" as default.
It's just a simple select for the text direction (left to right vs. right to left). For most parts of the world it's ltr. Let's make it a simple select option.
- last update
over 1 year ago 1 pass, 2 fail - last update
over 1 year ago 1 pass, 2 fail - last update
over 1 year ago 9 pass - last update
over 1 year ago 9 pass - Status changed to Needs review
over 1 year ago 2:04pm 11 September 2023 - 🇩🇪Germany Grevil
Not sure about not setting a default value for "dir", but not one for "lang", as they are really tidely coupled.
- 🇩🇪Germany Anybody Porta Westfalica
dir=ltr should be fine, I think. Let's take that one. Also makes sense, as it's a select. But yes, you can also leave it empty, as it's an optional setting anyway. Throw a dice ;)
- 🇩🇪Germany Anybody Porta Westfalica
Sorry, setting "auto" is correct. Just had a look into the specification!
- Status changed to RTBC
over 1 year ago 2:16pm 11 September 2023 - 🇩🇪Germany Anybody Porta Westfalica
@Grevil nice work! Just one last documentation fix!
All other things are RTBC, once tested manually!
- last update
over 1 year ago 9 pass - Status changed to Needs work
over 1 year ago 2:38pm 11 September 2023 - last update
over 1 year ago 9 pass - Status changed to Needs review
over 1 year ago 2:42pm 11 September 2023 - Assigned to Grevil
- Status changed to Needs work
over 1 year ago 3:38pm 11 September 2023 - 🇩🇪Germany Anybody Porta Westfalica
Left a comment!
Furthermore, are'nt we missing the config_translation.yml → for the appropriate UI?
- last update
over 1 year ago 9 pass - 🇩🇪Germany Grevil
@Anybody, you are right!
missing target="_blank"
Unsure about implicitly using target="blank" here. The user can easily decide himself I think.
- Status changed to Needs review
over 1 year ago 7:49am 12 September 2023 - 🇩🇪Germany Grevil
Never mind, the config_translation.yml already exists and I don't like the implicit "_blank" call, so setting this back to need review.
- Status changed to Needs work
over 1 year ago 3:44pm 12 September 2023 - 🇩🇪Germany Anybody Porta Westfalica
Explicit "_blank" call totally makes sense to external and especially doc URLs. Discarding the current tab for that is just bad UX. Please add it.
config_translation.yml already existed, nice indeed!
So just the _blank thing, then we're fine!
- last update
over 1 year ago 9 pass - Status changed to Needs review
over 1 year ago 7:15am 13 September 2023 - Issue was unassigned.
- Status changed to RTBC
over 1 year ago 7:26am 13 September 2023 - Status changed to Fixed
over 1 year ago 7:27am 13 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.