Content Customization Overview
PreLaunch allows you to easily customize all the text content in your application. This document will guide you through the different ways to modify content, from simple text changes to creating custom content components.Translation Files
The primary way to customize text content is through the translation files located in thelocales/
directory:
Customizing Text Content
To modify text content, edit the appropriate JSON file in thelocales/en/
directory:
Page Content
Editing Page Content
Each page in your application has its own content. To modify page content, edit the corresponding page component:Creating Custom Pages
You can create new pages by adding files to theapp/
directory:
locales/en/custom.json
.
Components Content
Reusable Content Components
For content that appears in multiple places, you can create reusable components:Dynamic Content
Content from API
For dynamic content that comes from an API, you can fetch data in your page components:Content from CMS
If you’re using a CMS like Contentful, Sanity, or Strapi, you can integrate it to manage your content:Markdown Content
PreLaunch supports Markdown content rendering for rich text content:SEO Content
Page Metadata
To customize SEO metadata for your pages, modify the metadata export in your page files:Default Metadata
Default metadata is configured in theapp/layout.tsx
file and is derived from the config.ts
file:
Legal Content
Privacy Policy and Terms of Service
For legal pages like Privacy Policy and Terms of Service, you can create dedicated page components:Common Questions
How do I add new text that doesn't exist in the translation files?
How do I add new text that doesn't exist in the translation files?
First, add the new text as a key-value pair in the appropriate translation file (e.g.,
locales/en/common.json
). Then, use the useTranslations
hook to access and display the text in your component.Can I use HTML in my translation strings?
Can I use HTML in my translation strings?
The translation system doesn’t directly support HTML tags. Instead, break down the content into smaller pieces or use components for more complex layouts. For rich text, consider using Markdown with the
react-markdown
package.How do I create a new page with custom content?
How do I create a new page with custom content?
- Create a new file in the appropriate location in the
app/
directory - Add any required translation keys to your translation files
- Create your page component with the desired content and layout
- Use the
useTranslations
hook to access localized text