There are two main approaches to structuring translations in a front-end project:
All translations are stored in one location:
my-app/
└── src/
└── assets/
└── locale/
├── en.json
└── es.json
Pros:
Cons:
Translations are distributed alongside their components:
my-app/
└── src/
└── modules/
├── feature-a/
│ └── locale/
│ ├── en.json
│ └── es.json
└── feature-b/
└── locale/
├── en.json
└── es.json
Pros:
Cons:
For most applications, especially as they grow, the component-based approach offers better maintainability and scalability. However, for smaller applications, the centralized approach might be simpler to start with.
Localazy shows you the path to the original file, so you know what module you are translating.
Choose based on your project size and team structure, with the understanding that you can migrate between approaches as your needs evolve.
Please help us with improving our documentation.
We appreciate all your feedback.