@autobusal/providers 1.29.0 → 1.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.29.1
4
+
5
+ ### Fixed
6
+
7
+ - **The domain's language outranks the stored preference only on a ccTLD**,
8
+ not on the brand's primary. Every primary declares a locale (the backfill
9
+ gave it one), so 1.29.0 applied the override everywhere — quietly ending
10
+ the deliberate, already-shipped behaviour where a returning visitor who
11
+ last read the site in Albanian types `busmagus.com` and gets Albanian. That
12
+ would have changed every brand on the platform, none of which has a second
13
+ domain yet: a change nobody asked for, arriving with a feature nobody has
14
+ switched on. Caught by testing a returning visitor rather than a clean
15
+ browser.
16
+
3
17
 
4
18
  ## 1.29.0
5
19
 
package/Setup/Setup.tsx CHANGED
@@ -16,10 +16,27 @@ const Setup = ({ type, children }: Props): JSX.Element => {
16
16
  useUserBootstrap();
17
17
 
18
18
  // Edited: Ferjolt Ozuni - Date: 2026-08-06
19
- // `data.locale` - the language THIS origin is about, when it is a domain
20
- // about a language (a ccTLD) rather than simply the brand's address. It
21
- // outranks the stored preference; see getLanguage.
22
- languages(type, data.preferences.languages.default, data.preferences.languages.available, data.locale);
19
+ // The language this origin is about, but ONLY when it is a ccTLD - a
20
+ // domain that exists in order to be that language. It outranks the stored
21
+ // preference there; see getLanguage.
22
+ //
23
+ // Not on the PRIMARY, even though it declares a locale too (every brand's
24
+ // primary does - the backfill gave it one). The primary is the brand's
25
+ // address before it is a language, and the stored preference winning at
26
+ // its unprefixed URLs is deliberate and already shipped: a returning
27
+ // visitor who last read the site in Albanian types busmagus.com and gets
28
+ // Albanian. Passing the primary's locale here would have quietly ended
29
+ // that for every brand on the platform, none of which has a second domain
30
+ // yet - a change nobody asked for, arriving with a feature nobody has
31
+ // switched on.
32
+ const origin = data.domains?.find(item => item.domain === data.domain);
33
+
34
+ languages(
35
+ type,
36
+ data.preferences.languages.default,
37
+ data.preferences.languages.available,
38
+ origin && !origin.primary ? origin.locale : null
39
+ );
23
40
 
24
41
  // Edited: Ferjolt Ozuni - Date: 2026-08-01
25
42
  // The brand's GTM container, from labels_settings via the admin GUI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.29.0",
3
+ "version": "1.29.1",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"