fix(store,l10n): localize canonical category labels + store segment
The grouped store showed the hub's English category labels verbatim (Documents, Data & Formats) even in German. Map the canonical slug to DE/EN via l10n (storeCat*), and localize the Modules/Studio segment (storeSegment*). Falls back to the hub label for an unknown slug. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
4b30589962
commit
0fda2600ad
6 changed files with 191 additions and 7 deletions
|
|
@ -327,6 +327,17 @@
|
|||
"storeCategoryChannel": "Kanäle",
|
||||
"storeCategoryWeb": "Web",
|
||||
"storeCategoryOrchestrator": "Orchestrierung",
|
||||
"storeCatDocuments": "Dokumente",
|
||||
"storeCatTextLanguage": "Text & Sprache",
|
||||
"storeCatData": "Daten & Formate",
|
||||
"storeCatAiLlm": "KI & LLM",
|
||||
"storeCatWebApi": "Web & APIs",
|
||||
"storeCatAnalysisDomain": "Analyse & Domäne",
|
||||
"storeCatStudioThemes": "Studio & Themes",
|
||||
"storeCatExamplesDev": "Beispiele & Dev",
|
||||
"storeCatOther": "Sonstiges",
|
||||
"storeSegmentModules": "Module",
|
||||
"storeSegmentStudio": "Studio & Themes",
|
||||
"storeNResults": "{n} Treffer",
|
||||
"@storeNResults": {
|
||||
"placeholders": {
|
||||
|
|
|
|||
|
|
@ -335,6 +335,17 @@
|
|||
"storeCategoryChannel": "Channels",
|
||||
"storeCategoryWeb": "Web",
|
||||
"storeCategoryOrchestrator": "Orchestration",
|
||||
"storeCatDocuments": "Documents",
|
||||
"storeCatTextLanguage": "Text & Language",
|
||||
"storeCatData": "Data & Formats",
|
||||
"storeCatAiLlm": "AI & LLM",
|
||||
"storeCatWebApi": "Web & APIs",
|
||||
"storeCatAnalysisDomain": "Analysis & Domain",
|
||||
"storeCatStudioThemes": "Studio & Themes",
|
||||
"storeCatExamplesDev": "Examples & Dev",
|
||||
"storeCatOther": "Other",
|
||||
"storeSegmentModules": "Modules",
|
||||
"storeSegmentStudio": "Studio & Themes",
|
||||
"storeNResults": "{n} result{n, plural, =1{} other{s}}",
|
||||
"@storeNResults": {
|
||||
"placeholders": {
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ abstract class AppLocalizations {
|
|||
/// No description provided for @welcomeHeroSubtitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Deterministic workflow engine for AI-assisted document processing in regulated environments.'**
|
||||
/// **'Deterministic workflow engine for AI-assisted data processing in regulated environments.'**
|
||||
String get welcomeHeroSubtitle;
|
||||
|
||||
/// No description provided for @welcomePillarHubTitle.
|
||||
|
|
@ -1526,6 +1526,72 @@ abstract class AppLocalizations {
|
|||
/// **'Orchestration'**
|
||||
String get storeCategoryOrchestrator;
|
||||
|
||||
/// No description provided for @storeCatDocuments.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Documents'**
|
||||
String get storeCatDocuments;
|
||||
|
||||
/// No description provided for @storeCatTextLanguage.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Text & Language'**
|
||||
String get storeCatTextLanguage;
|
||||
|
||||
/// No description provided for @storeCatData.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Data & Formats'**
|
||||
String get storeCatData;
|
||||
|
||||
/// No description provided for @storeCatAiLlm.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'AI & LLM'**
|
||||
String get storeCatAiLlm;
|
||||
|
||||
/// No description provided for @storeCatWebApi.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Web & APIs'**
|
||||
String get storeCatWebApi;
|
||||
|
||||
/// No description provided for @storeCatAnalysisDomain.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Analysis & Domain'**
|
||||
String get storeCatAnalysisDomain;
|
||||
|
||||
/// No description provided for @storeCatStudioThemes.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Studio & Themes'**
|
||||
String get storeCatStudioThemes;
|
||||
|
||||
/// No description provided for @storeCatExamplesDev.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Examples & Dev'**
|
||||
String get storeCatExamplesDev;
|
||||
|
||||
/// No description provided for @storeCatOther.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Other'**
|
||||
String get storeCatOther;
|
||||
|
||||
/// No description provided for @storeSegmentModules.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Modules'**
|
||||
String get storeSegmentModules;
|
||||
|
||||
/// No description provided for @storeSegmentStudio.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Studio & Themes'**
|
||||
String get storeSegmentStudio;
|
||||
|
||||
/// No description provided for @storeNResults.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
|
|||
|
|
@ -820,6 +820,39 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get storeCategoryOrchestrator => 'Orchestrierung';
|
||||
|
||||
@override
|
||||
String get storeCatDocuments => 'Dokumente';
|
||||
|
||||
@override
|
||||
String get storeCatTextLanguage => 'Text & Sprache';
|
||||
|
||||
@override
|
||||
String get storeCatData => 'Daten & Formate';
|
||||
|
||||
@override
|
||||
String get storeCatAiLlm => 'KI & LLM';
|
||||
|
||||
@override
|
||||
String get storeCatWebApi => 'Web & APIs';
|
||||
|
||||
@override
|
||||
String get storeCatAnalysisDomain => 'Analyse & Domäne';
|
||||
|
||||
@override
|
||||
String get storeCatStudioThemes => 'Studio & Themes';
|
||||
|
||||
@override
|
||||
String get storeCatExamplesDev => 'Beispiele & Dev';
|
||||
|
||||
@override
|
||||
String get storeCatOther => 'Sonstiges';
|
||||
|
||||
@override
|
||||
String get storeSegmentModules => 'Module';
|
||||
|
||||
@override
|
||||
String get storeSegmentStudio => 'Studio & Themes';
|
||||
|
||||
@override
|
||||
String storeNResults(int n) {
|
||||
return '$n Treffer';
|
||||
|
|
|
|||
|
|
@ -833,6 +833,39 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
@override
|
||||
String get storeCategoryOrchestrator => 'Orchestration';
|
||||
|
||||
@override
|
||||
String get storeCatDocuments => 'Documents';
|
||||
|
||||
@override
|
||||
String get storeCatTextLanguage => 'Text & Language';
|
||||
|
||||
@override
|
||||
String get storeCatData => 'Data & Formats';
|
||||
|
||||
@override
|
||||
String get storeCatAiLlm => 'AI & LLM';
|
||||
|
||||
@override
|
||||
String get storeCatWebApi => 'Web & APIs';
|
||||
|
||||
@override
|
||||
String get storeCatAnalysisDomain => 'Analysis & Domain';
|
||||
|
||||
@override
|
||||
String get storeCatStudioThemes => 'Studio & Themes';
|
||||
|
||||
@override
|
||||
String get storeCatExamplesDev => 'Examples & Dev';
|
||||
|
||||
@override
|
||||
String get storeCatOther => 'Other';
|
||||
|
||||
@override
|
||||
String get storeSegmentModules => 'Modules';
|
||||
|
||||
@override
|
||||
String get storeSegmentStudio => 'Studio & Themes';
|
||||
|
||||
@override
|
||||
String storeNResults(int n) {
|
||||
String _temp0 = intl.Intl.pluralLogic(
|
||||
|
|
|
|||
|
|
@ -367,16 +367,18 @@ class _StorePageState extends State<StorePage> {
|
|||
padding:
|
||||
const EdgeInsets.only(bottom: ChainSpace.md),
|
||||
child: SegmentedButton<bool>(
|
||||
segments: const [
|
||||
segments: [
|
||||
ButtonSegment(
|
||||
value: false,
|
||||
label: Text('Module'),
|
||||
icon: Icon(Icons.extension_outlined, size: 16),
|
||||
label: Text(l.storeSegmentModules),
|
||||
icon: const Icon(Icons.extension_outlined,
|
||||
size: 16),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: true,
|
||||
label: Text('Studio & Themes'),
|
||||
icon: Icon(Icons.palette_outlined, size: 16),
|
||||
label: Text(l.storeSegmentStudio),
|
||||
icon:
|
||||
const Icon(Icons.palette_outlined, size: 16),
|
||||
),
|
||||
],
|
||||
selected: {_showStudio},
|
||||
|
|
@ -799,6 +801,34 @@ String _sourceForItem(StoreItem i) {
|
|||
/// data model — only the display side gets localised. Unknown
|
||||
/// ids fall through unchanged so newly-added categories don't
|
||||
/// vanish until we update this map.
|
||||
/// Localized label for a canonical category slug (from the hub). Falls
|
||||
/// back to the hub's English label / raw category for an unknown slug.
|
||||
String _canonicalCatLabel(BuildContext ctx, String slug, String fallback) {
|
||||
final l = AppLocalizations.of(ctx)!;
|
||||
switch (slug) {
|
||||
case 'documents':
|
||||
return l.storeCatDocuments;
|
||||
case 'text-language':
|
||||
return l.storeCatTextLanguage;
|
||||
case 'data':
|
||||
return l.storeCatData;
|
||||
case 'ai-llm':
|
||||
return l.storeCatAiLlm;
|
||||
case 'web-api':
|
||||
return l.storeCatWebApi;
|
||||
case 'analysis-domain':
|
||||
return l.storeCatAnalysisDomain;
|
||||
case 'studio-themes':
|
||||
return l.storeCatStudioThemes;
|
||||
case 'examples-dev':
|
||||
return l.storeCatExamplesDev;
|
||||
case 'other':
|
||||
return l.storeCatOther;
|
||||
default:
|
||||
return fallback.isNotEmpty ? fallback : slug;
|
||||
}
|
||||
}
|
||||
|
||||
String _categoryDisplayName(BuildContext ctx, String wire) {
|
||||
final l = AppLocalizations.of(ctx)!;
|
||||
switch (wire) {
|
||||
|
|
@ -1651,7 +1681,7 @@ class _StoreGrid extends StatelessWidget {
|
|||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
labels[slug] ?? slug,
|
||||
_canonicalCatLabel(context, slug, labels[slug] ?? ''),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleSmall
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue