Price Localization Guide

Convert prices to local currencies automatically. Mark up your HTML, configure exchange rates, and enable psychological pricing for every market.

1

Mark Prices with Data Attributes

Tell SiteLocaleAI which elements contain prices.

Add data-price and data-currency attributes to any element that displays a price. The JS library will detect these and convert them automatically:

When a visitor from Germany views this page, they see:

You can mark up any element -- spans, divs, table cells, or even entire pricing tables. The original text inside the element is replaced with the localized price.

For pricing tables with multiple prices, mark each one individually:

Your HTML

<!-- Single price -->
<span data-price="49" data-currency="USD">
  $49/month
</span>

<!-- Product price with sale -->
<div class="product">
  <span data-price="99" data-currency="USD">$99</span>
  <span data-price="79" data-currency="USD">$79</span>
</div>

Visitor in Germany sees

<!-- Visitor in Germany -->
<span>45 EUR/Monat</span>

<!-- Visitor in Japan -->
<span>7,400 JPY/month</span>

<!-- Visitor in UK -->
<span>£39/month</span>

Pricing table markup

<!-- Pricing table -->
<div class="pricing-table">
  <div class="plan">
    <h3>Starter</h3>
    <span data-price="49" data-currency="USD">$49/mo</span>
  </div>
  <div class="plan">
    <h3>Growth</h3>
    <span data-price="99" data-currency="USD">$99/mo</span>
  </div>
  <div class="plan">
    <h3>Enterprise</h3>
    <span data-price="249" data-currency="USD">$249/mo</span>
  </div>
</div>

.env

# Option 1: Open Exchange Rates
EXCHANGE_RATE_URL=https://openexchangerates.org/api/latest.json
EXCHANGE_RATE_API_KEY=your-oer-app-id

# Option 2: Exchange Rate API
EXCHANGE_RATE_URL=https://open.er-api.com/v6/latest

# Option 3: Custom JSON endpoint
EXCHANGE_RATE_URL=https://your-api.com/rates.json
2

Configure Exchange Rate Provider

Choose where exchange rates come from.

The SDK fetches exchange rates from any URL that returns a JSON object with a "rates" field. Set the EXCHANGE_RATE_URL environment variable in your SDK:

Supported providers:

  • Open Exchange Rates — Free tier supports 1,000 requests/month. Covers 170+ currencies.
  • Exchange Rate API — Free tier supports 1,500 requests/month. Simple REST API.
  • Custom URL — Point to any JSON endpoint that returns a rates object. Useful for internal APIs or self-hosted rate feeds.

Exchange rates are cached by the SDK in-process and refreshed every hour automatically.

.env

# Open Exchange Rates
EXCHANGE_RATE_URL=https://openexchangerates.org/api/latest.json
EXCHANGE_RATE_API_KEY=your-oer-app-id

# Custom endpoint
EXCHANGE_RATE_URL=https://your-api.com/rates.json
3

Enable Psychological Pricing

Round converted prices to optimal price points.

Raw currency conversion produces awkward prices like EUR 45.23 or JPY 7,342. The JS library automatically applies psychological pricing rules that feel natural to local shoppers.

No configuration needed -- the library picks the best strategy based on the target currency:

Built-in strategies:

  • charm — Rounds up to next whole unit then subtracts one cent (e.g. $9.99, GBP 7.99). Used for USD, GBP, AUD, CAD, and most decimal currencies.
  • clean — Rounds to a clean denomination that looks natural (e.g. JPY 7,400 or KRW 14,000). Used for zero-decimal currencies like JPY, KRW, VND.
  • prestige — Rounds to the nearest whole number with no cents (e.g. EUR 46). Used for EUR when the base price is a round multiple of 10 (luxury/premium pricing).
  • charm (EUR default) — EUR defaults to charm pricing for non-round base prices (e.g. EUR 45.99).

Example conversions showing each strategy:

Strategies (auto-selected)

# Pricing strategies are auto-selected per currency:
#   charm    — USD, GBP, AUD, CAD  (e.g. $9.99)
#   clean    — JPY, KRW, VND       (e.g. ¥4,480)
#   prestige — EUR (round amounts)  (e.g. €30)
#
# No configuration needed — the JS library
# picks the right strategy automatically.

Conversion examples

$49 USD → EUR (rate: 0.92, strategy: charm)
Raw:       EUR 45.08
Adjusted:  EUR 45.99   (ceil → subtract 0.01)

$50 USD → EUR (rate: 0.92, strategy: prestige)
Raw:       EUR 46.00
Adjusted:  EUR 46      (round base is multiple of 10)

$49 USD → JPY (rate: 151.2, strategy: clean)
Raw:       JPY 7,408.80
Adjusted:  JPY 7,400   (round to nearest 100)

$9.99 USD → GBP (rate: 0.79, strategy: charm)
Raw:       GBP 7.89
Adjusted:  GBP 7.99    (ceil → subtract 0.01)

Browser

# Force German locale
https://your-site.com?lang=de

# Force Japanese locale
https://your-site.com?lang=ja

Browser

# Override currency directly
https://your-site.com?currency=GBP
https://your-site.com?currency=JPY
https://your-site.com?currency=BRL
4

Test with Different Geolocations

Verify prices display correctly for each market.

Force a specific locale to test price conversions without a VPN:

You can also override the currency directly:

Check these scenarios:

  • USD prices convert correctly to EUR, GBP, JPY, and other target currencies
  • Psychological pricing rounds as expected for each strategy
  • Currency symbols and formatting match local conventions (e.g. 1.234,56 in Germany vs 1,234.56 in US)
  • Prices update when switching languages via the language switcher

Browser

https://your-site.com?lang=de
https://your-site.com?currency=GBP

Prices are now localized!

Combine price localization with text translation and SEO pre-rendering for a fully international site.