chore: add untranslated strings, fix: caps (#244)

This commit is contained in:
Shreyas Thirumalai 2021-06-17 08:32:41 +05:30 committed by GitHub
parent 64178db3db
commit ddfa9e469e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 812 additions and 222 deletions

View File

@ -63,11 +63,11 @@
"@members": { "@members": {
"description": "members of an organization" "description": "members of an organization"
}, },
"popularRepositories": "popular repositories", "popularRepositories": "Popular Repositories",
"@popularRepositories": { "@popularRepositories": {
"description": "popular repositories" "description": "popular repositories"
}, },
"pinnedRepositories": "pinned repositories", "pinnedRepositories": "Pinned Repositories",
"@pinnedRepositories": { "@pinnedRepositories": {
"description": "pinned repositories" "description": "pinned repositories"
}, },
@ -75,11 +75,11 @@
"@settings": { "@settings": {
"description": "settings" "description": "settings"
}, },
"system": "system", "system": "System",
"@system": { "@system": {
"description": "system" "description": "system"
}, },
"githubStatus": "GitHub status", "githubStatus": "GitHub Status",
"@githubStatus": { "@githubStatus": {
"description": "github status" "description": "github status"
}, },
@ -87,15 +87,15 @@
"@reviewPermissions": { "@reviewPermissions": {
"description": "review Permissions" "description": "review Permissions"
}, },
"gitlabStatus": "GitLab status", "gitlabStatus": "GitLab Status",
"@gitlabStatus": { "@gitlabStatus": {
"description": "GitLab status" "description": "GitLab status"
}, },
"giteaStatus": "Gitea status", "giteaStatus": "Gitea Status",
"@giteaStatus": { "@giteaStatus": {
"description": "Gitea status" "description": "Gitea status"
}, },
"switchAccounts": "Switch accounts", "switchAccounts": "Switch Accounts",
"@switchAccounts": { "@switchAccounts": {
"description": "Switch accounts" "description": "Switch accounts"
}, },
@ -147,10 +147,14 @@
"@feedback": { "@feedback": {
"description": "provide feedback" "description": "provide feedback"
}, },
"submitAnIssue": "Submit an issue", "submitAnIssue": "Submit An Issue",
"@submitAnIssue": { "@submitAnIssue": {
"description": "submit issue for app" "description": "submit issue for app"
}, },
"submit": "Submit",
"@submit": {
"description": "submit button text"
},
"rateThisApp": "Rate This App", "rateThisApp": "Rate This App",
"@rateThisApp": { "@rateThisApp": {
"description": "rate the app" "description": "rate the app"
@ -159,7 +163,7 @@
"@email": { "@email": {
"description": "Email to report issues" "description": "Email to report issues"
}, },
"about": "about", "about": "About",
"@about": { "@about": {
"description": "about section" "description": "about section"
}, },
@ -187,6 +191,10 @@
"@releases": { "@releases": {
"description": "releases" "description": "releases"
}, },
"released": "released",
"@released": {
"description": "released"
},
"watchers": "Watchers", "watchers": "Watchers",
"@watchers": { "@watchers": {
"description": "watchers" "description": "watchers"
@ -199,7 +207,7 @@
"@issues": { "@issues": {
"description": "issues" "description": "issues"
}, },
"pullRequests": "Pull requests", "pullRequests": "Pull Requests",
"@pullRequests": { "@pullRequests": {
"description": "Pull Requests" "description": "Pull Requests"
}, },
@ -263,15 +271,15 @@
"@project": { "@project": {
"description": "project" "description": "project"
}, },
"selectAccount": "Select account", "selectAccount": "Select Account",
"@selectAccount": { "@selectAccount": {
"description": "select account message" "description": "select account message"
}, },
"removeAccount": "Remove account", "removeAccount": "Remove Account",
"@removeAccount": { "@removeAccount": {
"description": "remove account" "description": "remove account"
}, },
"somethingBadHappens": "Something bad happens:", "somethingBadHappens": "Something Bad Happens:",
"@somethingBadHappens": { "@somethingBadHappens": {
"description": "error message" "description": "error message"
}, },
@ -346,5 +354,494 @@
"fontStyle": "FONT STYLE", "fontStyle": "FONT STYLE",
"@fontStyle": { "@fontStyle": {
"description": "font style" "description": "font style"
},
"appLanguage": "App Language",
"@appLanguage": {
"description": "The app's language"
},
"reloadMessage": "The app will reload to make the language setting take effect",
"@reloadMessage": {
"description": "Reload message"
},
"theme": "Theme",
"@theme": {
"description": "Theme header text"
},
"title": "Title",
"@title": {
"description": "title"
},
"body": "Body",
"@body": {
"description": "body"
},
"timelineTypeNotImplemented": "Type not implemented yet",
"@timelineTypeNotImplemented": {
"description": "Timeline type not implemented"
},
"pullRequestCommitMessage": "added commit {commit}",
"@pullRequestCommitMessage": {
"description": "pull request commit message",
"placeholders": {
"commit": {
"type": "String"
}
}
},
"crossReferencedEventMessage": "references this on",
"@crossReferencedEventMessage": {
"description": "cross referenced event"
},
"closedEventMessage": "closed this",
"@closedEventMessage": {
"description": "closed event"
},
"reopenedEventMessage": "reopened this",
"@reopenedEventMessage": {
"description": "reopened event"
},
"subscribedEventMessage": "subscribed to this issue",
"@subscribedEventMessage": {
"description": "subscribed event"
},
"unsubscribedEventMessage": "unsubscribed from this issue",
"@unsubscribedEventMessage": {
"description": "unsubscribed event"
},
"referencedEventMessage": "referenced this pull request from commit {commit} from {repoName}",
"@referencedEventMessage": {
"description": "referenced event",
"placeholders": {
"commit": {
"type": "String"
},
"repoName": {
"type": "String"
}
}
},
"assignedEventMessage": "assigned this to",
"@assignedEventMessage": {
"description": "assigned event"
},
"unassignedEventMessage": "unassigned this from",
"@unassignedEventMessage": {
"description": "unassigned event"
},
"added": "added",
"@added": {
"description": "added"
},
"removed": "removed",
"@removed": {
"description": "removed"
},
"label": "label",
"@label": {
"description": "label"
},
"milestonedEventMessage": "added this to {milestone} milestone",
"@milestonedEventMessage": {
"description": "milestone event",
"placeholders": {
"milestone": {
"type": "String"
}
}
},
"demilestonedEventMessage": "removed this from {milestone} milestone",
"@demilestonedEventMessage": {
"description": "demilestoned event",
"placeholders": {
"milestone": {
"type": "String"
}
}
},
"renamedTitleEventMessage": "changed the title to {title} from",
"@renamedTitleEventMessage": {
"description": "changed title event",
"placeholders": {
"title": {
"type": "String"
}
}
},
"lockedConversationEventMessage": "locked this conversation",
"@lockedConversationEventMessage": {
"description": "locked this conversation"
},
"unlockedConversationEventMessage": "unlocked this conversation",
"@unlockedConversationEventMessage": {
"description": "unlocked this conversation"
},
"transferredEventMessage": "transferred this issue from {repoName}",
"@transferredEventMessage": {
"description": "transferred event",
"placeholders": {
"repoName": {
"type": "String"
}
}
},
"approvedChanges": "approved these changes",
"@approvedChanges": {
"description": "approved these changes"
},
"reviewed": "reviewed",
"@reviewed": {
"description": "reviewed"
},
"mergedEventMessage": "merged commit {commit} into {mergeRefName}",
"@mergedEventMessage": {
"description": "merged event message",
"placeholders": {
"commit": {
"type": "String"
},
"mergeRefName": {
"type": "String"
}
}
},
"mentionedEventMessage": "was mentioned",
"@mentionedEventMessage": {
"description": "was mentioned"
},
"pinnedEventMessage": "pinned this issue",
"@pinnedEventMessage": {
"description": "pinned this issue"
},
"deployedPR": "deployed the pull request {headRefName}",
"@deployedPR": {
"description": "deployed the pull request",
"placeholders": {
"headRefName": {
"type": "String"
}
}
},
"deploymentEnvironmentChangedEventMessage": "changed the development environment to {devEnv}",
"@deploymentEnvironmentChangedEventMessage": {
"description": "deployment environment changed event",
"placeholders": {
"devEnv": {
"type": "String"
}
}
},
"headRefDeletedEventMessage": "deleted the {headRefName} branch",
"@headRefDeletedEventMessage": {
"description": "head ref deleted event",
"placeholders": {
"headRefName": {
"type": "String"
}
}
},
"headRefRestoredEventMessage": "restored the {headRefName} branch",
"@headRefRestoredEventMessage": {
"description": "head ref restored event",
"placeholders": {
"headRefName": {
"type": "String"
}
}
},
"headRefForcedPushedEventFirstMessage": "force-pushed the",
"@headRefForcedPushedEventFirstMessage": {
"description": "head ref forced pushed event message first half"
},
"headRefForcedPushedEventSecondMessage": "branch from",
"@headRefForcedPushedEventSecondMessage": {
"description": "head ref forced pushed event message second half"
},
"reviewRequestEventMessage": "requested a review from",
"@reviewRequestEventMessage": {
"description": "requested a review from"
},
"fromReviewRequest": "from the review request",
"@fromReviewRequest": {
"description": "from the review request"
},
"reviewDismissedEventMessage": "dismissed the pull request review requested by",
"@reviewDismissedEventMessage": {
"description": "dismissed the pull request review requested by"
},
"nCommitsTo": "{count,plural, =1{{count} commit to} other{{count} commits to}}",
"@nCommitsTo": {
"description": "no. of commits to a branch",
"placeholders": {
"count": {
"type": "String"
}
}
},
"checkRunEventMessage": "{action} a check run for {name}",
"@checkRunEventMessage": {
"description": "check run event",
"placeholders": {
"action": {
"type": "String"
},
"name": {
"type": "String"
}
}
},
"checkSuiteEventConclusionMessage": "it is a {conclusion}",
"@checkSuiteEventConclusionMessage": {
"description": "check suite event conclusion",
"placeholders": {
"conclusion": {
"type": "String"
}
}
},
"actionRequiredConclusion": "it requires more action",
"@actionRequiredConclusion": {
"description": "it requires more action"
},
"checkSuiteEventMessage": "{action} the check suite and the conclusion is that",
"@checkSuiteEventMessage": {
"description": "check suite event message conclusion",
"placeholders": {
"action": {
"type": "String"
}
}
},
"commitCommentEventMessage": "commented on a commit at",
"@commitCommentEventMessage": {
"description": "commit comment event message"
},
"contentReferenceEventMessage": "{action} a content reference at",
"@contentReferenceEventMessage": {
"description": "content reference event",
"placeholders": {
"action": {
"type": "String"
}
}
},
"createdEventMessage": "created a {refType} {ref} at",
"@createdEventMessage": {
"description": "created event message",
"placeholders": {
"refType": {
"type": "String"
},
"ref": {
"type": "String"
}
}
},
"deletedEventMessage": "deleted the {refType} {ref} at",
"@deletedEventMessage": {
"description": "deleted event message",
"placeholders": {
"refType": {
"type": "String"
},
"ref": {
"type": "String"
}
}
},
"forked": "forked",
"@forked": {
"description": "forked"
},
"createdPages": "created the pages: {pageNames}",
"@createdPages": {
"description": "created pages",
"placeholders": {
"pageNames": {
"type": "String"
}
}
},
"editedPages": "edited the pages: {pageNames}",
"@editedPages": {
"description": "edited pages",
"placeholders": {
"pageAction": {
"type": "String"
}
}
},
"newPermissionsAccepted": "new permissions were accepted for action ",
"@newPermissionsAccepted": {
"description": "new permissions were accepted for"
},
"forGithubAppWithId": "for the Github App with id {id}",
"@forGithubAppWithId": {
"description": "for the Github App with id",
"placeholders": {
"id": {
"type": "String"
}
}
},
"wereAddedTo": "{repos} were added to the installation id {id}",
"@wereAddedTo": {
"description": "example: repo1,repo2 were added to the installation id ID",
"placeholders": {
"repos": {
"type": "String"
},
"id": {
"type": "String"
}
}
},
"wereRemovedFrom": "{repos} were removed from the installation id {id}",
"@wereRemovedFrom": {
"description": "example: repo1,repo2 were removed from the installation id ID",
"placeholders": {
"repos": {
"type": "String"
},
"id": {
"type": "String"
}
}
},
"commentedOn": "commented on",
"@commentedOn": {
"description": "commented on"
},
"at": "at",
"@at": {
"description": "at"
},
"to": "to",
"@to": {
"description": "to"
},
"from": "from",
"@from": {
"description": "from"
},
"purchasedMarketplacePlan": "purchased a Marketplace Plan",
"@purchasedMarketplacePlan": {
"description": "purchased a Marketplace Plan"
},
"cancelledMarketplacePlan": "cancelled their Marketplace Plan",
"@cancelledMarketplacePlan": {
"description": "cancelled their Marketplace Plan"
},
"pendingMarketplacePlan": "Marketplace Plan is pending change",
"@pendingMarketplacePlan": {
"description": "Marketplace Plan is pending change"
},
"pendingChangeCancelled": "Pending Marketplace Plan was cancelled",
"@pendingChangeCancelled": {
"description": "Pending Marketplace Plan was cancelled"
},
"changedMarketplacePlan": "changed their Marketplace Plan",
"@changedMarketplacePlan": {
"description": "changed their Marketplace Plan"
},
"was": "was",
"@was": {
"description": "was"
},
"convertProjectCard": "converted the project card into an issue",
"@convertProjectCard": {
"description": "converted the project card into an issue"
},
"theProjectCard": "the project card",
"@theProjectCard": {
"description": "the project card"
},
"projectColumnEventMessage": "{action} the project column {projectColumnName} at ",
"@projectColumnEventMessage": {
"description": "the project column",
"placeholders": {
"action": {
"type": "String"
},
"projectColumnName": {
"type": "String"
}
}
},
"projectEventMessage": "{action} the project {projectName}",
"@projectEventMessage": {
"description": "the project",
"placeholders": {
"action" : {
"type": "String"
},
"projectName": {
"type": "String"
}
}
},
"made": "made",
"@made": {
"description": "made"
},
"public": "public",
"@public": {
"description": "public"
},
"pullRequestEventMessage": "{action} pull request",
"@pullRequestEventMessage": {
"description": "pull request event",
"placeholders": {
"action": {
"type": "String"
}
}
},
"pullRequestReviewEventMessage": "{action} the pull request review",
"@pullRequestReviewEventMessage": {
"description": "pull request review event message",
"placeholders": {
"action": {
"type": "String"
}
}
},
"pullRequestReviewCommentEventMessage": "reviewed pull request",
"@pullRequestReviewCommentEventMessage": {
"description": "pull request review comment event"
},
"pushedTo": "pushed to",
"@pushedTo": {
"description": "pushed to"
},
"securityAlertInvolvingPackage": "Security alert involving the package {affectedPackageName} between versions {affectedRange} was {action}ed",
"@securityAlertInvolvingPackage": {
"description": "Security alert involving package",
"placeholders": {
"affectedPackageName": {
"type": "String"
},
"affectedRange": {
"type": "String"
},
"action": {
"type": "String"
}
}
},
"securityAdvisory": "Security advisory regarding {summary} was {action}",
"@securityAdvisory": {
"description": "Security advisory",
"placeholders": {
"summary": {
"type": "String"
},
"action": {
"type": "String"
}
}
},
"starred": "starred",
"@starred": {
"description": "starred"
} }
} }

View File

@ -5,6 +5,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class BbIssueCommentScreen extends StatefulWidget { class BbIssueCommentScreen extends StatefulWidget {
final String owner; final String owner;
@ -31,7 +32,7 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_body = v; _body = v;

View File

@ -6,6 +6,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class BbIssueFormScreen extends StatefulWidget { class BbIssueFormScreen extends StatefulWidget {
final String owner; final String owner;
@ -25,14 +26,14 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context); final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context); final auth = Provider.of<AuthModel>(context);
return CommonScaffold( return CommonScaffold(
title: Text('Submit an issue'), title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Title', placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_title = v; _title = v;
@ -44,7 +45,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_body = v; _body = v;
@ -54,7 +55,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
), ),
), ),
CupertinoButton.filled( CupertinoButton.filled(
child: Text('Submit'), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onPressed: () async {
await auth.fetchBbJson( await auth.fetchBbJson(
'/repositories/${widget.owner}/${widget.name}/issues', '/repositories/${widget.owner}/${widget.name}/issues',

View File

@ -5,6 +5,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GeIssueCommentScreen extends StatefulWidget { class GeIssueCommentScreen extends StatefulWidget {
final String owner; final String owner;
@ -46,7 +47,7 @@ class _GeIssueCommentScreenState extends State<GeIssueCommentScreen> {
child: CupertinoTextField( child: CupertinoTextField(
controller: _controller, controller: _controller,
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
maxLines: 10, maxLines: 10,
), ),
), ),

View File

@ -6,6 +6,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GeIssueFormScreen extends StatefulWidget { class GeIssueFormScreen extends StatefulWidget {
final String owner; final String owner;
@ -25,14 +26,14 @@ class _GeIssueFormScreenState extends State<GeIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context); final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context); final auth = Provider.of<AuthModel>(context);
return CommonScaffold( return CommonScaffold(
title: Text('Submit an issue'), title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Title', placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_title = v; _title = v;
@ -44,7 +45,7 @@ class _GeIssueFormScreenState extends State<GeIssueFormScreen> {
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_body = v; _body = v;
@ -54,7 +55,7 @@ class _GeIssueFormScreenState extends State<GeIssueFormScreen> {
), ),
), ),
CupertinoButton.filled( CupertinoButton.filled(
child: Text('Submit'), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onPressed: () async {
final res = await auth.fetchGitee( final res = await auth.fetchGitee(
'/repos/${widget.owner}/issues', '/repos/${widget.owner}/issues',

View File

@ -6,6 +6,7 @@ import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:github/github.dart'; import 'package:github/github.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GhIssueFormScreen extends StatefulWidget { class GhIssueFormScreen extends StatefulWidget {
final String owner; final String owner;
@ -25,14 +26,14 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context); final theme = Provider.of<ThemeModel>(context);
return CommonScaffold( return CommonScaffold(
title: Text('Submit an issue'), title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Title', placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_title = v; _title = v;
@ -44,7 +45,7 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_body = v; _body = v;
@ -54,7 +55,7 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
), ),
), ),
CupertinoButton.filled( CupertinoButton.filled(
child: Text('Submit'), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onPressed: () async {
final slug = RepositorySlug(widget.owner, widget.name); final slug = RepositorySlug(widget.owner, widget.name);
final res = await context final res = await context

View File

@ -313,7 +313,7 @@ class GhRepoScreen extends StatelessWidget {
), ),
TableViewItem( TableViewItem(
leftIconData: Octicons.book, leftIconData: Octicons.book,
text: Text("Releases"), text: Text(AppLocalizations.of(context)!.releases),
url: '/github/$owner/$name/releases', url: '/github/$owner/$name/releases',
rightWidget: Text(repo.releases.totalCount.toString()), rightWidget: Text(repo.releases.totalCount.toString()),
), ),

View File

@ -6,6 +6,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GlIssueFormScreen extends StatefulWidget { class GlIssueFormScreen extends StatefulWidget {
final int id; final int id;
@ -24,14 +25,14 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context); final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context); final auth = Provider.of<AuthModel>(context);
return CommonScaffold( return CommonScaffold(
title: Text('Submit an issue'), title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Title', placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_title = v; _title = v;
@ -43,7 +44,7 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_body = v; _body = v;
@ -53,7 +54,7 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
), ),
), ),
CupertinoButton.filled( CupertinoButton.filled(
child: Text('Submit'), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onPressed: () async {
final res = await auth.fetchGitlab( final res = await auth.fetchGitlab(
'/projects/${widget.id}/issues', '/projects/${widget.id}/issues',

View File

@ -5,6 +5,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GtIssueCommentScreen extends StatefulWidget { class GtIssueCommentScreen extends StatefulWidget {
final String owner; final String owner;
@ -46,7 +47,7 @@ class _GtIssueCommentScreenState extends State<GtIssueCommentScreen> {
child: CupertinoTextField( child: CupertinoTextField(
controller: _controller, controller: _controller,
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
maxLines: 10, maxLines: 10,
), ),
), ),

View File

@ -6,6 +6,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GtIssueFormScreen extends StatefulWidget { class GtIssueFormScreen extends StatefulWidget {
final String owner; final String owner;
@ -25,14 +26,14 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context); final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context); final auth = Provider.of<AuthModel>(context);
return CommonScaffold( return CommonScaffold(
title: Text('Submit an issue'), title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Title', placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_title = v; _title = v;
@ -44,7 +45,7 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
padding: CommonStyle.padding, padding: CommonStyle.padding,
child: CupertinoTextField( child: CupertinoTextField(
style: TextStyle(color: theme.palette.text), style: TextStyle(color: theme.palette.text),
placeholder: 'Body', placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
_body = v; _body = v;
@ -54,7 +55,7 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
), ),
), ),
CupertinoButton.filled( CupertinoButton.filled(
child: Text('Submit'), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onPressed: () async {
await auth.fetchGitea( await auth.fetchGitea(
'/repos/${widget.owner}/${widget.name}/issues', '/repos/${widget.owner}/${widget.name}/issues',

View File

@ -27,34 +27,52 @@ class SettingsScreen extends StatelessWidget {
children: <Widget>[ children: <Widget>[
CommonStyle.verticalGap, CommonStyle.verticalGap,
TableView( TableView(
hasIcon: false, hasIcon: false,
headerText: AppLocalizations.of(context)!.system, headerText: AppLocalizations.of(context)!.system,
items: [ items: [
if (auth.activeAccount!.platform == PlatformType.github) ...[ if (auth.activeAccount!.platform == PlatformType.github) ...[
TableViewItem(
text: Text(AppLocalizations.of(context)!.githubStatus),
url: 'https://www.githubstatus.com/',
),
TableViewItem(
text: Text(AppLocalizations.of(context)!.reviewPermissions),
url:
'https://github.com/settings/connections/applications/$clientId',
rightWidget: Text(auth.activeAccount!.login),
),
],
if (auth.activeAccount!.platform == PlatformType.gitlab)
TableViewItem(
text: Text(AppLocalizations.of(context)!.gitlabStatus),
url: '${auth.activeAccount!.domain}/help',
rightWidget: FutureBuilder<String>(
future: auth
.fetchGitlab('/version')
.then((v) => v['version']),
builder: (context, snapshot) {
return Text(snapshot.data ?? '');
},
),
),
if (auth.activeAccount!.platform == PlatformType.gitea)
TableViewItem(
leftIconData: Octicons.info,
text: Text(AppLocalizations.of(context)!.giteaStatus),
url: '/gitea/status',
rightWidget: FutureBuilder<String>(
future:
auth.fetchGitea('/version').then((v) => v['version']),
builder: (context, snapshot) {
return Text(snapshot.data ?? '');
},
),
),
TableViewItem( TableViewItem(
text: Text(AppLocalizations.of(context)!.githubStatus), text: Text(AppLocalizations.of(context)!.switchAccounts),
url: 'https://www.githubstatus.com/', url: '/login',
),
TableViewItem(
text: Text(AppLocalizations.of(context)!.reviewPermissions),
url:
'https://github.com/settings/connections/applications/$clientId',
rightWidget: Text(auth.activeAccount!.login), rightWidget: Text(auth.activeAccount!.login),
), ),
],
if (auth.activeAccount!.platform == PlatformType.gitlab)
TableViewItem(
text: Text(AppLocalizations.of(context)!.gitlabStatus),
url: '${auth.activeAccount!.domain}/help',
rightWidget: FutureBuilder<String>(
future:
auth.fetchGitlab('/version').then((v) => v['version']),
builder: (context, snapshot) {
return Text(snapshot.data ?? '');
},
),
),
if (auth.activeAccount!.platform == PlatformType.gitea)
TableViewItem( TableViewItem(
leftIconData: Octicons.info, leftIconData: Octicons.info,
text: Text(AppLocalizations.of(context)!.giteaStatus), text: Text(AppLocalizations.of(context)!.giteaStatus),
@ -67,54 +85,53 @@ class SettingsScreen extends StatelessWidget {
}, },
), ),
), ),
TableViewItem( TableViewItem(
text: Text(AppLocalizations.of(context)!.switchAccounts), text: Text(AppLocalizations.of(context)!.switchAccounts),
url: '/login', url: '/login',
rightWidget: Text(auth.activeAccount!.login), rightWidget: Text(auth.activeAccount!.login),
), ),
TableViewItem( TableViewItem(
text: Text('App Language'), text: Text(AppLocalizations.of(context)!.appLanguage),
rightWidget: Text(theme.locale == null rightWidget: Text(theme.locale == null
? AppLocalizations.of(context)!.followSystem ? AppLocalizations.of(context)!.followSystem
: localeNameMap[theme.locale!] ?? theme.locale!), : localeNameMap[theme.locale!] ?? theme.locale!),
onTap: () { onTap: () {
theme.showActions(context, [ theme.showActions(context, [
for (final key in [ for (final key in [
null, null,
...AppLocalizations.supportedLocales ...AppLocalizations.supportedLocales
.map((l) => l.toString()) .map((l) => l.toString())
.where((key) => localeNameMap[key] != null) .where((key) => localeNameMap[key] != null)
]) ])
ActionItem( ActionItem(
text: key == null text: key == null
? AppLocalizations.of(context)!.followSystem ? AppLocalizations.of(context)!.followSystem
: localeNameMap[key], : localeNameMap[key],
onTap: (_) async { onTap: (_) async {
final res = await theme.showConfirm( final res = await theme.showConfirm(
context, context,
Text( Text(
'The app will reload to make the language setting take effect'), 'The app will reload to make the language setting take effect'),
); );
if (res == true && theme.locale != key) { if (res == true && theme.locale != key) {
await theme.setLocale(key); await theme.setLocale(key);
auth.reloadApp(); auth.reloadApp();
} }
}, },
) )
]); ]);
}, },
) )
], ]),
),
CommonStyle.verticalGap, CommonStyle.verticalGap,
TableView(headerText: 'theme', items: [ TableView(headerText: AppLocalizations.of(context)!.theme, items: [
TableViewItem( TableViewItem(
text: Text(AppLocalizations.of(context)!.brightness), text: Text(AppLocalizations.of(context)!.brightness),
rightWidget: Text(theme.brighnessValue == AppBrightnessType.light rightWidget: Text(theme.brighnessValue == AppBrightnessType.light
? 'Light' ? AppLocalizations.of(context)!.light
: theme.brighnessValue == AppBrightnessType.dark : theme.brighnessValue == AppBrightnessType.dark
? 'Dark' ? AppLocalizations.of(context)!.dark
: 'Follow system'), : AppLocalizations.of(context)!.followSystem),
onTap: () { onTap: () {
theme.showActions(context, [ theme.showActions(context, [
for (var t in [ for (var t in [

View File

@ -9,6 +9,7 @@ import 'package:timeago/timeago.dart' as timeago;
import 'avatar.dart'; import 'avatar.dart';
import '../widgets/link.dart'; import '../widgets/link.dart';
import '../utils/utils.dart'; import '../utils/utils.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class EventItem extends StatelessWidget { class EventItem extends StatelessWidget {
final GithubEvent e; final GithubEvent e;
@ -104,7 +105,8 @@ class EventItem extends StatelessWidget {
style: TextStyle(color: theme.palette.primary), style: TextStyle(color: theme.palette.primary),
) )
], ],
card: Text('Woops, ${e.type} not implemented yet'), card: Text(
'${e.type} ${AppLocalizations.of(context)!.timelineTypeNotImplemented}'),
); );
} }
@ -126,8 +128,8 @@ class EventItem extends StatelessWidget {
style: TextStyle(color: theme.palette.text, fontSize: 15), style: TextStyle(color: theme.palette.text, fontSize: 15),
children: [ children: [
TextSpan( TextSpan(
text: e.payload!.commits!.length.toString() + text:
' commits to '), '${AppLocalizations.of(context)!.nCommitsTo(e.payload!.commits!.length)} '),
WidgetSpan( WidgetSpan(
child: PrimerBranchName( child: PrimerBranchName(
e.payload!.ref!.replaceFirst('refs/heads/', '')), e.payload!.ref!.replaceFirst('refs/heads/', '')),
@ -302,7 +304,7 @@ class EventItem extends StatelessWidget {
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan( TextSpan(
text: text:
' ${e.payload!.action} a check run for ${e.payload!.checkRun!.name} '), '${AppLocalizations.of(context)!.checkRunEventMessage(e.payload!.action!, e.payload!.checkRun!.name!)} '),
]); ]);
case 'CheckSuiteEvent': case 'CheckSuiteEvent':
// Needs checks permission // Needs checks permission
@ -310,16 +312,19 @@ class EventItem extends StatelessWidget {
switch (e.payload!.checkSuite!.conclusion) { switch (e.payload!.checkSuite!.conclusion) {
case 'success': case 'success':
case 'failure': case 'failure':
conclusion = 'it is a ' + e.payload!.checkSuite!.conclusion!; conclusion =
'${AppLocalizations.of(context)!.checkSuiteEventConclusionMessage(e.payload!.checkSuite!.conclusion!)} ';
break; break;
case 'neutral': case 'neutral':
case 'cancelled': case 'cancelled':
case 'timed_out': case 'timed_out':
case 'stale': case 'stale':
conclusion = 'it is ' + e.payload!.checkSuite!.conclusion!; conclusion =
'${AppLocalizations.of(context)!.checkSuiteEventConclusionMessage(e.payload!.checkSuite!.conclusion!)} ';
break; break;
case 'action_required': case 'action_required':
conclusion = ' it requires more action'; conclusion =
' ${AppLocalizations.of(context)!.actionRequiredConclusion}';
break; break;
} }
return _buildItem( return _buildItem(
@ -327,22 +332,25 @@ class EventItem extends StatelessWidget {
spans: [ spans: [
TextSpan( TextSpan(
text: text:
' ${e.payload!.action} the check suite and the conclusion is that $conclusion'), ' ${AppLocalizations.of(context)!.checkSuiteEventMessage(e.payload!.action!)} $conclusion'),
], ],
); );
case 'CommitCommentEvent': case 'CommitCommentEvent':
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' commented on a commit '), TextSpan(
TextSpan(text: ' at '), text:
' ${AppLocalizations.of(context)!.commitCommentEventMessage} '),
_buildRepo(context), _buildRepo(context),
], ],
card: _buildCommitCommentCard(context), card: _buildCommitCommentCard(context),
); );
case 'ContentReferenceEvent': case 'ContentReferenceEvent':
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan(text: ' ${e.payload!.action} a content reference at '), TextSpan(
text:
' ${AppLocalizations.of(context)!.contentReferenceEventMessage(e.payload!.action!)} '),
_buildLinkSpan(context, e.payload!.contentReference!.reference, _buildLinkSpan(context, e.payload!.contentReference!.reference,
e.payload!.contentReference!.reference), e.payload!.contentReference!.reference),
]); ]);
@ -350,10 +358,9 @@ class EventItem extends StatelessWidget {
return _buildItem( return _buildItem(
context: context, context: context,
spans: <InlineSpan>[ spans: <InlineSpan>[
TextSpan(text: ' created a ${e.payload!.refType}'),
TextSpan( TextSpan(
text: text:
'${e.payload!.ref == null ? '' : ' ' + e.payload!.ref! + ' at'} '), ' ${AppLocalizations.of(context)!.createdEventMessage(e.payload!.refType!, e.payload!.ref ?? '')}'),
_buildRepo(context), _buildRepo(context),
], ],
); );
@ -361,10 +368,9 @@ class EventItem extends StatelessWidget {
return _buildItem( return _buildItem(
context: context, context: context,
spans: <InlineSpan>[ spans: <InlineSpan>[
TextSpan(text: ' deleted the ${e.payload!.refType}'),
TextSpan( TextSpan(
text: text:
'${e.payload!.ref == null ? '' : ' ' + e.payload!.ref! + ' at'} '), ' ${AppLocalizations.of(context)!.deletedEventMessage(e.payload!.refType!, e.payload!.ref ?? '')}'),
_buildRepo(context), _buildRepo(context),
], ],
); );
@ -374,9 +380,9 @@ class EventItem extends StatelessWidget {
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' forked '), TextSpan(text: ' ${AppLocalizations.of(context)!.forked} '),
_buildRepo(context, '$forkeeOwner/$forkeeName'), _buildRepo(context, '$forkeeOwner/$forkeeName'),
TextSpan(text: ' from '), TextSpan(text: ' ${AppLocalizations.of(context)!.from} '),
_buildRepo(context), _buildRepo(context),
], ],
); );
@ -391,10 +397,12 @@ class EventItem extends StatelessWidget {
} }
} }
if (pageNamesCreated.length > 0) { if (pageNamesCreated.length > 0) {
pageNamesCreated = " created the pages: \n" + pageNamesCreated + "\n"; pageNamesCreated =
" ${AppLocalizations.of(context)!.createdPages(pageNamesCreated)}";
} }
if (pageNamesEdited.length > 0) { if (pageNamesEdited.length > 0) {
pageNamesEdited = " edited the pages: \n" + pageNamesEdited + "\n"; pageNamesEdited =
" ${AppLocalizations.of(context)!.editedPages(pageNamesEdited)}";
} }
return _buildItem( return _buildItem(
@ -403,14 +411,14 @@ class EventItem extends StatelessWidget {
case 'InstallationEvent': case 'InstallationEvent':
String? action = e.payload!.action; String? action = e.payload!.action;
if (action == 'new_permissions_accepted') { if (action == 'new_permissions_accepted') {
action = "new permission were accepted for"; action = "${AppLocalizations.of(context)!.newPermissionsAccepted}";
} }
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan( TextSpan(
text: text:
' $action for the Github App with id ${e.payload!.installation!.id}'), ' $action ${AppLocalizations.of(context)!.forGithubAppWithId(e.payload!.installation!.id.toString())}'),
], ],
); );
case 'InstallationRepositoriesEvent': case 'InstallationRepositoriesEvent':
@ -428,17 +436,17 @@ class EventItem extends StatelessWidget {
} }
String finalListOfRepos = ""; String finalListOfRepos = "";
if (addedRepos != "") { if (addedRepos != "") {
finalListOfRepos += addedRepos + " were added to\n "; finalListOfRepos +=
"${AppLocalizations.of(context)!.wereAddedTo(addedRepos, e.payload!.installation!.id.toString())}\n ";
} }
if (removedRepos != "") { if (removedRepos != "") {
finalListOfRepos += removedRepos + " were removed from"; finalListOfRepos += removedRepos +
" ${AppLocalizations.of(context)!.wereRemovedFrom(removedRepos, e.payload!.installation!.id.toString())}";
} }
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan( TextSpan(text: '$finalListOfRepos'),
text:
' $finalListOfRepos the installation id ${e.payload!.installation!.id} '),
], ],
); );
case 'IssueCommentEvent': case 'IssueCommentEvent':
@ -447,13 +455,13 @@ class EventItem extends StatelessWidget {
spans: [ spans: [
TextSpan( TextSpan(
text: text:
' commented on ${e.payload!.issue!.isPullRequestComment ? 'pull request' : 'issue'} '), ' ${AppLocalizations.of(context)!.commentedOn} ${e.payload!.issue!.isPullRequestComment ? 'pull request' : 'issue'} '),
_buildIssue( _buildIssue(
context, context,
e.payload!.issue!.number, e.payload!.issue!.number,
isPullRequest: e.payload!.issue!.isPullRequestComment, isPullRequest: e.payload!.issue!.isPullRequestComment,
), ),
TextSpan(text: ' at '), TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context), _buildRepo(context),
], ],
card: _buildIssueCard( card: _buildIssueCard(
@ -468,9 +476,11 @@ class EventItem extends StatelessWidget {
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' ${e.payload!.action} issue '), TextSpan(
text:
' ${e.payload!.action} ${AppLocalizations.of(context)!.issue} '),
_buildIssue(context, issue.number), _buildIssue(context, issue.number),
TextSpan(text: ' at '), TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context), _buildRepo(context),
], ],
card: _buildIssueCard(context, issue, issue.body), card: _buildIssueCard(context, issue, issue.body),
@ -480,19 +490,24 @@ class EventItem extends StatelessWidget {
var messageToDisplay; var messageToDisplay;
switch (action) { switch (action) {
case "purchased": case "purchased":
messageToDisplay = "purchased a Marketplace Plan"; messageToDisplay =
AppLocalizations.of(context)!.purchasedMarketplacePlan;
break; break;
case "cancelled": case "cancelled":
messageToDisplay = "cancelled their Marketplace Plan"; messageToDisplay =
AppLocalizations.of(context)!.cancelledMarketplacePlan;
break; break;
case "pending_change": case "pending_change":
messageToDisplay = " Marketplace Plan is pending change"; messageToDisplay =
AppLocalizations.of(context)!.pendingMarketplacePlan;
break; break;
case "pending_change_cancelled": case "pending_change_cancelled":
messageToDisplay = " Pending Marketplace Plan was cancelled"; messageToDisplay =
AppLocalizations.of(context)!.pendingChangeCancelled;
break; break;
case "changed": case "changed":
messageToDisplay = " changed their Marketplace Plan"; messageToDisplay =
AppLocalizations.of(context)!.changedMarketplacePlan;
break; break;
} }
return _buildItem( return _buildItem(
@ -511,21 +526,22 @@ class EventItem extends StatelessWidget {
spans: [ spans: [
TextSpan( TextSpan(
text: text:
' was ${e.payload!.action} ${action == 'added' ? 'to' : 'from'} '), ' ${AppLocalizations.of(context)!.was} ${e.payload!.action} ${action == 'added' ? AppLocalizations.of(context)!.to : AppLocalizations.of(context)!.from} '),
_buildRepo(context), _buildRepo(context),
], ],
); );
case 'ProjectCardEvent': case 'ProjectCardEvent':
String? action = e.payload!.action; String? action = e.payload!.action;
if (action == 'converted') { if (action == 'converted') {
action = ' converted the project card into an issue '; action = ' ${AppLocalizations.of(context)!.convertProjectCard} ';
} else { } else {
action = action! + ' the project card '; action =
action! + ' ${AppLocalizations.of(context)!.theProjectCard} ';
} }
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' $action at '), TextSpan(text: ' $action ${AppLocalizations.of(context)!.at} '),
_buildRepo(context), _buildRepo(context),
], ],
); );
@ -533,22 +549,22 @@ class EventItem extends StatelessWidget {
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan( TextSpan(
text: text:
' ${e.payload!.action} the project column ${e.payload!.projectColumn!.name} at '), ' ${AppLocalizations.of(context)!.projectColumnEventMessage(e.payload!.action!, e.payload!.projectColumn!.name!)} '),
_buildRepo(context), _buildRepo(context),
]); ]);
case 'ProjectEvent': case 'ProjectEvent':
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan( TextSpan(
text: text:
' ${e.payload!.action} the project ${e.payload!.project!.name} '), ' ${AppLocalizations.of(context)!.projectEventMessage(e.payload!.action!, e.payload!.project!.name!)}} '),
]); ]);
case 'PublicEvent': case 'PublicEvent':
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' made '), TextSpan(text: ' ${AppLocalizations.of(context)!.made} '),
_buildRepo(context), _buildRepo(context),
TextSpan(text: ' public'), TextSpan(text: ' ${AppLocalizations.of(context)!.public}'),
], ],
); );
case 'PullRequestEvent': case 'PullRequestEvent':
@ -556,9 +572,11 @@ class EventItem extends StatelessWidget {
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' ${e.payload!.action} pull request '), TextSpan(
text:
' ${AppLocalizations.of(context)!.pullRequestEventMessage(e.payload!.action!)} '),
_buildIssue(context, pr.number, isPullRequest: true), _buildIssue(context, pr.number, isPullRequest: true),
TextSpan(text: ' at '), TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context), _buildRepo(context),
], ],
card: _buildIssueCard(context, pr, pr.body, isPullRequest: true), card: _buildIssueCard(context, pr, pr.body, isPullRequest: true),
@ -566,9 +584,11 @@ class EventItem extends StatelessWidget {
case 'PullRequestReviewEvent': case 'PullRequestReviewEvent':
final pr = e.payload!.pullRequest!; final pr = e.payload!.pullRequest!;
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan(text: ' ${e.payload!.action} the pull request review '), TextSpan(
text:
' ${AppLocalizations.of(context)!.pullRequestReviewEventMessage(e.payload!.action!)} '),
_buildIssue(context, pr.number, isPullRequest: true), _buildIssue(context, pr.number, isPullRequest: true),
TextSpan(text: ' at '), TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context), _buildRepo(context),
]); ]);
case 'PullRequestReviewCommentEvent': case 'PullRequestReviewCommentEvent':
@ -576,9 +596,11 @@ class EventItem extends StatelessWidget {
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' reviewed pull request '), TextSpan(
text:
' ${AppLocalizations.of(context)!.pullRequestReviewCommentEventMessage} '),
_buildIssue(context, pr.number, isPullRequest: true), _buildIssue(context, pr.number, isPullRequest: true),
TextSpan(text: ' at '), TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context), _buildRepo(context),
], ],
card: _buildIssueCard(context, pr, e.payload!.comment!.body, card: _buildIssueCard(context, pr, e.payload!.comment!.body,
@ -587,14 +609,17 @@ class EventItem extends StatelessWidget {
case 'PushEvent': case 'PushEvent':
return _buildItem( return _buildItem(
context: context, context: context,
spans: [TextSpan(text: ' pushed to '), _buildRepo(context)], spans: [
TextSpan(text: ' ${AppLocalizations.of(context)!.pushedTo} '),
_buildRepo(context)
],
card: _buildCommitsCard(context), card: _buildCommitsCard(context),
); );
case 'ReleaseEvent': case 'ReleaseEvent':
return _buildItem( return _buildItem(
context: context, context: context,
spans: [ spans: [
TextSpan(text: ' released '), TextSpan(text: '${AppLocalizations.of(context)!.released} '),
_buildLinkSpan(context, e.payload!.release!.tagName, _buildLinkSpan(context, e.payload!.release!.tagName,
e.payload!.release!.htmlUrl), e.payload!.release!.htmlUrl),
TextSpan(text: ' at '), TextSpan(text: ' at '),
@ -607,20 +632,23 @@ class EventItem extends StatelessWidget {
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan( TextSpan(
text: text:
' Security alert involving the package ${e.payload!.alert!.affectedPackageName} between versions ${e.payload!.alert!.affectedRange} was {e.payload.action}ed', ' ${AppLocalizations.of(context)!.securityAlertInvolvingPackage(e.payload!.alert!.affectedPackageName!, e.payload!.alert!.affectedRange!, e.payload!.action!)}',
) )
]); ]);
case 'SecurityAdvisoryEvent': case 'SecurityAdvisoryEvent':
return _buildItem(context: context, spans: [ return _buildItem(context: context, spans: [
TextSpan( TextSpan(
text: text:
' Security advisory regarding ${e.payload!.securityAdvisory!.summary} was ${e.payload!.action} ', ' ${AppLocalizations.of(context)!.securityAdvisory(e.payload!.securityAdvisory!.summary!, e.payload!.action!)} ',
) )
]); ]);
case 'WatchEvent': case 'WatchEvent':
return _buildItem( return _buildItem(
context: context, context: context,
spans: [TextSpan(text: ' starred '), _buildRepo(context)], spans: [
TextSpan(text: ' ${AppLocalizations.of(context)!.starred} '),
_buildRepo(context)
],
); );
default: default:
return _buildDefaultItem(context); return _buildDefaultItem(context);

View File

@ -8,6 +8,7 @@ import 'package:git_touch/widgets/markdown_view.dart';
import 'package:git_touch/widgets/table_view.dart'; import 'package:git_touch/widgets/table_view.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:timeago/timeago.dart' as timeago; import 'package:timeago/timeago.dart' as timeago;
import 'package:flutter_gen/gen_l10n/S.dart';
class ReleaseItem extends StatelessWidget { class ReleaseItem extends StatelessWidget {
final String? login; final String? login;
@ -61,8 +62,9 @@ class ReleaseItem extends StatelessWidget {
color: theme.palette.secondaryText, color: theme.palette.secondaryText,
fontSize: 16, fontSize: 16,
), ),
child: Text( child: Text(login! +
login! + " released " + timeago.format(publishedAt!)), " ${AppLocalizations.of(context)!.released} " +
timeago.format(publishedAt!)),
), ),
], ],
), ),

View File

@ -8,6 +8,7 @@ import 'package:git_touch/widgets/label.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../utils/utils.dart'; import '../utils/utils.dart';
import 'comment_item.dart'; import 'comment_item.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
TextSpan createUserSpan(BuildContext context, String? login) { TextSpan createUserSpan(BuildContext context, String? login) {
return createLinkSpan(context, login, '/github/$login'); return createLinkSpan(context, login, '/github/$login');
@ -57,12 +58,14 @@ class TimelineItem extends StatelessWidget {
final dynamic node; final dynamic node;
TimelineItem(this.node); TimelineItem(this.node);
Widget _buildFallback(String? type) { Widget _buildFallback(String? type, BuildContext context) {
return TimelineEventItem( return TimelineEventItem(
actor: '', actor: '',
iconData: Octicons.octoface, iconData: Octicons.octoface,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: 'Woops, $type type not implemented yet'), TextSpan(
text:
'$type ${AppLocalizations.of(context)!.timelineTypeNotImplemented}'),
]), ]),
); );
} }
@ -78,8 +81,9 @@ class TimelineItem extends StatelessWidget {
actor: p.commit.author!.user?.login, actor: p.commit.author!.user?.login,
iconData: Octicons.git_commit, iconData: Octicons.git_commit,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' added commit '), TextSpan(
TextSpan(text: p.commit.oid.substring(0, 8)) text:
' ${AppLocalizations.of(context)!.pullRequestCommitMessage(p.commit.oid.substring(0, 8))} '),
]), ]),
); );
case 'IssueComment': case 'IssueComment':
@ -97,7 +101,9 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.primitive_dot, iconData: Octicons.primitive_dot,
iconColor: GithubPalette.open, iconColor: GithubPalette.open,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' referenced this on '), TextSpan(
text:
' ${AppLocalizations.of(context)!.crossReferencedEventMessage} '),
createLinkSpan(context, '$owner/$name#$number', createLinkSpan(context, '$owner/$name#$number',
'/github/$owner/$name/$prefix/$number'), '/github/$owner/$name/$prefix/$number'),
]), ]),
@ -108,7 +114,8 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.circle_slash, iconData: Octicons.circle_slash,
iconColor: GithubPalette.closed, iconColor: GithubPalette.closed,
textSpan: TextSpan(text: ' closed this '), textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.closedEventMessage} '),
); );
case 'ReopenedEvent': case 'ReopenedEvent':
@ -117,19 +124,24 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.primitive_dot, iconData: Octicons.primitive_dot,
iconColor: GithubPalette.open, iconColor: GithubPalette.open,
textSpan: TextSpan(text: ' reopened this '), textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.reopenedEventMessage} '),
); );
case 'SubscribedEvent': case 'SubscribedEvent':
final p = node as GSubscribedEventParts; final p = node as GSubscribedEventParts;
return TimelineEventItem( return TimelineEventItem(
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan(text: ' subscribed to this issue '), textSpan: TextSpan(
text:
' ${AppLocalizations.of(context)!.subscribedEventMessage} '),
); );
case 'UnsubscribedEvent': case 'UnsubscribedEvent':
final p = node as GUnsubscribedEventParts; final p = node as GUnsubscribedEventParts;
return TimelineEventItem( return TimelineEventItem(
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan(text: ' unsubscribed from this issue '), textSpan: TextSpan(
text:
' ${AppLocalizations.of(context)!.unsubscribedEventMessage} '),
); );
case 'ReferencedEvent': case 'ReferencedEvent':
final p = node as GReferencedEventParts; final p = node as GReferencedEventParts;
@ -142,9 +154,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.bookmark, iconData: Octicons.bookmark,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' referenced this pull request from commit '), TextSpan(
TextSpan(text: p.commit!.oid.substring(0, 8)), text:
TextSpan(text: ' from ' + p.commitRepository.name), ' ${AppLocalizations.of(context)!.referencedEventMessage(p.commit!.oid.substring(0, 8), p.commitRepository.name)} '),
]), ]),
); );
} }
@ -152,8 +164,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.bookmark, iconData: Octicons.bookmark,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' referenced this pull request from commit '), TextSpan(
TextSpan(text: p.commit!.oid.substring(0, 8)), text:
' ${AppLocalizations.of(context)!.referencedEventMessage(p.commit!.oid.substring(0, 8), '')} '),
]), ]),
); );
case 'AssignedEvent': case 'AssignedEvent':
@ -163,7 +176,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.key, iconData: Octicons.key,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' assigned this to '), TextSpan(
text:
' ${AppLocalizations.of(context)!.assignedEventMessage} '),
createLinkSpan(context, assignee, '/github/$assignee'), createLinkSpan(context, assignee, '/github/$assignee'),
]), ]),
); );
@ -174,7 +189,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.key, iconData: Octicons.key,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' unassigned this from '), TextSpan(
text:
' ${AppLocalizations.of(context)!.unassignedEventMessage} '),
createLinkSpan(context, assignee, '/github/$assignee') createLinkSpan(context, assignee, '/github/$assignee')
]), ]),
); );
@ -184,10 +201,10 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.tag, iconData: Octicons.tag,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' added '), TextSpan(text: ' ${AppLocalizations.of(context)!.added} '),
WidgetSpan( WidgetSpan(
child: MyLabel(name: p.label.name, cssColor: p.label.color)), child: MyLabel(name: p.label.name, cssColor: p.label.color)),
TextSpan(text: ' label'), TextSpan(text: ' ${AppLocalizations.of(context)!.label}'),
]), ]),
); );
case 'UnlabeledEvent': case 'UnlabeledEvent':
@ -196,10 +213,10 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.tag, iconData: Octicons.tag,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' removed '), TextSpan(text: ' ${AppLocalizations.of(context)!.removed} '),
WidgetSpan( WidgetSpan(
child: MyLabel(name: p.label.name, cssColor: p.label.color)), child: MyLabel(name: p.label.name, cssColor: p.label.color)),
TextSpan(text: ' label'), TextSpan(text: ' ${AppLocalizations.of(context)!.label}'),
]), ]),
); );
case 'MilestonedEvent': case 'MilestonedEvent':
@ -208,9 +225,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.milestone, iconData: Octicons.milestone,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' added this to '), TextSpan(
TextSpan(text: p.milestoneTitle), text:
TextSpan(text: ' milestone'), ' ${AppLocalizations.of(context)!.milestonedEventMessage(p.milestoneTitle)} '),
]), ]),
); );
case 'DemilestonedEvent': case 'DemilestonedEvent':
@ -219,9 +236,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.milestone, iconData: Octicons.milestone,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' removed this from '), TextSpan(
TextSpan(text: p.milestoneTitle), text:
TextSpan(text: ' milestone'), ' ${AppLocalizations.of(context)!.demilestonedEventMessage(p.milestoneTitle)} '),
]), ]),
); );
case 'RenamedTitleEvent': case 'RenamedTitleEvent':
@ -230,13 +247,13 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.pencil, iconData: Octicons.pencil,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' changed the title '), TextSpan(
text:
' ${AppLocalizations.of(context)!.renamedTitleEventMessage(p.currentTitle)} '),
TextSpan( TextSpan(
text: p.previousTitle, text: p.previousTitle,
style: TextStyle(decoration: TextDecoration.lineThrough), style: TextStyle(decoration: TextDecoration.lineThrough),
), ),
TextSpan(text: ' to '),
TextSpan(text: p.currentTitle)
]), ]),
); );
case 'LockedEvent': case 'LockedEvent':
@ -245,7 +262,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.lock, iconData: Octicons.lock,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' locked this conversation '), TextSpan(
text:
' ${AppLocalizations.of(context)!.lockedConversationEventMessage} '),
]), ]),
); );
case 'UnlockedEvent': case 'UnlockedEvent':
@ -254,7 +273,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.key, iconData: Octicons.key,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' unlocked this conversation '), TextSpan(
text:
' ${AppLocalizations.of(context)!.unlockedConversationEventMessage} '),
]), ]),
); );
case 'TransferredEvent': case 'TransferredEvent':
@ -265,14 +286,14 @@ class TimelineItem extends StatelessWidget {
children: [ children: [
TextSpan( TextSpan(
text: text:
' transferred this issue from ' + p.fromRepository!.name) ' ${AppLocalizations.of(context)!.transferredEventMessage(p.fromRepository!.name)} ')
], ],
), ),
); );
// pull request only types // pull request only types
case 'CommitCommentThread': case 'CommitCommentThread':
return _buildFallback(type); // TODO: return _buildFallback(type, context); // TODO:
case 'PullRequestReview': case 'PullRequestReview':
final p = node as GPullRequestReviewParts; final p = node as GPullRequestReviewParts;
return Column( return Column(
@ -282,9 +303,12 @@ class TimelineItem extends StatelessWidget {
iconColor: GithubPalette.open, iconColor: GithubPalette.open,
iconData: Octicons.check, iconData: Octicons.check,
textSpan: p.state == GPullRequestReviewState.APPROVED textSpan: p.state == GPullRequestReviewState.APPROVED
? TextSpan(text: ' approved these changes') ? TextSpan(
text:
' ${AppLocalizations.of(context)!.approvedChanges}')
: p.state == GPullRequestReviewState.COMMENTED : p.state == GPullRequestReviewState.COMMENTED
? TextSpan(text: ' reviewed ') ? TextSpan(
text: ' ${AppLocalizations.of(context)!.reviewed} ')
: warningSpan), : warningSpan),
Container( Container(
padding: CommonStyle.padding.copyWith(left: 50), padding: CommonStyle.padding.copyWith(left: 50),
@ -299,7 +323,7 @@ class TimelineItem extends StatelessWidget {
); );
case 'PullRequestReviewThread': case 'PullRequestReviewThread':
case 'PullRequestReviewComment': case 'PullRequestReviewComment':
return _buildFallback(type); // TODO: return _buildFallback(type, context); // TODO:
case 'MergedEvent': case 'MergedEvent':
final p = node as GMergedEventParts; final p = node as GMergedEventParts;
return TimelineEventItem( return TimelineEventItem(
@ -307,10 +331,9 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.git_merge, iconData: Octicons.git_merge,
iconColor: GithubPalette.merged, iconColor: GithubPalette.merged,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' merged commit '), TextSpan(
TextSpan(text: p.commit!.oid.substring(0, 8)), text:
TextSpan(text: ' into '), ' ${AppLocalizations.of(context)!.mergedEventMessage(p.commit!.oid.substring(0, 8), p.mergeRefName)} '),
TextSpan(text: p.mergeRefName),
]), ]),
); );
case 'MentionedEvent': case 'MentionedEvent':
@ -318,14 +341,16 @@ class TimelineItem extends StatelessWidget {
return TimelineEventItem( return TimelineEventItem(
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.bookmark, iconData: Octicons.bookmark,
textSpan: TextSpan(text: ' was mentioned '), textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.mentionedEventMessage} '),
); );
case 'PinnedEvent': case 'PinnedEvent':
final p = node as GPinnedEventParts; final p = node as GPinnedEventParts;
return TimelineEventItem( return TimelineEventItem(
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.pin, iconData: Octicons.pin,
textSpan: TextSpan(text: ' pinned this issue '), textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.pinnedEventMessage} '),
); );
case 'DeployedEvent': case 'DeployedEvent':
final p = node as GDeployedEventParts; final p = node as GDeployedEventParts;
@ -333,15 +358,15 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan( textSpan: TextSpan(
text: text:
' deployed the pull request ' + p.pullRequest.headRef!.name), ' ${AppLocalizations.of(context)!.deployedPR(p.pullRequest.headRef!.name)} '),
); );
case 'DeploymentEnvironmentChangedEvent': case 'DeploymentEnvironmentChangedEvent':
final p = node as GDeploymentEnvironmentChangedEventParts; final p = node as GDeploymentEnvironmentChangedEventParts;
return TimelineEventItem( return TimelineEventItem(
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan( textSpan: TextSpan(
text: ' changed the deployment environment to ' + text:
p.deploymentStatus.deployment.environment!), ' ${AppLocalizations.of(context)!.deploymentEnvironmentChangedEventMessage(p.deploymentStatus.deployment.environment!)} '),
); );
case 'HeadRefDeletedEvent': case 'HeadRefDeletedEvent':
final p = node as GHeadRefDeletedEventParts; final p = node as GHeadRefDeletedEventParts;
@ -349,9 +374,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
iconData: Octicons.git_branch, iconData: Octicons.git_branch,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' deleted the '), TextSpan(
TextSpan(text: p.headRefName), text:
TextSpan(text: ' branch'), ' ${AppLocalizations.of(context)!.headRefDeletedEventMessage(p.headRefName)} '),
]), ]),
); );
case 'HeadRefRestoredEvent': case 'HeadRefRestoredEvent':
@ -359,9 +384,9 @@ class TimelineItem extends StatelessWidget {
return TimelineEventItem( return TimelineEventItem(
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' restored the '), TextSpan(
WidgetSpan(child: PrimerBranchName(p.pullRequest.headRefName)), text:
TextSpan(text: ' branch') ' ${AppLocalizations.of(context)!.headRefRestoredEventMessage(p.pullRequest.headRefName)} '),
]), ]),
); );
case 'HeadRefForcePushedEvent': case 'HeadRefForcePushedEvent':
@ -371,14 +396,18 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan( textSpan: TextSpan(
children: [ children: [
TextSpan(text: ' force-pushed the '), TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventFirstMessage} '),
WidgetSpan(child: PrimerBranchName(p.pullRequest.headRefName)), WidgetSpan(child: PrimerBranchName(p.pullRequest.headRefName)),
TextSpan(text: ' branch from '), TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventSecondMessage} '),
TextSpan( TextSpan(
text: p.beforeCommit!.oid.substring(0, 7), text: p.beforeCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary), style: TextStyle(color: theme.palette.primary),
), ),
TextSpan(text: ' to '), TextSpan(text: ' ${AppLocalizations.of(context)!.to} '),
TextSpan( TextSpan(
text: p.afterCommit!.oid.substring(0, 7), text: p.afterCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary), style: TextStyle(color: theme.palette.primary),
@ -393,14 +422,18 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan( textSpan: TextSpan(
children: [ children: [
TextSpan(text: ' force-pushed the '), TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventFirstMessage} '),
WidgetSpan(child: PrimerBranchName(p.pullRequest.baseRef!.name)), WidgetSpan(child: PrimerBranchName(p.pullRequest.baseRef!.name)),
TextSpan(text: ' branch from '), TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventSecondMessage} '),
TextSpan( TextSpan(
text: p.beforeCommit!.oid.substring(0, 7), text: p.beforeCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary), style: TextStyle(color: theme.palette.primary),
), ),
TextSpan(text: ' to '), TextSpan(text: ' ${AppLocalizations.of(context)!.to} '),
TextSpan( TextSpan(
text: p.afterCommit!.oid.substring(0, 7), text: p.afterCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary), style: TextStyle(color: theme.palette.primary),
@ -414,7 +447,9 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.eye, iconData: Octicons.eye,
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' requested a review from '), TextSpan(
text:
' ${AppLocalizations.of(context)!.reviewRequestEventMessage} '),
createUserSpan( createUserSpan(
context, context,
(p.requestedReviewer (p.requestedReviewer
@ -434,7 +469,8 @@ class TimelineItem extends StatelessWidget {
(p.requestedReviewer (p.requestedReviewer
as GReviewRequestRemovedEventParts_requestedReviewer__asUser) as GReviewRequestRemovedEventParts_requestedReviewer__asUser)
.login), .login),
TextSpan(text: ' from the review request '), TextSpan(
text: ' ${AppLocalizations.of(context)!.fromReviewRequest} '),
]), ]),
); );
case 'ReviewDismissedEvent': case 'ReviewDismissedEvent':
@ -443,12 +479,14 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.eye, iconData: Octicons.eye,
actor: p.actor!.login, actor: p.actor!.login,
textSpan: TextSpan(children: [ textSpan: TextSpan(children: [
TextSpan(text: ' dismissed the pull request review requested by '), TextSpan(
text:
' ${AppLocalizations.of(context)!.reviewDismissedEventMessage} '),
createUserSpan(context, p.pullRequest.author!.login), createUserSpan(context, p.pullRequest.author!.login),
]), ]),
); );
default: default:
return _buildFallback(type); return _buildFallback(type, context);
} }
} }