Add support for latest l10n implementation

This commit is contained in:
Shawn 2022-11-29 22:05:14 -07:00
parent 38bff5eaa3
commit 5b5042b92e
16 changed files with 503 additions and 346 deletions

View File

@ -2,17 +2,22 @@
"appName": "Wonderous", "appName": "Wonderous",
"localeSwapButton": "简体中文", "localeSwapButton": "简体中文",
"animatedArrowSemanticSwipe": "Explore details about {title}.", "animatedArrowSemanticSwipe": "Explore details about {title}.",
"@animatedArrowSemanticSwipe": {"placeholders": {"title": {}}},
"appBarTitleFactsHistory": "Facts and History", "appBarTitleFactsHistory": "Facts and History",
"appBarTitleConstruction": "Construction", "appBarTitleConstruction": "Construction",
"appBarTitleLocation": "Location Info", "appBarTitleLocation": "Location Info",
"bottomScrubberSemanticScrubber": "scrubber", "bottomScrubberSemanticScrubber": "scrubber",
"bottomScrubberSemanticTimeline": "Timeline Scrubber, drag horizontally to navigate the timeline.", "bottomScrubberSemanticTimeline": "Timeline Scrubber, drag horizontally to navigate the timeline.",
"collectionLabelDiscovered": "{percentage}% discovered", "collectionLabelDiscovered": "{percentage}% discovered",
"@collectionLabelDiscovered": {"placeholders": {"percentage": {}}},
"collectionLabelCount": "{count} of {total}", "collectionLabelCount": "{count} of {total}",
"@collectionLabelCount": {"placeholders": {"count": {}, "total": {}}},
"collectionButtonReset": "Reset Collection", "collectionButtonReset": "Reset Collection",
"eventsListButtonOpenGlobal": "Open global timeline", "eventsListButtonOpenGlobal": "Open global timeline",
"newlyDiscoveredSemanticNew": "{count} new item{plural} to explore. Scroll to new item", "newlyDiscoveredSemanticNew": "{count} new item{suffix} to explore. Scroll to new item",
"newlyDiscoveredLabelNew": "{count} new item{plural} to explore", "@newlyDiscoveredSemanticNew": {"placeholders": {"count": {}, "suffix": {}}},
"newlyDiscoveredLabelNew": "{count} new item{suffix} to explore",
"@newlyDiscoveredLabelNew": {"placeholders": {"count": {}, "suffix": {}}},
"resultsPopupEnglishContent": "This content is provided by the Metropolitan Museum of Art Collection API, and is only available in English.", "resultsPopupEnglishContent": "This content is provided by the Metropolitan Museum of Art Collection API, and is only available in English.",
"resultsSemanticDismiss": "dismiss message", "resultsSemanticDismiss": "dismiss message",
"scrollingContentSemanticYoutube": "Youtube thumbnail", "scrollingContentSemanticYoutube": "Youtube thumbnail",
@ -21,14 +26,19 @@
"searchInputHintSearch": "Search (ex. type or material)", "searchInputHintSearch": "Search (ex. type or material)",
"searchInputSemanticClear": "clear search", "searchInputSemanticClear": "clear search",
"timelineSemanticDate": "{fromDate} to {endDate}", "timelineSemanticDate": "{fromDate} to {endDate}",
"@timelineSemanticDate": {"placeholders": {"fromDate": {}, "endDate": {}}},
"titleLabelDate": "{fromDate} to {endDate}", "titleLabelDate": "{fromDate} to {endDate}",
"@titleLabelDate": {"placeholders": {"fromDate": {}, "endDate": {}}},
"appModalsButtonOk": "Ok", "appModalsButtonOk": "Ok",
"appModalsButtonCancel": "Cancel", "appModalsButtonCancel": "Cancel",
"appPageDefaultTitlePage": "page", "appPageDefaultTitlePage": "page",
"appPageSemanticSwipe": "{pageTitle} {count} of {total}.", "appPageSemanticSwipe": "{pageTitle} {count} of {total}.",
"@appPageSemanticSwipe": {"placeholders": {"pageTitle": {}, "total": {}, "count": {}}},
"artifactsTitleArtifacts": "ARTIFACTS", "artifactsTitleArtifacts": "ARTIFACTS",
"semanticsPrevious": "Previous {title}", "semanticsPrevious": "Previous {title}",
"@semanticsPrevious": {"placeholders": {"title": {}}},
"semanticsNext": "Next {title}", "semanticsNext": "Next {title}",
"@semanticsNext": {"placeholders": {"title": {}}},
"artifactsSemanticsPrevious": "Previous artifact", "artifactsSemanticsPrevious": "Previous artifact",
"artifactsSemanticsNext": "Next artifact", "artifactsSemanticsNext": "Next artifact",
"artifactsSemanticArtifact": "Artifact", "artifactsSemanticArtifact": "Artifact",
@ -41,11 +51,13 @@
"artifactDetailsLabelClassification": "Classification", "artifactDetailsLabelClassification": "Classification",
"artifactDetailsSemanticThumbnail": "thumbnail image", "artifactDetailsSemanticThumbnail": "thumbnail image",
"artifactDetailsErrorNotFound": "Unable to find info for artifact {artifactId} ", "artifactDetailsErrorNotFound": "Unable to find info for artifact {artifactId} ",
"@artifactDetailsErrorNotFound": {"placeholders": {"artifactId": {}}},
"artifactsSearchTitleBrowse": "Browse Artifacts", "artifactsSearchTitleBrowse": "Browse Artifacts",
"artifactsSearchLabelNotFound": "No artifacts found", "artifactsSearchLabelNotFound": "No artifacts found",
"artifactsSearchButtonToggle": "Toggle Timeframe", "artifactsSearchButtonToggle": "Toggle Timeframe",
"artifactsSearchSemanticTimeframe": "timeframe", "artifactsSearchSemanticTimeframe": "timeframe",
"artifactsSearchLabelFound": "{numFound} artifacts found, {numResults} in ", "artifactsSearchLabelFound": "{numFound} artifacts found, {numResults} in ",
"@artifactsSearchLabelFound": {"placeholders": {"numFound": {}, "numResults": {}}},
"artifactsSearchLabelAdjust": "Adjust your", "artifactsSearchLabelAdjust": "Adjust your",
"artifactsSearchLabelSearch": "search terms", "artifactsSearchLabelSearch": "search terms",
"artifactsSearchLabelTimeframe": "timeframe", "artifactsSearchLabelTimeframe": "timeframe",
@ -64,15 +76,20 @@
"homeMenuButtonAbout": "About this app", "homeMenuButtonAbout": "About this app",
"homeMenuAboutWonderous": "Wonderous is a visual showcase of eight wonders of the world. ", "homeMenuAboutWonderous": "Wonderous is a visual showcase of eight wonders of the world. ",
"homeMenuAboutBuilt": "Built with {flutterUrl} by the team at {gskinnerUrl}.", "homeMenuAboutBuilt": "Built with {flutterUrl} by the team at {gskinnerUrl}.",
"@homeMenuAboutBuilt": {"placeholders": {"flutterUrl": {}, "gskinnerUrl": {}}},
"homeMenuAboutLearn": "Learn more at {wonderousUrl}.", "homeMenuAboutLearn": "Learn more at {wonderousUrl}.",
"@homeMenuAboutLearn": {"placeholders": {"wonderousUrl": {}}},
"homeMenuAboutSource": "To see the source code for this app, please visit the {githubUrl}.", "homeMenuAboutSource": "To see the source code for this app, please visit the {githubUrl}.",
"@homeMenuAboutSource": {"placeholders": {"githubUrl": {}}},
"homeMenuAboutRepo": "Wonderous github repo", "homeMenuAboutRepo": "Wonderous github repo",
"homeMenuAboutFlutter": "Flutter", "homeMenuAboutFlutter": "Flutter",
"homeMenuAboutGskinner": "gskinner", "homeMenuAboutGskinner": "gskinner",
"homeMenuAboutApp": "wonderous.app", "homeMenuAboutApp": "wonderous.app",
"homeMenuAboutPublic": "Public-domain artworks from {metUrl}.", "homeMenuAboutPublic": "Public-domain artworks from {metUrl}.",
"@homeMenuAboutPublic": {"placeholders": {"metUrl": {}}},
"homeMenuAboutMet": "The Metropolitan Museum of Art, New York", "homeMenuAboutMet": "The Metropolitan Museum of Art, New York",
"homeMenuAboutPhotography": "Photography from {unsplashUrl}.", "homeMenuAboutPhotography": "Photography from {unsplashUrl}.",
"@homeMenuAboutPhotography": {"placeholders": {"unsplashUrl": {}}},
"homeMenuAboutUnsplash": "Unsplash", "homeMenuAboutUnsplash": "Unsplash",
"introTitleJourney": "Journey to the past", "introTitleJourney": "Journey to the past",
"introDescriptionNavigate": "Navigate the intersection of time, art, and culture.", "introDescriptionNavigate": "Navigate the intersection of time, art, and culture.",
@ -87,7 +104,9 @@
"labelledToggleSemanticToggle": "toggle", "labelledToggleSemanticToggle": "toggle",
"photoGallerySemanticCollectible": "collectible!", "photoGallerySemanticCollectible": "collectible!",
"photoGallerySemanticFocus": "Photo {photoIndex} of {photoTotal}. Tap to focus.", "photoGallerySemanticFocus": "Photo {photoIndex} of {photoTotal}. Tap to focus.",
"@photoGallerySemanticFocus": {"placeholders": {"photoIndex": {}, "photoTotal": {}}},
"photoGallerySemanticFullscreen": "Photo {photoIndex} of {photoTotal}. Tap to open fullscreen view.", "photoGallerySemanticFullscreen": "Photo {photoIndex} of {photoTotal}. Tap to open fullscreen view.",
"@photoGallerySemanticFullscreen": {"placeholders": {"photoIndex": {}, "photoTotal": {}}},
"eraPrehistory": "Prehistory", "eraPrehistory": "Prehistory",
"eraClassical": "Classical Era", "eraClassical": "Classical Era",
"eraEarlyModern": "Early Modern Era", "eraEarlyModern": "Early Modern Era",
@ -95,8 +114,10 @@
"yearBCE": "BCE", "yearBCE": "BCE",
"yearCE": "CE", "yearCE": "CE",
"yearFormat": "{date} {era}", "yearFormat": "{date} {era}",
"@yearFormat": {"placeholders": {"date": {}, "era": {}}},
"year": "Year", "year": "Year",
"timelineLabelConstruction": "Construction of {title} begins.", "timelineLabelConstruction": "Construction of {title} begins.",
"@timelineLabelConstruction": {"placeholders": {"title": {}}},
"timelineTitleGlobalTimeline": "Global Timeline", "timelineTitleGlobalTimeline": "Global Timeline",
"wallpaperModalSave": "Save this poster to your photo gallery?", "wallpaperModalSave": "Save this poster to your photo gallery?",
"wallpaperModalSaving": "Saving Image. Please wait...", "wallpaperModalSaving": "Saving Image. Please wait...",

View File

@ -46,13 +46,7 @@ class StringUtils {
static String formatYr(int yr) { static String formatYr(int yr) {
if (yr == 0) yr = 1; if (yr == 0) yr = 1;
return supplant( return $strings.yearFormat(yr.abs().toString(), getYrSuffix(yr));
$strings.yearFormat,
{
'{date}': yr.abs().toString(),
'{era}': getYrSuffix(yr),
},
);
} }
static String getYrSuffix(int yr) => yr < 0 ? $strings.yearBCE : $strings.yearCE; static String getYrSuffix(int yr) => yr < 0 ? $strings.yearBCE : $strings.yearCE;

View File

@ -1,12 +1,10 @@
import 'dart:collection'; import 'dart:collection';
import 'package:wonders/common_libs.dart'; import 'package:wonders/common_libs.dart';
import 'package:wonders/logic/common/string_utils.dart'; import 'package:wonders/logic/common/http_client.dart';
import 'package:wonders/logic/data/artifact_data.dart'; import 'package:wonders/logic/data/artifact_data.dart';
import 'package:wonders/logic/met_api_service.dart'; import 'package:wonders/logic/met_api_service.dart';
import 'package:wonders/logic/common/http_client.dart';
class MetAPILogic { class MetAPILogic {
final HashMap<String, ArtifactData?> _artifactCache = HashMap(); final HashMap<String, ArtifactData?> _artifactCache = HashMap();
@ -16,7 +14,7 @@ class MetAPILogic {
Future<ArtifactData?> getArtifactByID(String id) async { Future<ArtifactData?> getArtifactByID(String id) async {
if (_artifactCache.containsKey(id)) return _artifactCache[id]; if (_artifactCache.containsKey(id)) return _artifactCache[id];
ServiceResult<ArtifactData?> result = (await service.getObjectByID(id)); ServiceResult<ArtifactData?> result = (await service.getObjectByID(id));
if (!result.success) throw StringUtils.supplant($strings.artifactDetailsErrorNotFound, {'{artifactId}': id}); if (!result.success) throw $strings.artifactDetailsErrorNotFound(id);
ArtifactData? artifact = result.content; ArtifactData? artifact = result.content;
return _artifactCache[id] = artifact; return _artifactCache[id] = artifact;
} }

View File

@ -1,5 +1,4 @@
import 'package:wonders/common_libs.dart'; import 'package:wonders/common_libs.dart';
import 'package:wonders/logic/common/string_utils.dart';
import 'package:wonders/logic/data/timeline_data.dart'; import 'package:wonders/logic/data/timeline_data.dart';
class TimelineLogic { class TimelineLogic {
@ -12,7 +11,7 @@ class TimelineLogic {
...wondersLogic.all.map( ...wondersLogic.all.map(
(w) => TimelineEvent( (w) => TimelineEvent(
w.startYr, w.startYr,
StringUtils.supplant($strings.timelineLabelConstruction, {'{title}': w.title}), $strings.timelineLabelConstruction(w.title),
), ),
) )
]; ];

View File

@ -1,6 +1,5 @@
import 'package:smooth_page_indicator/smooth_page_indicator.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:wonders/common_libs.dart'; import 'package:wonders/common_libs.dart';
import 'package:wonders/logic/common/string_utils.dart';
class AppPageIndicator extends StatefulWidget { class AppPageIndicator extends StatefulWidget {
AppPageIndicator({ AppPageIndicator({
@ -53,11 +52,11 @@ class _AppPageIndicatorState extends State<AppPageIndicator> {
liveRegion: true, liveRegion: true,
focusable: false, focusable: false,
readOnly: true, readOnly: true,
label: StringUtils.supplant($strings.appPageSemanticSwipe, { label: $strings.appPageSemanticSwipe(
'{pageTitle}': widget.semanticPageTitle, widget.semanticPageTitle,
'{count}': (_controllerPage % (widget.count) + 1).toString(), (_controllerPage % (widget.count) + 1),
'{total}': widget.count.toString(), widget.count,
}), ),
child: Container()); child: Container());
}), }),
), ),

View File

@ -79,7 +79,7 @@ class _ArtifactDetailsScreenState extends State<ArtifactDetailsScreen> {
SizedBox( SizedBox(
width: $styles.insets.xxl * 3, width: $styles.insets.xxl * 3,
child: Text( child: Text(
StringUtils.supplant($strings.artifactDetailsErrorNotFound, {'{artifactId}': widget.artifactId}), $strings.artifactDetailsErrorNotFound(widget.artifactId),
style: $styles.text.body.copyWith(color: $styles.colors.offWhite), style: $styles.text.body.copyWith(color: $styles.colors.offWhite),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),

View File

@ -1,6 +1,5 @@
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:wonders/common_libs.dart'; import 'package:wonders/common_libs.dart';
import 'package:wonders/logic/common/string_utils.dart';
import 'package:wonders/logic/data/wonder_data.dart'; import 'package:wonders/logic/data/wonder_data.dart';
import 'package:wonders/logic/data/wonders_data/search/search_data.dart'; import 'package:wonders/logic/data/wonders_data/search/search_data.dart';
import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/app_icons.dart';
@ -144,13 +143,7 @@ class _ArtifactSearchScreenState extends State<ArtifactSearchScreen> with GetItS
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Gap($styles.insets.sm), Gap($styles.insets.sm),
Text( Text(
StringUtils.supplant( $strings.artifactsSearchLabelFound(_searchResults.length, _filteredResults.length),
$strings.artifactsSearchLabelFound,
{
'{numFound}': _searchResults.length.toString(),
'{numResults}': _filteredResults.length.toString(),
},
),
textHeightBehavior: TextHeightBehavior(applyHeightToFirstAscent: false), textHeightBehavior: TextHeightBehavior(applyHeightToFirstAscent: false),
style: statusStyle, style: statusStyle,
), ),

View File

@ -44,18 +44,12 @@ class _CollectionFooter extends StatelessWidget {
Widget _buildProgressRow(BuildContext context) { Widget _buildProgressRow(BuildContext context) {
return Row(children: [ return Row(children: [
Text( Text(
StringUtils.supplant( $strings.collectionLabelDiscovered((count / total * 100).round()),
$strings.collectionLabelDiscovered,
{'{percentage}': (count / total * 100).round().toString()},
),
style: $styles.text.body.copyWith(color: $styles.colors.accent1), style: $styles.text.body.copyWith(color: $styles.colors.accent1),
), ),
Spacer(), Spacer(),
Text( Text(
StringUtils.supplant( $strings.collectionLabelCount(count, total),
$strings.collectionLabelCount,
{'{count}': count.toString(), '{total}': total.toString()},
),
style: $styles.text.body.copyWith(color: $styles.colors.offWhite), style: $styles.text.body.copyWith(color: $styles.colors.offWhite),
) )
]); ]);

View File

@ -12,10 +12,7 @@ class _NewlyDiscoveredItemsBtn extends StatelessWidget {
if (count == 0) return SizedBox.shrink(); if (count == 0) return SizedBox.shrink();
return AppBtn.basic( return AppBtn.basic(
semanticLabel: StringUtils.supplant( semanticLabel: $strings.newlyDiscoveredSemanticNew(count, count == 1 ? '' : 's'),
$strings.newlyDiscoveredSemanticNew,
{'{count}': count.toString(), '{plural}': count == 1 ? '' : 's'},
),
onPressed: onPressed, onPressed: onPressed,
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -23,10 +20,7 @@ class _NewlyDiscoveredItemsBtn extends StatelessWidget {
color: $styles.colors.black, color: $styles.colors.black,
padding: EdgeInsets.symmetric(vertical: $styles.insets.xs), padding: EdgeInsets.symmetric(vertical: $styles.insets.xs),
child: Text( child: Text(
StringUtils.supplant( $strings.newlyDiscoveredLabelNew(count, count == 1 ? '' : 's'),
$strings.newlyDiscoveredLabelNew,
{'{count}': count.toString(), '{plural}': count == 1 ? '' : 's'},
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
textHeightBehavior: TextHeightBehavior(applyHeightToFirstAscent: false), textHeightBehavior: TextHeightBehavior(applyHeightToFirstAscent: false),
style: $styles.text.bodySmallBold.copyWith(color: $styles.colors.accent1), style: $styles.text.bodySmallBold.copyWith(color: $styles.colors.accent1),

View File

@ -82,13 +82,7 @@ class _TitleText extends StatelessWidget {
/// Date /// Date
Text( Text(
StringUtils.supplant( $strings.titleLabelDate(StringUtils.formatYr(data.startYr), StringUtils.formatYr(data.endYr)),
$strings.titleLabelDate,
{
'{fromDate}': StringUtils.formatYr(data.startYr),
'{endDate}': StringUtils.formatYr(data.endYr),
},
),
style: $styles.text.h4, style: $styles.text.h4,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),

View File

@ -22,7 +22,7 @@ class _AnimatedArrowButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Duration duration = $styles.times.med; final Duration duration = $styles.times.med;
final btnLbl = StringUtils.supplant($strings.animatedArrowSemanticSwipe, {'{title}': semanticTitle}); final btnLbl = $strings.animatedArrowSemanticSwipe(semanticTitle);
return AppBtn.basic( return AppBtn.basic(
semanticLabel: btnLbl, semanticLabel: btnLbl,
onPressed: onTap, onPressed: onTap,

View File

@ -48,28 +48,28 @@ class AboutDialogContent extends StatelessWidget {
style: $styles.text.bodySmall.copyWith(color: Colors.black, fontSize: fontSize), style: $styles.text.bodySmall.copyWith(color: Colors.black, fontSize: fontSize),
children: [ children: [
...buildSpan($strings.homeMenuAboutWonderous), ...buildSpan($strings.homeMenuAboutWonderous),
...buildSpan($strings.homeMenuAboutBuilt, linkSupplants: { ...buildSpan($strings.homeMenuAboutBuilt('{flutterUrl}', '{gskinnerUrl}'), linkSupplants: {
'{flutterUrl}': [$strings.homeMenuAboutFlutter, 'https://flutter.dev'], 'flutterUrl': [$strings.homeMenuAboutFlutter, 'https://flutter.dev'],
'{gskinnerUrl}': [$strings.homeMenuAboutGskinner, 'https://gskinner.com/flutter'], 'gskinnerUrl': [$strings.homeMenuAboutGskinner, 'https://gskinner.com/flutter'],
}), }),
...buildSpan('\n\n'), ...buildSpan('\n\n'),
...buildSpan($strings.homeMenuAboutLearn, linkSupplants: { ...buildSpan($strings.homeMenuAboutLearn('wonderousUrl'), linkSupplants: {
'{wonderousUrl}': [$strings.homeMenuAboutApp, 'https://wonderous.app'], 'wonderousUrl': [$strings.homeMenuAboutApp, 'https://wonderous.app'],
}), }),
...buildSpan('\n\n'), ...buildSpan('\n\n'),
...buildSpan($strings.homeMenuAboutSource, linkSupplants: { ...buildSpan($strings.homeMenuAboutSource('githubUrl'), linkSupplants: {
'{githubUrl}': [$strings.homeMenuAboutRepo, 'https://github.com/gskinnerTeam/flutter-wonderous-app'], 'githubUrl': [$strings.homeMenuAboutRepo, 'https://github.com/gskinnerTeam/flutter-wonderous-app'],
}), }),
...buildSpan('\n\n'), ...buildSpan('\n\n'),
...buildSpan($strings.homeMenuAboutPublic, linkSupplants: { ...buildSpan($strings.homeMenuAboutPublic('metUrl'), linkSupplants: {
'{metUrl}': [ 'metUrl': [
$strings.homeMenuAboutMet, $strings.homeMenuAboutMet,
'https://www.metmuseum.org/about-the-met/policies-and-documents/open-access' 'https://www.metmuseum.org/about-the-met/policies-and-documents/open-access'
], ],
}), }),
...buildSpan('\n\n'), ...buildSpan('\n\n'),
...buildSpan($strings.homeMenuAboutPhotography, linkSupplants: { ...buildSpan($strings.homeMenuAboutPhotography('unsplashUrl'), linkSupplants: {
'{unsplashUrl}': [$strings.homeMenuAboutUnsplash, 'https://unsplash.com/@gskinner/collections'], 'unsplashUrl': [$strings.homeMenuAboutUnsplash, 'https://unsplash.com/@gskinner/collections'],
}), }),
], ],
), ),

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:wonders/common_libs.dart'; import 'package:wonders/common_libs.dart';
import 'package:wonders/logic/common/string_utils.dart';
import 'package:wonders/logic/data/unsplash_photo_data.dart'; import 'package:wonders/logic/data/unsplash_photo_data.dart';
import 'package:wonders/ui/common/controls/app_loading_indicator.dart'; import 'package:wonders/ui/common/controls/app_loading_indicator.dart';
import 'package:wonders/ui/common/controls/eight_way_swipe_detector.dart'; import 'package:wonders/ui/common/controls/eight_way_swipe_detector.dart';
@ -206,14 +205,8 @@ class _PhotoGalleryState extends State<PhotoGallery> {
semanticLbl = $strings.collectibleItemSemanticCollectible; semanticLbl = $strings.collectibleItemSemanticCollectible;
} else { } else {
semanticLbl = !selected semanticLbl = !selected
? StringUtils.supplant($strings.photoGallerySemanticFocus, { ? $strings.photoGallerySemanticFocus(index + 1, _imgCount)
'{photoIndex}': (index + 1).toString(), : $strings.photoGallerySemanticFullscreen(index + 1, _imgCount);
'{photoTotal}': _imgCount.toString(),
})
: StringUtils.supplant($strings.photoGallerySemanticFullscreen, {
'{photoIndex}': (index + 1).toString(),
'{photoTotal}': _imgCount.toString(),
});
} }
return MergeSemantics( return MergeSemantics(
child: Semantics( child: Semantics(

View File

@ -16,10 +16,10 @@ class TimelineSection extends StatelessWidget {
fraction = fraction.clamp(0, 1); fraction = fraction.clamp(0, 1);
return Semantics( return Semantics(
label: '${data.title}, ${StringUtils.supplant($strings.timelineSemanticDate, { label: '${data.title}, ${$strings.timelineSemanticDate(
'{fromDate}': StringUtils.formatYr(data.startYr), StringUtils.formatYr(data.startYr),
'{endDate}': StringUtils.formatYr(data.endYr) StringUtils.formatYr(data.endYr),
})}', )}',
child: IgnorePointer( child: IgnorePointer(
ignoringSemantics: false, ignoringSemantics: false,
child: Container( child: Container(

View File

@ -96,12 +96,9 @@ class _WonderImageWithTimeline extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
StringUtils.supplant( $strings.titleLabelDate(
$strings.titleLabelDate, StringUtils.formatYr(data.startYr),
{ StringUtils.formatYr(data.endYr),
'{fromDate}': StringUtils.formatYr(data.startYr),
'{endDate}': StringUtils.formatYr(data.endYr),
},
), ),
style: textStyle, style: textStyle,
), ),

File diff suppressed because it is too large Load Diff