Repository navigation
docs(storefront): document Accept-Language and add a locale variable - #72
Merged
Merged
Conversation
Storefront v0.4.30 answers in the request's Accept-Language (en, mn, uk) and remembers it for the signed-in customer's notifications (fleetbase/storefront#164). The collection now describes that, and a collection script sends the new locale variable as Accept-Language when it is set.
6 of 16 tasks
The description is also rendered on fleetbase.io, where "this collection" reads oddly.
Member
Author
|
fleetbase/fleetbase.io#146 renders this collection description as /docs/api/storefront/overview. Its vendor/postman bump follows once this is merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Storefront v0.4.30 answers in the language of the
Accept-Languagerequest header (en, mn, uk). It also stores that language on the signed-in customer, so their order notifications use it (fleetbase/storefront#164). This PR documents that in the Storefront API collection. It also adds alocalevariable, so the collection can send the header.Related Issue
Follows fleetbase/storefront#164 and fleetbase/fleetbase
release/v0.7.74(eb6468e7c, Mongolian and Ukrainian Laravel validation messages).Type of Change
Implementation Notes
Storefront collection
description. The collection had no description before. It now has three parts:Customer-Tokenfor signed-in customer endpoints.errorand validation messages, and verification SMS and emaillocalecollection variable. Empty by default. A collectionhttp:beforeRequestscript upsertsAccept-Language: {{locale}}only when the variable is set, so existing runs send exactly what they did before.README. One line under Variable Conventions describes
locale.Request and response payloads are unchanged, and no request files were touched.
Validation
I did not run the collection against a live server. The script is a no-op unless
localeis set.Documentation Impact
fleetbase/fleetbase.ioAPI Reference Impact
fleetbase/postmanAPI reference notes:
Accept-Languageis optional on every Storefront endpoint. It changes only the language of human-readable text.Documentation Notes
fleetbase.io's
scripts/generate-api-docs.mjsreads each resource folder's.resources/definition.yamldescription, not the collection-level one. So the Localization section shows in Postman but won't appear on the generated API reference by itself. fleetbase.io needs one of two things:After either, bump its
vendor/postmansubmodule.Risk
None for existing runs: the new script does nothing while
localeis empty. The behaviour described needs Storefront v0.4.30, so setlocaleonly against a server running it.