Bite 31.1 — I18N Foundation and Locale Contract - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki
Branch: 860-bite-311-i18n-foundation-and-locale-contract
SHA: 4912a415571ee7fa5fbaeaed2e370c47c9ebc497
Bite 31.1 establishes the localization runtime and locale contract only.
It intentionally does not:
- translate the existing ERS application screens;
- provide a visible language selector;
- translate Administration, People, Collaborators, Planning, Expenses, Receipts, or other business workflows.
Therefore, seeing the existing ERS UI remain in English during these tests is expected and is not a failure.
The manual verification concentrates on:
- locale initialization in a real browser;
- explicit locale persistence;
-
<html lang>synchronization; - isolation of locale preference from authentication and Administration/Tenant context;
- browser-language fallback;
- synchronization between two browser tabs.
DevTools is used because Bite 31.1 intentionally has no visible locale-selection UI yet.
Use the normal LOCAL environment that already passed make local-check.
For tests requiring authentication, use:
- Identity: Application Administrator
-
Login:
[email protected] -
Password:
Local-E2E-Administrator-28D! -
Required Administration context:
Global administration
Before beginning:
- Start the normal LOCAL backend and frontend.
- Open the ERS application in Chrome.
- Open Chrome DevTools.
- Confirm the application loads without an uncaught JavaScript error.
- Sign in as
[email protected]. - Confirm the application shows Global administration as the current Administration context.
- Do not create or approve a Support Access Lease during this suite.
Verify that the I18N provider initializes in a real browser and synchronizes the selected locale to the HTML document.
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
Remove any previously stored ERS locale preference.
-
With ERS open, open Chrome DevTools.
-
Select the Application tab.
-
In the left pane, expand Local Storage.
-
Select the LOCAL ERS origin.
-
Locate the key:
ers.i18n.locale -
If the key exists, delete it.
-
Select the Console tab.
-
Execute:
navigator.languages
-
Record the returned browser language list.
-
Determine the expected ERS locale using this exact rule:
- first
enoren-USencountered → expecteden-US; - first
ptorpt-BRencountered → expectedpt-BR; -
pt-PTdoes not count aspt-BR; - unsupported languages are skipped;
- if no supported language is present → expected
en-US.
- first
-
Reload the ERS page.
-
If necessary, sign in again as
[email protected]. -
Confirm the application still loads normally.
-
In DevTools Console, execute:
document.documentElement.lang
-
Record the returned value.
- √
document.documentElement.langequals the locale determined in Step 10. - √ The application loads successfully.
- √ No localization-related error appears in the Console.
- √ The existing ERS screen text may still be English.
- √ Authentication remains valid.
- √ The selected Administration context remains Global administration.
PASS if:
- √ the HTML
langattribute matches the locale-resolution rule; - √ ERS remains operational;
- √ authentication and Administration context are unchanged.
Do not promote if:
-
<html lang>is empty; -
<html lang>contains an unsupported locale; - ERS fails to load after the locale provider initializes;
- authentication or Administration context changes merely because the locale initializes.
Verify that an explicit pt-BR preference overrides browser-language resolution, survives reload, and remains presentation-only state.
- Role: Application Administrator
-
Login:
[email protected] -
Administration context before change:
Global administration
-
Confirm you are signed in as
[email protected]. -
Confirm the current context is Global administration.
-
Record the currently displayed signed-in identity.
-
Record the currently selected Administration context.
-
Open DevTools Console.
-
Execute:
localStorage.setItem("ers.i18n.locale", "pt-BR")
-
Reload the page.
-
Wait for ERS to finish loading.
-
In the Console, execute:
localStorage.getItem("ers.i18n.locale")
-
Confirm the result is:
pt-BR -
Execute:
document.documentElement.lang
-
Confirm the result is:
pt-BR -
Inspect the ERS top bar.
-
Confirm the signed-in identity is still the same Application Administrator recorded before the change.
-
Confirm the current Administration context is still Global administration.
-
Open the Administration context selector.
-
Confirm changing the locale preference did not create or expose an ordinary Tenant identity for the Application Administrator.
-
Close the selector without changing context.
-
Navigate through at least two ordinary application pages using the visible UI.
-
Confirm navigation continues to work.
- √
ers.i18n.localeremainspt-BR. - √
<html lang>ispt-BR. - √ The locale survives page reload.
- √ Authentication Account/Actor identity is unchanged.
- √ Administration context remains Global administration.
- √ No Tenant, Membership, Collaborator, Support Access Lease, or authorization capability is created by changing locale.
- √ Existing screen strings may remain English because translation of those screens is outside Bite 31.1.
PASS if the explicit Brazilian Portuguese preference persists and affects only presentation locale state.
Do not promote if changing locale:
- signs the user out unexpectedly;
- changes the current Actor;
- changes the Administration/Tenant context;
- exposes an ordinary Tenant identity;
- changes authorization behavior;
- fails to persist;
- fails to update
<html lang>.
Verify that ERS can explicitly move between the two supported locales and persist the replacement preference.
Continue as:
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
Test 02 has completed and ers.i18n.locale currently contains pt-BR.
-
Open DevTools Console.
-
Execute:
localStorage.setItem("ers.i18n.locale", "en-US")
-
Reload ERS.
-
Wait for the application to load.
-
Execute:
localStorage.getItem("ers.i18n.locale")
-
Confirm the result is:
en-US -
Execute:
document.documentElement.lang
-
Confirm the result is:
en-US -
Confirm you are still signed in as the same Application Administrator.
-
Confirm the selected Administration context is still Global administration.
-
Navigate to another page through the visible ERS navigation.
-
Confirm the page loads successfully.
- √ the stored locale changes from
pt-BRtoen-US; - √
<html lang>becomesen-US; - √ the new value persists after reload;
- √ business/application state is unchanged.
√ PASS if explicit locale replacement works and remains isolated from ERS identity and business state.
Do not promote if:
- the previous
pt-BRlocale remains active after reload; -
<html lang>does not becomeen-US; - changing the locale changes identity;
- changing the locale changes Administration/Tenant context;
- changing the locale changes business data.
Verify the Bite 31.1 cross-tab locale synchronization behavior in an actual browser.
Both tabs must use the same authenticated LOCAL ERS session:
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
ers.i18n.locale is currently en-US.
-
In Chrome, open the LOCAL ERS application in Tab A.
-
Open the same ERS application origin in Tab B.
-
Confirm both tabs are signed in as the Application Administrator.
-
Confirm both tabs show Global administration.
-
In Tab B, open DevTools Console.
-
Execute:
document.documentElement.lang
-
√ Confirm Tab B currently reports:
en-US -
Leave Tab B open.
-
Return to Tab A.
-
Open DevTools Console in Tab A.
-
Execute:
localStorage.setItem("ers.i18n.locale", "pt-BR")
-
Do not reload Tab B.
-
Return to Tab B.
-
In Tab B's Console, execute:
document.documentElement.lang
-
Confirm Tab B now reports:
pt-BR -
Confirm Tab B remains signed in.
-
Confirm Tab B still shows Global administration.
-
Navigate to another ERS page from Tab B using the visible UI.
-
Confirm normal operation.
- Tab B updates to
pt-BRwithout a page reload. - The locale change propagates through the browser
storageevent. - Authentication state remains intact.
- Administration context remains unchanged.
- No application error occurs.
PASS if Tab B changes its document language to pt-BR without reload and retains the same ERS identity/context.
Do not promote if:
- Tab B remains
en-US; - Tab B must be reloaded before the locale changes;
- cross-tab synchronization causes an application error;
- authentication changes;
- Administration/Tenant context changes.
Verify the documented distinction between an explicit ERS locale preference and browser-controlled locale selection.
Continue as:
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
-
Open DevTools Console.
-
Execute:
navigator.languages
-
Record the returned list.
-
Determine the expected ERS browser-derived locale using this exact rule:
-
enoren-US→en-US; -
ptorpt-BR→pt-BR; -
pt-PTis unsupported and must not be treated aspt-BR; - unsupported languages are skipped;
- if none match, fallback is
en-US.
-
-
Execute:
localStorage.removeItem("ers.i18n.locale")
-
Reload ERS.
-
Wait for ERS to finish loading.
-
Execute:
localStorage.getItem("ers.i18n.locale")
-
Confirm the result is:
null -
Execute:
document.documentElement.lang
-
Compare the returned locale with the expected locale calculated in Step 4.
-
Confirm you remain signed in as the Application Administrator.
-
Confirm the Administration context remains Global administration.
- there is no explicit
ers.i18n.localevalue; - ERS resolves the locale from the browser language list;
- unsupported regional variants are not silently converted into another dialect;
- if no supported locale is found, ERS uses
en-US; - identity and context remain unchanged.
PASS if the locale follows the documented browser-resolution/fallback rule after the explicit preference is removed.
Do not promote if:
- an unsupported locale becomes the document language;
-
pt-PTis silently interpreted aspt-BR; - ERS fails instead of falling back to
en-US; - authentication changes;
- Administration/Tenant context changes.
Verify that manually corrupted or obsolete stored locale values cannot put ERS into an unsupported locale state.
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
-
Confirm you are signed in as the Application Administrator.
-
Confirm the selected context is Global administration.
-
Open DevTools Console.
-
Execute:
localStorage.setItem("ers.i18n.locale", "fr-FR")
-
Reload the page.
-
Wait for ERS to finish loading.
-
Execute:
document.documentElement.lang
-
Record the returned locale.
-
Execute:
localStorage.getItem("ers.i18n.locale")
-
Record the stored value.
-
Confirm the active document language is not
fr-FR. -
Confirm the active document language is one of:
en-US pt-BR -
Confirm ERS remains usable.
-
Confirm you remain signed in.
-
Confirm the Administration context remains Global administration.
- unsupported
fr-FRnever becomes the active ERS locale; - ERS resolves to a supported browser locale or to
en-USfallback; - the application does not crash because Local Storage contains an unsupported value;
- identity and authorization state remain unchanged.
PASS if the unsupported stored locale is safely rejected as an active locale.
Do not promote if:
-
<html lang>becomesfr-FR; - application startup fails;
- an uncaught I18N error appears;
- authentication or context changes.
Verify explicitly that locale changes do not alter ERS identity or authorization state.
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
-
Sign in as
[email protected]. -
Confirm Global administration is selected.
-
Open the Administration context selector.
-
Record every context currently available to the Application Administrator.
-
Close the selector without changing the selection.
-
Open DevTools Console.
-
Execute:
localStorage.setItem("ers.i18n.locale", "pt-BR")
-
Reload ERS.
-
Confirm
<html lang>ispt-BR. -
Open the Administration context selector.
-
Compare the available contexts with those recorded in Step 4.
-
Close the selector.
-
In DevTools Console, execute:
localStorage.setItem("ers.i18n.locale", "en-US")
-
Reload ERS.
-
Confirm
<html lang>isen-US. -
Open the Administration context selector again.
-
Compare the available contexts again with those recorded in Step 4.
The locale change does not:
- create a Tenant Actor;
- create a Person;
- create a Membership;
- create a Collaborator;
- create a Role Grant;
- create a Support Access Lease;
- expose an additional Tenant context;
- remove a legitimately available context;
- alter the selected Administration context.
PASS if the exact Administration context choices remain unchanged across locale changes.
Any identity, Tenant, Membership, Collaborator, Role Grant, Support Lease, or authorization difference caused solely by locale selection blocks promotion.
Confirm that introducing the global I18N provider has not destabilized ordinary ERS navigation.
- Role: Application Administrator
-
Login:
[email protected] -
Administration context:
Global administration
-
Set the locale to either supported value:
localStorage.setItem("ers.i18n.locale", "pt-BR")
or:
localStorage.setItem("ers.i18n.locale", "en-US")
-
Reload ERS.
-
Using only visible UI navigation, open the normal landing/home page.
-
Confirm the page renders.
-
Using visible UI navigation, open Administration.
-
Confirm the page renders.
-
Using visible UI navigation, open Tenants or another normal Administration page available to the Application Administrator.
-
Confirm the page renders.
-
Open the Administration context selector.
-
Confirm the selector opens and behaves normally.
-
Close it without changing the selection.
-
Open DevTools Console.
-
Confirm there are no uncaught exceptions related to:
-
I18nProvider; - translations;
- locale resolution;
- formatting;
- Local Storage synchronization.
-
- normal application navigation continues to operate;
- no blank screen appears;
- no provider initialization error appears;
- the Administration context selector continues working;
- the selected locale remains reflected in
<html lang>.
PASS if normal ERS operation remains stable with the I18N provider installed.
Do not promote if:
- any normal page becomes inaccessible;
- the application renders a blank screen;
- the Administration context selector regresses;
- a repeatable uncaught I18N exception appears.
Before ending the manual test session:
-
Open DevTools Console.
-
Remove the manually forced locale:
localStorage.removeItem("ers.i18n.locale")
-
Reload ERS.
-
Confirm ERS returns to browser-language resolution.
-
Confirm the application remains operational.
This cleanup prevents manual locale state from unintentionally affecting subsequent manual test suites.
Bite 31.1 manual verification is PASS only if all of the following are true:
- Test 01 passes.
- Test 02 passes.
- Test 03 passes.
- Test 04 passes.
- Test 05 passes.
- Test 06 passes.
- Test 07 passes.
- Test 08 passes.
-
en-USandpt-BRare the only active supported locales. - Explicit locale preference persists across reload.
- Removing the preference returns ERS to browser locale resolution.
- Unsupported locale values do not become active ERS locales.
-
<html lang>remains synchronized with the resolved locale. - Cross-tab locale synchronization works.
- Locale state does not alter Authentication Account, Actor, Person, Tenant Membership, Collaborator, Role Grant, Support Access Lease, or authorization state.
- Normal ERS navigation remains operational.
- No repeatable I18N-related browser error occurs.
Do not promote Bite 31.1 if any of the following occurs:
- application startup fails because of
I18nProvider; -
<html lang>does not reflect the resolved locale; - an unsupported locale becomes active;
- explicit locale preference does not persist;
- removal of explicit preference does not return to browser/fallback resolution;
- cross-tab locale synchronization fails;
- changing locale affects authentication;
- changing locale affects authorization;
- changing locale changes the selected Tenant or Administration context;
- locale initialization creates or exposes an identity that did not exist before;
- normal application navigation regresses;
- an uncaught localization-related browser error is reproducible.
If:
- all LOCAL automated tests pass;
- all CI tests pass;
- this entire manual suite passes;
then Bite 31.1 — I18N Foundation and Locale Contract is ready for promotion.