Source String
The original text in the source language that will be translated.
Definition
A source string (or source text) is the original content in the source language (typically English) that serves as the basis for translation. In code, these are the user-facing strings that need localization. Source strings are extracted from code and stored in a source file or TMS, where translators use them to create target language versions.
Examples
- →Code: <Button>{t('Submit')}</Button> - 'Submit' is the source string
- →Hardcoded: 'Welcome to our app' in JSX
- →Source file: en.json containing all English strings
- →TMS: source column showing original content
Frequently Asked Questions
Should source strings be in code or separate files?
Best practice: use separate files (en.json, etc.). Benefits: single source of truth, easier for translators, clear separation of concerns. Some teams use inline strings with extraction tools—both approaches work.
Should I use English text or keys as identifiers?
Keys (home.hero.title) are better: changing English text doesn't break code, semantic meaning is clear, no collision issues. English-as-key works for small projects but scales poorly.