Skip to content

Region pages: read the custom-price billing period off the API - #96

Merged
v0l merged 5 commits into
mainfrom
fix/region-price-interval
Jul 30, 2026
Merged

Region pages: read the custom-price billing period off the API#96
v0l merged 5 commits into
mainfrom
fix/region-price-interval

Conversation

@v0l

@v0l v0l commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Closes #95. Depends on api#302 (LNVPS/api#347, not merged yet) — don't merge before that lands, VmCustomPrice doesn't carry interval_amount/interval_type until 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.tsVmCustomPrice gains interval_amount/interval_type.
  • src/utils/vps-seo.ts regionOfferJsonLdUnitPriceSpecification reads opts.price.interval_amount/interval_type instead of a hardcoded CostPlanIntervalType.MONTH, same as vpsTemplateJsonLd already 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."; CostAmount already appends the interval itself once interval_type is on the price it's given.
  • src/pages/vps-london.tsx, src/pages/vps-ireland.tsx, src/pages/vps-canada.tsx, bitcoin-node-hosting.tsx meta descriptions — new formatPriceWithInterval (src/utils/currency.ts) appends /<interval> to the plain-text price for the two Seo slots that can't take JSX.
  • src/components/cost.tsx IntervalSuffix now delegates to the same formatIntervalText helper formatPriceWithInterval uses, so the day/month/year wording can't drift between the JSX and plain-text renderings.
  • Tests: regionOfferJsonLd (billing period from the price, not hardcoded) and new currency.test.ts for the two helpers. bun test 41 pass, tsc --noEmit clean, 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 the ollama_intl prompt template.

@v0l
v0l merged commit 5ae1de6 into main Jul 30, 2026
3 checks passed
@v0l
v0l deleted the fix/region-price-interval branch July 30, 2026 19:33
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

Successfully merging this pull request may close these issues.

Region-page custom price hardcodes a monthly billing period

1 participant