Menu

Generating Localised Price Tables From One JSON Source
📰

Generating Localised Price Tables From One JSON Source

DEV Community: javascript·Peter Panda·about 21 hours ago
#gRCuyRgQ
#devtojavascript#devto#dev#locale#price
Reading 0:00
15s threshold

A pricing page that exists in six languages usually ends up with six slightly different price tables. Someone updates the English plan limits, forgets the Japanese page, and now an AI assistant or a customer quotes the wrong number. The fix is to treat prices as data and render every language version from one source.

One source of truth

{ "currency_by_locale" : { "en" : "USD" , "de" : "EUR" , "ja" : "JPY" , "pt-BR" : "BRL" }, "plans" : [ { "id" : "starter" , "price" : { "USD" : 29 , "EUR" : 27 , "JPY" : 4300 , "BRL" : 149 }, "seats" : 3 , "features" : [ "chat" , "reports" ]}, { "id" : "growth" , "price" : { "USD" : 99 , "EUR" : 92 , "JPY" : 14800 , "BRL" : 499 }, "seats" : 10 , "features" : [ "chat" , "reports" , "api" ]} ], "updated" : "2026-10-31" }

Enter fullscreen mode

Exit fullscreen mode

Prices per currency are set explicitly rather than converted on the fly.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.