feat(l10n): localize rating place and favorite error messages

- add rating_place and error_try_again_later ARB keys (ru/en)
- use S.rating_place in profile screen, plan widget and author card
- use S.current.error_try_again_later in profile plans cubit
- hide rating badge when rating place is null instead of rendering null-й
- initialize localization in profile plans cubit test
This commit is contained in:
2026-11-20 17:42:03 +03:00
parent 0df474b2b5
commit 608016c8ad
10 changed files with 112 additions and 53 deletions

View File

@@ -205,24 +205,27 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
const SizedBox(width: 12),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
decoration: BoxDecoration(
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
'${state.consultantInfo!.ratingPlace}-й в рейтинге',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: appTheme.blueA400,
if (state.consultantInfo!.ratingPlace != null)
Container(
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
decoration: BoxDecoration(
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
S.of(context).rating_place(
state.consultantInfo!.ratingPlace!,
),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: appTheme.blueA400,
),
),
),
),
],
),
if (state
@@ -378,24 +381,27 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
const SizedBox(width: 12),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
decoration: BoxDecoration(
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
'${consultantInfo.ratingPlace}-й в рейтинге',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: appTheme.blueA400,
if (consultantInfo.ratingPlace != null)
Container(
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
decoration: BoxDecoration(
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
S.of(context).rating_place(
consultantInfo.ratingPlace!,
),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: appTheme.blueA400,
),
),
),
),
],
),
if (consultantInfo.educationModel.hasMedicalEducation == 1)