Conversation
…dynamic translations by parameterizing apiClient.ts
….com/GenerateNU/skillspark into Alen-Ganopolsky/Frontend-Translation
Backend Test ResultsTest Summary ✅
Coverage
|
Backend Test ResultsTest Summary ✅
Coverage
|
There was a problem hiding this comment.
There's a race condition here — AsyncStorage.getItem('lng') is async, but i18n.init() runs synchronously before that promise resolves. So savedLng will always be "en" when init() is called, and the .then() callback fires later to patch it.
_layout.tsx also reads from AsyncStorage and calls changeLanguage(), which is what actually makes this work in practice — but having the same logic in two places is fragile and could cause a brief flash of the wrong language.
Could we consolidate this into one place? One option: drop the async read here entirely and just init with fallbackLng: 'en' (no explicit lng), then let _layout.tsx be the single owner of loading the persisted language. That way the flow is clearer and there's only one code path to maintain.
Backend Test ResultsTest Summary ✅
Coverage
|
1 similar comment
Backend Test ResultsTest Summary ✅
Coverage
|
Description
Link to Ticket
Added i18n library to frontend alongside corresponding json blobs for english and thai. Language switching functionality was added to the language settings page - when a user switches their language, static text is converted from english to thai and vice versa - those translations are stored in said json blobs. Language persistence was added using AsyncStorage, but the implementation will use AuthContext once that is merged in. Lastly, language header parameterization was added to backend requests - the backend no longer exclusively uses en-US as the Accept-Language header
How Has This Been Tested?
Tested frontend on Expo (IOS) and Android Studio
Screenshots
Please provide screenshots of manual testing (Scalar, frontend pages, etc.)


















Checklist
General
Backend Changes (if applicable)
Frontend Changes (if applicable)
Mobile Screenshots (if applicable)
iOS
[Add iOS screenshots here]
Android
[Add Android screenshots here]