feat: implement client-side localization infrastructure
- Add languageProvider (StateProvider<String>, default 'ru') with supportedLanguages map matching backend locale.Supported - Wire Accept-Language header into AuthInterceptor via languageGetter callback; all API requests now carry the current language - Sync language from user profile preferences into languageProvider on every ProfileNotifier load/update - Add language field to UpdateProfileRequest, serialized as preferences.language in PUT /profile - Profile screen: НАСТРОЙКИ section displays current language; edit sheet adds DropdownButtonFormField for language selection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ class UpdateProfileRequest {
|
||||
final String? gender;
|
||||
final String? activity;
|
||||
final String? goal;
|
||||
final String? language;
|
||||
|
||||
const UpdateProfileRequest({
|
||||
this.name,
|
||||
@@ -25,6 +26,7 @@ class UpdateProfileRequest {
|
||||
this.gender,
|
||||
this.activity,
|
||||
this.goal,
|
||||
this.language,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -36,6 +38,7 @@ class UpdateProfileRequest {
|
||||
if (gender != null) map['gender'] = gender;
|
||||
if (activity != null) map['activity'] = activity;
|
||||
if (goal != null) map['goal'] = goal;
|
||||
if (language != null) map['preferences'] = {'language': language};
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user