@@ -4,11 +4,33 @@ import Link from '@docusaurus/Link';
44import Head from '@docusaurus/Head' ;
55import Layout from '@theme/Layout' ;
66
7+ import { useLocale , useTranslation , type Locale } from '../i18n/useTranslation' ;
8+ import { solutionShell } from '../i18n/content/solutionShell' ;
79import styles from './SolutionPage.module.css' ;
810
911const SALES_EMAIL = 'sales@tictactrip.eu' ;
1012const SITE_URL = 'https://api.tictactrip.eu' ;
1113
14+ const OG_LOCALE : Record < Locale , string > = {
15+ en : 'en_US' ,
16+ fr : 'fr_FR' ,
17+ de : 'de_DE' ,
18+ es : 'es_ES' ,
19+ it : 'it_IT' ,
20+ pt : 'pt_PT' ,
21+ ru : 'ru_RU' ,
22+ } ;
23+
24+ const SCHEMA_LANG : Record < Locale , string > = {
25+ en : 'en' ,
26+ fr : 'fr' ,
27+ de : 'de' ,
28+ es : 'es' ,
29+ it : 'it' ,
30+ pt : 'pt' ,
31+ ru : 'ru' ,
32+ } ;
33+
1234export type SolutionFaq = {
1335 q : string ;
1436 a : string ;
@@ -41,21 +63,21 @@ export type SolutionPageProps = {
4163 serviceType : string ;
4264 audienceType : string ;
4365 related : Array < { title : string ; slug : string } > ;
44- /** Breadcrumb category. Defaults to "Solutions". */
4566 breadcrumbCategory ?: string ;
46- /** Href for the breadcrumb category link. Defaults to "/#use-cases". */
4767 breadcrumbCategoryHref ?: string ;
48- /** Override the "Why Tictactrip for ..." section heading. */
4968 benefitsHeading ?: string ;
50- /** Override the "Other Tictactrip solutions" related-cards heading. */
5169 relatedHeading ?: string ;
5270} ;
5371
5472export default function SolutionPage ( props : SolutionPageProps ) : JSX . Element {
55- const canonical = `${ SITE_URL } ${ props . slug } ` ;
73+ const locale = useLocale ( ) ;
74+ const shell = useTranslation ( solutionShell ) ;
75+ const localePrefix = locale === 'en' ? '' : `/${ locale } ` ;
76+ const canonical = `${ SITE_URL } ${ localePrefix } ${ props . slug } ` ;
5677 const breadcrumbCategory = props . breadcrumbCategory ?? 'Solutions' ;
5778 const breadcrumbCategoryHref = props . breadcrumbCategoryHref ?? '/#use-cases' ;
58- const benefitsHeading = props . benefitsHeading ?? `Why Tictactrip for ${ props . title . toLowerCase ( ) } ` ;
79+ const benefitsHeading =
80+ props . benefitsHeading ?? `Why Tictactrip for ${ props . title . toLowerCase ( ) } ` ;
5981 const relatedHeading = props . relatedHeading ?? 'Other Tictactrip solutions' ;
6082
6183 const breadcrumb = {
@@ -66,13 +88,13 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
6688 '@type' : 'ListItem' ,
6789 position : 1 ,
6890 name : 'Tictactrip' ,
69- item : `${ SITE_URL } /` ,
91+ item : `${ SITE_URL } ${ localePrefix } /` ,
7092 } ,
7193 {
7294 '@type' : 'ListItem' ,
7395 position : 2 ,
7496 name : breadcrumbCategory ,
75- item : `${ SITE_URL } ${ breadcrumbCategoryHref } ` ,
97+ item : `${ SITE_URL } ${ localePrefix } ${ breadcrumbCategoryHref } ` ,
7698 } ,
7799 {
78100 '@type' : 'ListItem' ,
@@ -121,7 +143,7 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
121143 name : 'Tictactrip Documentation' ,
122144 url : `${ SITE_URL } /` ,
123145 } ,
124- inLanguage : 'en' ,
146+ inLanguage : SCHEMA_LANG [ locale ] ,
125147 primaryImageOfPage : {
126148 '@type' : 'ImageObject' ,
127149 url : `${ SITE_URL } /img/logoTextBlack.svg` ,
@@ -150,7 +172,7 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
150172 < meta property = "og:description" content = { props . metaDescription } />
151173 < meta property = "og:url" content = { canonical } />
152174 < meta property = "og:site_name" content = "Tictactrip Documentation" />
153- < meta property = "og:locale" content = "en_US" />
175+ < meta property = "og:locale" content = { OG_LOCALE [ locale ] } />
154176 < meta name = "twitter:card" content = "summary_large_image" />
155177 < meta name = "twitter:title" content = { props . metaTitle } />
156178 < meta name = "twitter:description" content = { props . metaDescription } />
@@ -161,7 +183,7 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
161183 </ Head >
162184
163185 < main className = { styles . main } >
164- < nav className = { styles . breadcrumb } aria-label = "Breadcrumb" >
186+ < nav className = { styles . breadcrumb } aria-label = { shell . breadcrumbAriaLabel } >
165187 < div className = "container" >
166188 < ol >
167189 < li >
@@ -184,12 +206,12 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
184206 < p className = { styles . heroLead } > { props . heroLead } </ p >
185207 < div className = { styles . heroCtas } >
186208 < Link className = { clsx ( 'button button--lg' , styles . btnPrimary ) } to = "/docs/intro" >
187- Read the API tutorial
209+ { shell . heroPrimaryCta }
188210 </ Link >
189211 < a
190212 className = { clsx ( 'button button--lg' , styles . btnSecondary ) }
191213 href = { `mailto:${ SALES_EMAIL } ?subject=Tictactrip%20API%20-%20${ encodeURIComponent ( props . title ) } ` } >
192- Request API access
214+ { shell . heroSecondaryCta }
193215 </ a >
194216 </ div >
195217 </ div >
@@ -211,9 +233,7 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
211233 < section className = { clsx ( styles . section , styles . sectionAlt ) } >
212234 < div className = "container" >
213235 < h2 className = { styles . sectionTitle } > { benefitsHeading } </ h2 >
214- < p className = { styles . sectionSubtitle } >
215- The capabilities partners ship on day one.
216- </ p >
236+ < p className = { styles . sectionSubtitle } > { shell . benefitsSubtitle } </ p >
217237 < div className = { styles . benefitGrid } >
218238 { props . benefits . map ( ( b ) => (
219239 < article key = { b . title } className = { styles . benefitCard } >
@@ -230,19 +250,15 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
230250 < div className = "container" >
231251 < div className = { styles . codeGrid } >
232252 < div >
233- < span className = { styles . kicker } > Integration</ span >
234- < h2 className = { styles . sectionTitle } > One REST call, multimodal results</ h2 >
235- < p className = { styles . lead } >
236- The same endpoint powers every Tictactrip integration. Authenticate, send a search
237- payload, and receive itineraries with price, duration, carrier and CO₂ emissions.
238- Then book through < code > /book</ code > and deliver tickets to your users.
239- </ p >
253+ < span className = { styles . kicker } > { shell . integrationKicker } </ span >
254+ < h2 className = { styles . sectionTitle } > { shell . integrationHeading } </ h2 >
255+ < p className = { styles . lead } > { shell . integrationCopy } </ p >
240256 < div className = { styles . heroCtas } >
241257 < Link className = { clsx ( 'button button--lg' , styles . btnPrimary ) } to = "/docs/intro" >
242- Start the tutorial
258+ { shell . startTutorialCta }
243259 </ Link >
244260 < Link className = { clsx ( 'button button--lg' , styles . btnGhost ) } to = "/api" >
245- Browse the API reference
261+ { shell . apiReferenceCta }
246262 </ Link >
247263 </ div >
248264 </ div >
@@ -261,10 +277,8 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
261277
262278 < section className = { clsx ( styles . section , styles . sectionAlt ) } id = "faq" >
263279 < div className = "container" >
264- < h2 className = { styles . sectionTitle } > Frequently asked questions</ h2 >
265- < p className = { styles . sectionSubtitle } >
266- The points product and engineering teams check before integrating.
267- </ p >
280+ < h2 className = { styles . sectionTitle } > { shell . faqHeading } </ h2 >
281+ < p className = { styles . sectionSubtitle } > { shell . faqSubtitle } </ p >
268282 < div className = { styles . faqList } >
269283 { props . faqs . map ( ( item ) => (
270284 < details key = { item . q } className = { styles . faqItem } >
@@ -294,18 +308,16 @@ export default function SolutionPage(props: SolutionPageProps): JSX.Element {
294308
295309 < section className = { clsx ( styles . section , styles . sectionCta ) } >
296310 < div className = "container" >
297- < h2 className = { styles . ctaTitle } > Ready to integrate Tictactrip?</ h2 >
298- < p className = { styles . ctaLead } >
299- Tell us about your project and we'll come back within one business day with a tailored plan.
300- </ p >
311+ < h2 className = { styles . ctaTitle } > { shell . ctaHeading } </ h2 >
312+ < p className = { styles . ctaLead } > { shell . ctaLead } </ p >
301313 < div className = { styles . heroCtas } >
302314 < a
303315 className = { clsx ( 'button button--lg' , styles . btnPrimary ) }
304316 href = { `mailto:${ SALES_EMAIL } ?subject=Tictactrip%20API%20-%20${ encodeURIComponent ( props . title ) } ` } >
305- Contact sales
317+ { shell . contactSalesCta }
306318 </ a >
307319 < Link className = { clsx ( 'button button--lg' , styles . btnSecondary ) } to = "/" >
308- Back to homepage
320+ { shell . backToHomeCta }
309321 </ Link >
310322 </ div >
311323 </ div >
0 commit comments