Namespaces

Last updated: August 20, 2025Author: Jakub Pomykała

Namespaces in SimpleLocalize allow you to group translations in an organized way. They are particularly useful when managing a large number of translations or when namespaces are already a part of your application structure.

How to use namespaces

Namespaces are optional, and you can organize them in any way that suits your application. They can group translations by feature, module, page, or any other relevant criteria.

Let's say you have a web application with two pages: Home and About. You can create two namespaces: home and about and put translations for each page in the corresponding namespace.

Namespaces in SimpleLocalize

Assign namespaces

You can create and assign namespaces directly in the translation editor, where they appear as blue labels next to the translation keys.

Single translation key

Right-click on a translation key and select Manage key. In the Namespace field, type the name of the namespace you want to assign to the translation or choose an existing namespace from the dropdown menu.

Many translation keys

You can assign namespaces to multiple translations at once using the bulk actions feature. Enable selection mode by clicking on a translation key holding the Ctrl key and then select translations you want to assign a namespace to. Click on the Bulk actions button and choose Change namespace. Type the name of the namespace you want to assign to the translations or choose an existing namespace from the dropdown.

Import with namespaces

When you import translations to SimpleLocalize from a file, you can assign a namespace to imported translation keys by selecting the namespace during the import process.

Export with namespaces

During the export process, you can choose to export translations with or without namespaces. Split by namespaces option will generate separate files for each namespace.

Export translations with namespaces

Code integration

REST API

You can use the SimpleLocalize REST API to manage translations with namespaces programmatically. The API allows you to create, update, and delete translations, as well as assign namespaces to them. API documentation

SimpleLocalize CLI

The SimpleLocalize CLI allows you to manage translations, including namespaces, directly from your terminal. You can use commands to import, export, and manage translations with namespaces. CLI documentation

Translation hosting

When hosting translations via SimpleLocalize, you can fetch translations by namespace, making it easier to retrieve content for specific features, modules, or pages. Translation hosting documentation

Filter by namespaces

You can filter translations by namespace in the translation editor. Click on the 'Filters' button and select the namespace you want to filter translations by.

You can also quickly filter translations by namespace using the Filter by namespace option under right click on the translation key.

Alternatives

If you prefer not to use namespaces, you can still organize translations using tags. Tags allow you to categorize translations without the need for a hierarchical structure. You can assign multiple tags to a translation, making it flexible for various organizational needs. Learn about translation key tags in the translation editor documentation.