Region pages: read the custom-price billing period off the API - #96
Merged
Conversation
Signed-off-by: v0l <kieran@harkin.me>
Signed-off-by: v0l <kieran@harkin.me>
Signed-off-by: v0l <kieran@harkin.me>
Signed-off-by: v0l <kieran@harkin.me>
Signed-off-by: v0l <kieran@harkin.me>
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.
Closes #95. Depends on api#302 (LNVPS/api#347, not merged yet) — don't merge before that lands,
VmCustomPricedoesn't carryinterval_amount/interval_typeuntil it does.Every "from" price on the region pages assumed monthly because the price endpoint had nothing else to say. Now it does, so:
src/api.ts—VmCustomPricegainsinterval_amount/interval_type.src/utils/vps-seo.tsregionOfferJsonLd—UnitPriceSpecificationreadsopts.price.interval_amount/interval_typeinstead of a hardcodedCostPlanIntervalType.MONTH, same asvpsTemplateJsonLdalready does for standard plans.src/components/region-landing.tsx,src/pages/bitcoin-node-hosting.tsx— "From {price} per month, excluding VAT." → "From {price}, excluding VAT.";CostAmountalready appends the interval itself onceinterval_typeis on the price it's given.src/pages/vps-london.tsx,src/pages/vps-ireland.tsx,src/pages/vps-canada.tsx,bitcoin-node-hosting.tsxmeta descriptions — newformatPriceWithInterval(src/utils/currency.ts) appends/<interval>to the plain-text price for the twoSeoslots that can't take JSX.src/components/cost.tsxIntervalSuffixnow delegates to the sameformatIntervalTexthelperformatPriceWithIntervaluses, so the day/month/year wording can't drift between the JSX and plain-text renderings.regionOfferJsonLd(billing period from the price, not hardcoded) and newcurrency.test.tsfor the two helpers.bun test41 pass,tsc --noEmitclean, build clean at a15c5ef.Aside, not this PR: translating the changed strings surfaced pre-existing placeholder-adjacent punctuation gluing in a few non-Latin locales (e.g. German/Arabic/Japanese/Russian dropping the space after
{diskType}) — already present in the currently-shipped translations for the same sentences under their old wording, not something this PR introduced. Flagging for whoever next touches theollama_intlprompt template.