Skip to content

Change defaultLocale in runtime #946

@vgaldikas

Description

@vgaldikas

Is your feature request related to a problem? Please describe.

I am trying to dynamically generate URL's for different domains. Both of them have different default locale, and both of them have hideDefaultLocaleInURL as true. Whatever is the initial defaultLocale it never changes, and there is no way to change it. Therefore one of domain persists having prefixed locale, even though it should not.

Describe the solution you'd like

I think simply a setter for defaultLocale property, should do the job.

Describe alternatives you've considered

Reinitializing the LaravelLocalization service after updating config in the runtime. This would solve it, but it feels like ability to simply update the defaultLocale property at runtime would be cleaner solution.

PS. Willing to create a PR if this suggestion is approved

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions