-
Notifications
You must be signed in to change notification settings - Fork 324
Namespaces
Anthony Fu edited this page Apr 22, 2020
·
5 revisions
Available from 1.14.0
Some i18n frameworks (e.g. i18next, Laravel) support namespaces. It basically maps your locale file names to the root for your i18n keys.
Examples, with namespaces
// en/common.json
{
"hello": "Hello",
"foo": {
"bar": "Foobar"
}
}
// app.js
i18n.t('common.hello') // Hello
i18n.t('common.foo.bar') // Foobar
This feature is disabled by default, but can be enabled by the framework you use (Laravel for example). You can also set it explicitly.
"i18n-ally.namespace": true
For more complex use cases, please refer to Path Matcher.
Lokalise is the fastest growing language cloud technology made by developers, for developers.
As a collaborative productivity platform, it helps structure and automate the translation and localization process for any company in the world.
Learn more
πβπ¨ Review & Collaborate
πͺ¨ Hard-coded Strings Extraction
βοΈ Configurations
π Migration