Skip to Content
GuidesLocalisationWorking with Translations

Working with Translations

Gymlium handles all translation management. Your job as a template developer is to use the t() function for every piece of user-facing text — never hardcode strings.

Using t()

The t() function is available from the useApp() hook:

import { useApp } from '@/hooks/useApp' export default function HomeContent() { const { t, clientName } = useApp() return ( <main> <h1>{t('welcomeTo')} {clientName}</h1> <p>{t('heroSubtitle')}</p> <a href="#">{t('getStarted')}</a> </main> ) }

How it works

  1. The platform provides a translation dictionary for each locale
  2. t('key') looks up the key in the current locale’s dictionary
  3. If the key exists, the translated string is returned
  4. If the key doesn’t exist, the key itself is returned as a fallback

Common translation keys

These keys are available in all Gymlium locales. Use them in your template:

KeyEnglish value
homeHome
aboutAbout
servicesServices
blogBlog
contactContact
loginSign In
logoutSign Out
myAccountMy Account
scheduleSchedule
eventsEvents
testimonialsTestimonials
pricingPricing
privacyPrivacy Policy
termsTerms of Service
welcomeToWelcome to
heroSubtitleYour personal training journey starts here
getStartedGet Started
learnMoreLearn More
viewServicesView Services
bookSessionBook a Session
readMoreRead More
viewAllView All
allRightsReservedAll rights reserved
footerTaglineTransform your body, transform your life
toggleMenuToggle menu
noResultsFoundNo results found
loadingLoading…
backToHomeBack to Home
sendMessageSend Message
yourNameYour Name
yourEmailYour Email
messageMessage

Never hardcode text

// ❌ Wrong — this will only work in English <button>Sign In</button> // ✅ Correct — works in all 14 languages <button>{t('login')}</button>
// ❌ Wrong — hardcoded text in JSX <p>No results found</p> // ✅ Correct — uses translation <p>{t('noResultsFound')}</p>

Hardcoded text is one of the most common reasons for template rejection during review. Automated scans check for untranslated strings in your components.

Locale-aware formatting

Numbers

Use Intl.NumberFormat with the current locale for number formatting:

const { locale } = useApp() const formatter = new Intl.NumberFormat(locale, { style: 'currency', currency: 'GBP', }) return <span>{formatter.format(29.99)}</span> // en: £29.99 // ar: ٢٩٫٩٩ ج.م. // de: 29,99 £

Dates

Use Intl.DateTimeFormat with the current locale:

const { locale } = useApp() const dateFormatter = new Intl.DateTimeFormat(locale, { year: 'numeric', month: 'long', day: 'numeric', }) return <time>{dateFormatter.format(new Date())}</time> // en: April 26, 2026 // ar: ٢٦ أبريل ٢٠٢٦ // fr: 26 avril 2026

Relative time

const { locale } = useApp() const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }) return <span>{rtf.format(-1, 'day')}</span> // en: yesterday // ar: أمس // fr: hier

Always pass the locale from useApp() to Intl formatters. This ensures numbers, dates, and relative times display correctly for every language.

Last updated on