General info
This functionality defines which regional/language version of the SACLAB website should be shown to a user on their first visit. The system automatically detects the user’s country, browser language, forms the location and version, and may display a popup offering the user to switch to the recommended version.
When a user visits the website for the first time, the system automatically detects the country by IP, the browser language, determines the location, and calculates the site version. After that, the system forms a new URL based on these values. If the version changes, a popup may be shown offering the user to switch to the recommended version.
URL rules:
User story
As a first-time visitor of the website
I want the system to automatically determine my location and preferred language and form the recommended version of the site
So that I can access the most relevant regional and language version of SACLAB.
Acceptance Criteria
|
№
|
Acceptance criteria
|
|
|
01
|
Scenario: Detect country and language Given the user visits the site for the first time When the system loads Then the system must detect the user’s country by IP and browser language
|
|
|
02
|
|
|
|
03
|
Scenario: Determine EU location Given the detected country When the country is part of the EU Then the location must be “EU”
|
|
|
04
|
Scenario: Determine Global location Given the detected country When the country is not in the EU and not US/HK Then the location must be “Global”
|
|
|
05
|
Scenario:
|
|
|
06
|
Scenario:
|
|
|
07
|
Scenario: Default version Given the user’s language is not supported When the version is determined Then the version must be set to “en”
|
|
|
08
|
|
|
|
09
|
|
|
|
10
|
Scenario: Do not show popup if URL unchanged Given the old URL equals the new URL When the comparison is done Then the popup must not be shown
|
|
|
11
|
|
|
|
12
|
Given: User is accessing saclab.com/de/ (or EN or FR)
Then: the system prompts the user to go to saclab.com/us/
A popup in German is shown
Scenario: Version Mismatch Based on Location and Language
Given:
-
The user is accessing a site version that does not match the version recommended for their detected location (for example, accessing any regional or language version different from the one mapped to their IP location)
-
And the user’s IP address maps to a specific region (e.g., US, HK)
When:
Then:
-
If the browser language matches a supported language version (e.g., German → /de/, French → /fr/), the popup must appear in that language, suggesting a switch to the version appropriate for the user’s location
-
Otherwise (if the browser language does not match or cannot be detected), the popup must appear in English, suggesting a switch to the version appropriate for the user’s location
|
|
|
12.1
|
Example to scenario 12:
Given: User is accessing http://saclab.com/de/ When: User’s IP address is US
If User’s language is detected as German Then: the system shows a popup in German prompting the user to go to http://saclab.com/us/
Else if user’s language is NOT german
Then: the system shows a popup in English prompting the user to go to http://saclab.com/us/
|
|
|
|
Given: User is accessing http://saclab.com/fr/ When: User’s IP address is HK
If User’s language is detected as French Then: the system shows a popup in French prompting the user to go to http://saclab.com/hk/
Else if user’s language is NOT French
Then: the system shows a popup in English prompting the user to go to http://saclab.com/hk/
|
|
|
13
|
Given: User is accessing saclab.com/de/ When: The user’s IP address is HK
Then: the system prompts the user to go to saclab.com/hk/
A popup in German is shown
If User’s language is detected as German Then: the system shows a popup in German prompting the user to go to http://saclab.com/hk/
Else if user’s language is NOT german
Then: the system shows a popup in English prompting the user to go to saclab.com/hk/
|
|
|
14
|
Given: User is accessing saclab.com/us/ (or HK) When: site version is the same US (or HK) Then: the system does not suggest a redirect
|
|
|
15
|
Scenario: User Accessing a Different Language Version Than Their Browser Language
Given: User is accessing saclab.com/fr/ (or EN or DE)
When: The user’s IP address belongs to a EU and browser language DE
Then: the system prompts the user to go to saclab.com/de/ (EU location)
A popup in German is shown
Given:
-
The user is accessing a site version that does not match their detected browser language (for example, they are on saclab.com/fr/ while their browser’s language is German)
-
And the user’s browser language is one of the supported language (e.g English, french or German)
When:
Then:
|
|
|
15.1
|
Example Scenario 15
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a EU and browser language GERMAN Then: the system shows a pop-up in GERMAN prompts the user to go to http://saclab.com/de/
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a EU and browser language is english Then: the system shows a pop-up in ENGLISH prompts the user to go to http://saclab.com/
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a EU and browser language is French Then: continues to saclab.com/fr/ without any popup
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a EU and browser language is none of the supported language, for example Dutch Then: the system shows a pop-up in ENGLISH prompts the user to go to http://saclab.com/
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a non-EU and browser language is none of the supported language, for example Dutch Then: the system shows a pop-up in ENGLISH prompts the user to go to http://saclab.com/
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a non-EU and browser language is German Then: the system shows a pop-up in German prompts the user to go to http://saclab.com/de/
Given: User is accessing http://saclab.com/fr/ When: The user’s IP address belongs to a non-EU and browser language is FRENCH Then: continues to http://saclab.com/fr / without any popup
|
|
|
16
|
Given: User is accessing saclab.com/ (or FR or DE)
When: The user’s IP address belongs to a non EU and browser language FR
Then: the system prompts the user to go to saclab.com/fr/ (Global location)
A popup in English is shown
Title: “We’ve detected a better version for you”
Subtitle: “We’ve found a version of our site that may be more relevant to your location or language.
Would you like to switch to this version?”
Redirect button: “Yes, take me there”
Cancel button: “Stay here“
The text is edited in the admin panel.
|
|