MWPW-200345 [Lingo] Split Adobe Home redirect into acomLocale + acomCountry#6268
Closed
vhargrave wants to merge 7 commits into
Closed
MWPW-200345 [Lingo] Split Adobe Home redirect into acomLocale + acomCountry#6268vhargrave wants to merge 7 commits into
vhargrave wants to merge 7 commits into
Conversation
…ountry Follow-up to MWPW-194172 (#6100). On the post-sign-in Adobe Home redirect for Lingo pages, split the single combined acomLocale param into: - acomLocale = language only (e.g. fr) - acomCountry = user's geo country (e.g. CA) so the sign-in redirect shape matches the Akamai/CCH redirect. Also stop reading the `international` cookie when resolving the sign-in region: under Lingo it holds only the language (not a region), so the region/country is resolved from the user's physical location (geo) only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
mokimo
approved these changes
Jul 9, 2026
On Lingo pages the post-sign-in Adobe Home redirect now derives acomLocale from the locale's ietf language (e.g. de-CH -> de, en-US -> en) rather than the path prefix, so regional lingo prefixes (ch_de) and the international base site resolve to the correct language. acomCountry continues to come from geo. Pre-lingo pages are unchanged: acomLocale stays the path prefix and no acomCountry is sent (lower-risk, keeps existing behavior). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
getLanguage() synthesizes ietf as `<lang>_<REGION>` (underscore) when a
languages-config row omits ietf, which is exactly the language-first (Lingo)
config format. `.split('-')[0]` would leak the whole `fr_FR` into acomLocale.
Split on both `-` and `_` so the language subtag is always extracted.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Only send acomCountry when the user's geo country maps to a valid region of the current page's base. On /fr the base has regions ca/ch/be/lu, so only a user in one of those gets acomCountry; a German or French IP gets the language alone. Applies to regional-variant pages too (e.g. /ch_de resolves against base 'de'), and to aggregate regions via mepLingoCountryToRegion (e.g. a Kenyan on the root maps to the africa region). Extracts the region-matching from getLingoRegion into a shared helper (behavior unchanged for existing callers) and reuses it against the base's region set for the redirect gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…f helper Inline getBaseRegions into resolveAcomCountry (it was only used once) and drop the added comments per review. resolveLingoRegionKey stays shared between getLingoRegion and the gate so the region-matching isn't duplicated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Shelving this for now: per Shane Do, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to MWPW-194172 (#6100). Makes the post-sign-in Adobe Home redirect emit the Akamai/CCH param shape on Lingo pages, and drops the
internationalcookie from sign-in region resolution.Resolves: MWPW-200345
What changes
On Lingo pages the redirect is now
…/home?acomLocale=<language>&acomCountry=<geoCountry>:acomLocale= the locale's ietf language (e.g.de-CH→de,fr-FR→fr,en-US→en). This correctly handles regional Lingo prefixes (/ch_de→de) and the international base site (/→en), which a path-prefix approach could not. Split tolerates the underscore ietf form (fr_FR→fr) thatgetLanguagesynthesizes for language-first config rows.acomCountry= the user's geo country (uppercased/ISO-normalised viagetCountry(), souk→gb) — but only when that geo country maps to a valid region of the current page's base.The base-region gate (the important part). A base locale like
/fronly has a fixed set of regional variants —ca_fr,ch_fr,be_fr,lu_fr→ countries ca, ch, be, lu. We only passacomCountrywhen the user's geo is one of those:/frin Switzerland →acomLocale=fr&acomCountry=CH(fr-CH exists)./frin Germany →acomLocale=fronly (no fr-DE variant)./frin France →acomLocale=fronly (France is the base, not a variant).The gate is resolved the same way
getLingoRegionresolves a region — including:/ch_de): resolved against the variant's base (de, whose regions are at/ch/lu). Swiss user on/ch_de→acomCountry=CH; Canadian on/ch_de→acomLocale=deonly.mepLingoCountryToRegion(africa,la,mena_en): a Kenyan on the root maps to theafricaregion →acomLocale=en&acomCountry=KE.This matches the Akamai redirect shape (
?acomLocale=…&acomCountry=…) so Adobe Home / CCH receives one consistent contract regardless of which path (sign-in vs. Akamai) produced the redirect.Pre-Lingo pages are intentionally unchanged (lower risk):
acomLocalestays the path prefix (the combined value we've always passed, e.g.lu_de) and noacomCountryis sent.The
internationalcookie is no longer consulted for sign-in region resolution — under Lingo it holds only the language (not a region), so region/country comes from the user's physical location (geo) only.cn/seastill redirect to their locale homepage rather than/home(unchanged).Code Changes (libs/utils/utils.js)
getLingoRegion({ useGeoLocation })— removed theinternationalsessionStorage/cookie lookup from the geo path; withuseGeoLocation: truethe region resolves purely from geo. The region-matching logic (direct key +mepLingoCountryToRegion) is extracted into a shared helperresolveLingoRegionKey; behavior for existing callers is unchanged. The default (no-arg) path — used bygetGeoLocalePrefix/MEP/content — is unchanged (still the selected-marketcountrycookie).getBaseRegions/resolveAcomCountry(new, internal) — resolve the valid region set for the current page's base (a base locale uses its hydratedregions; a regional variant reconstructs its base's siblings) and return the geo country only if it fits that set.loadImsredirect_uri —acomLocale = isLingo ? locale.ietf-language : locale.prefix;acomCountry = resolveAcomCountry(...)(geo, gated on base fit). The SUSI widget display locale is still region-aware (lingoRegion.ietf) — only the redirect params changed.acomCountryreads geo fromsessionStorage.akamai(already set byloadArea→setCountry;getAkamaiCodededupes+caches), so there is no duplicate geo fetch, and it's only computed onadobe-home-redirectpages.Behavior matrix
/fr/home?acomLocale=fr&acomCountry=CH/fr/home?acomLocale=fr&acomCountry=CA/fr/home?acomLocale=fr/fr/home?acomLocale=fr/ch_de(regional)/home?acomLocale=de&acomCountry=CH/ch_de(regional)/home?acomLocale=de/(international)/home?acomLocale=en/(international)/home?acomLocale=en&acomCountry=KE/fr/home?acomLocale=fr/lu_de/home?acomLocale=lu_de(unchanged)/cn,/sea/cn,/sea(unchanged)Pairs with
acomCountryis consumed on the Adobe Home side (CCH — CCH-37414). Until CCH mapsacomCountryto a display language, the visible CCH language may not change yet, but the redirect URL params are verifiable in the address bar.Test URLs
Branch libs override:
?milolibs=vhargrave-lingo-acom-country--milo--adobecomTest 1 — Canadian on
/fr→acomLocale=fr&acomCountry=CA…/home?acomLocale=fr&acomCountry=CA(CA fits the /fr base — ca_fr exists)Test 2 — Swiss on
/fr→acomLocale=fr&acomCountry=CH…/home?acomLocale=fr&acomCountry=CHTest 3 — Geo that does NOT fit the base → language only
…/home?acomLocale=fr— noacomCountry, because Germany is not a region of the/frbase.Test 4 —
internationalcookie is IGNORED (geo wins)…/fr/acrobat.html#langnav, set region to Luxembourg – Français (writesinternational=lu_fr)…/home?acomLocale=fr&acomCountry=CH— theinternationalpick is not honored; geo (CH) wins.Test 5 — Pre-Lingo locale unchanged (no
acomCountry)…/home?acomLocale=lu_de(combined prefix, noacomCountry) —/lu_deisn't on Lingo, so behavior is unchanged.Tests
test/utils/utils.test.js—getLingoRegion(geo-only,internationalignored) +loadImsredirect: ietf language on Lingo pages (incl. underscore-ietf split), regional prefix (ch_de→de), international base (/→en), and the base-fit gate: geo that fits (ca/ch on/fr, at/ch on/ch_de, ke→africa via mep) sendsacomCountry; geo that does not fit (de/fr on/fr, ca on/ch_de, us on root) sends language only; plus no-geo and pre-Lingo unchanged (fr,lu_de, bare root).test/blocks/susi-light-login/susi-light-login.test.js— sign-in widget locale follows geo, ignoring the market andinternationalcookies.npm test: green (the only failure is a pre-existing language-selector timing flake, verified to fail ~2/3 runs on cleanstage).