Skip to content

Support combination of namespaced and non-namespaced translations #311

@dJani97

Description

@dJani97

Motivation

In our projects, we don’t use namespaces because the translation blocks are fairly short, and some keys are truly “global” and not tied to any specific feature.

However, we also have some very large translation blocks (e.g., for big features or modules) that would greatly benefit from being refactored into separate namespaced files for better maintainability.

Developer Experience

We’d like to be able to mix global (non-namespaced) translations with namespaced translations side by side. For example:

i18n/
 └── en.i18n.json
 └── bigFeature1_en.i18n.json
 └── bigFeature2_en.i18n.json
 └── de.i18n.json
 └── bigFeature1_de.i18n.json
 └── bigFeature2_de.i18n.json

This would allow us to:

  • Keep global/common keys simple and flat
  • Organize large, feature-specific keys cleanly in dedicated namespaces

It would be great if Slang could support this use case out of the box!

Thank you for your work on this amazing library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions