Regional Technical Details

This document provides technical details about the Regional Content feature, primarily for developers or for advanced configuration after deployment.

Regional Content Architecture

The system uses a fallback chain to serve the most appropriate content based on the user's detected country and locale. The user's country is detected via the Cloudflare CF-IPCountry header.

Fallback Chain Logic:

  1. [collection]_[country]_[locale] (e.g., pricing_us_en)
  2. [collection]_[country] (e.g., pricing_us)
  3. [collection]_[tier]_[locale] (e.g., pricing_tier1_en)
  4. [collection]_[tier] (e.g., pricing_tier1)
  5. [collection]_[locale] (e.g., pricing_en)
  6. [collection] (e.g., pricing)

Configuration

Regional content settings are defined in app.config.ts.

Example configuration:

export default defineAppConfig({
  content: {
    regionalContent: {
      enabled: true,
      enabledFor: {
        pricing: true, // Enable for specific content types
      },
      countryMapping: {
        US: 'tier1',
        GB: 'tier1',
        IN: 'tier2',
      },
      countryOverrides: ['us'], // Explicitly override for specific countries
    },
  },
})

Programmatic Usage

To fetch regional content programmatically, use the useContent composable with the regional: true option.

<script setup>
// Automatically resolves the best content match
const { data: page } = await useContent('pricing', { regional: true })
</script>

Need a Landing Page?

Modern landing pages with optional modules (blog, docs, forms, i18n). Let's discuss your project.

Build Your MVP

Full-stack SaaS development. Expert in database design, multi-tenancy, and scalable architecture.

Deployment Help

Dockerize your backend, set up CI/CD pipelines, deploy to Cloudflare or Hetzner. Early-stage setup.

Suggest a SaaS Tool

Missing a calculator or tool? Suggest what you'd like to see on our site.