• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
  • Global Configuration
    • Environment Variables
    • Feature Flags
    • Adding API Routes
    • Change Authentication strategy
    • Fetching the signed in User
    • Reading Records from Postgres
    • Seeding Local Data
    • Introduction
    • Configuring Plans
    • Project Configuration
    • Updating the Navigation menu
    • Adding a new translation string
    • Supabase is not starting
    • Calling API Routes from the client
    • Adding Pages
    • Updating the Sidebar menu
    • Setup oAuth
    • Fetching the selected Organization
    • Resetting the local DB
    • Running the Stripe Webhook locally
    • Branding
    • Setting a Default Language
    • Supabase is not stopping
    • Dark Theme
    • Theming
    • Generating Database Types
    • Updating the Logo
    • Adding a new language in the Remix Supabase SaaS Kit
    • Tables/Functions not found
    • Updating the Fonts
    • Adding Pages
    • Adding a new translation file
    • Contentlayer gets stuck
    • Guarding Pages
    • Using Lemon Squeezy instead of Stripe
    • Updating the Favicons
    • Using the Language Switcher
    • Environment variables
    • Setting up Emails
This documentation is for a legacy version of Remix and Supabase. For the latest version, please visit the Remix and Supabase V2 documentation

Adding a new translation file | Remix Supabase SaaS Kit

How to add a new translation file to your Remix Supabase SaaS Kit application

To add a new translation to your application next to the default ones (common, auth, profile, etc.) you need to:

  1. create the new JSON file, for example tasks.json in the public/locales/<lang> folder
  2. add the new bundle name to the translations list in the app/i18n/i18next.config.ts file:
typescript
import isBrowser from '~/core/generic/is-browser';
const env = isBrowser() ? window.ENV : process.env;
const DEFAULT_LOCALE = env.DEFAULT_LOCALE ?? 'en';
const i18Config = {
fallbackLanguage: DEFAULT_LOCALE,
supportedLanguages: [DEFAULT_LOCALE],
defaultNS: ['common', 'auth', 'organization', 'profile', 'subscription'],
react: { useSuspense: false },
};
export default i18Config;

We add the tasks bundle name to the i18Config.defaultNS array:

typescript
const i18Config = {
fallbackLanguage: DEFAULT_LOCALE,
supportedLanguages: [DEFAULT_LOCALE],
defaultNS: ['common', 'auth', 'organization', 'profile', 'subscription', 'tasks'],
react: { useSuspense: false },
};

Now, refresh the dev server and your new bundled will be picked up by the i18n module.