Was this helpful?

Default Locale

When creating itinerary content, it is recommended that you set the default locale for your content.

This locale can then be read back in order to add i18n to your application.

1# Create an itinerary and specify the default locale
2mutation CreateItinerary {
3  createItinerary(
4    itinerary: {
5      # Include a title
6      title: "Basic Itinerary Example"
7      # Recommended: Include a BCP-47 Locale
8      defaultLocale: "en"
9    }
10  ) {
11    itinerary {
12      id
13    }
14  }
15}

Sandbox: Configure | Try Operation

Information IconAlpaca uses BCP-47 / ISO 639-3 IETF language codes that appear like "en".
1# Obtain the locale to adjust your i18n translations in your application
2query GetItineraryLocale {
3  itinerary(id: "itinerary/ABC123") {
4    id
5
6    defaultLocale
7  }
8}

Sandbox: Configure | Try Operation

alpaca.tech

Copyright © 2024 - Made with love ❤️ in Australia.