i18n icon indicating copy to clipboard operation
i18n copied to clipboard

diffrentDomains dev: use the first subdomain for testing languages in dev/staging

Open MosheL opened this issue 3 years ago • 0 comments

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

feature request with example

Describe the solution you'd like

diffrentDomains works good in production, but in test I need to desribe again and again the real URL for every language

Describe alternatives you've considered

 export function getLocaleDomain(locales) {

.....

 const host = (getHost() || "").split(":")[0];
   if (host) {
    const first = host.split(".")[0];
    const matchingLocale = locales.find(l => l.domain === host || l.code === first)

the idea is designed for dev/test/staging servers and similar.

he.test.local en.test.local ru.test.local he.staging.local ru2.staging.local

All of them will work, out-of-the box. If I need to test a diffrent box I need just use hostfile or DNS things.

Thanks

MosheL avatar Oct 16 '22 07:10 MosheL