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": {
"description": "members of an organization"
},
"popularRepositories": "popular repositories",
"popularRepositories": "Popular Repositories",
"@popularRepositories": {
"description": "popular repositories"
},
"pinnedRepositories": "pinned repositories",
"pinnedRepositories": "Pinned Repositories",
"@pinnedRepositories": {
"description": "pinned repositories"
},
@ -75,11 +75,11 @@
"@settings": {
"description": "settings"
},
"system": "system",
"system": "System",
"@system": {
"description": "system"
},
"githubStatus": "GitHub status",
"githubStatus": "GitHub Status",
"@githubStatus": {
"description": "github status"
},
@ -87,15 +87,15 @@
"@reviewPermissions": {
"description": "review Permissions"
},
"gitlabStatus": "GitLab status",
"gitlabStatus": "GitLab Status",
"@gitlabStatus": {
"description": "GitLab status"
},
"giteaStatus": "Gitea status",
"giteaStatus": "Gitea Status",
"@giteaStatus": {
"description": "Gitea status"
},
"switchAccounts": "Switch accounts",
"switchAccounts": "Switch Accounts",
"@switchAccounts": {
"description": "Switch accounts"
},
@ -147,10 +147,14 @@
"@feedback": {
"description": "provide feedback"
},
"submitAnIssue": "Submit an issue",
"submitAnIssue": "Submit An Issue",
"@submitAnIssue": {
"description": "submit issue for app"
},
"submit": "Submit",
"@submit": {
"description": "submit button text"
},
"rateThisApp": "Rate This App",
"@rateThisApp": {
"description": "rate the app"
@ -159,7 +163,7 @@
"@email": {
"description": "Email to report issues"
},
"about": "about",
"about": "About",
"@about": {
"description": "about section"
},
@ -187,6 +191,10 @@
"@releases": {
"description": "releases"
},
"released": "released",
"@released": {
"description": "released"
},
"watchers": "Watchers",
"@watchers": {
"description": "watchers"
@ -199,7 +207,7 @@
"@issues": {
"description": "issues"
},
"pullRequests": "Pull requests",
"pullRequests": "Pull Requests",
"@pullRequests": {
"description": "Pull Requests"
},
@ -263,15 +271,15 @@
"@project": {
"description": "project"
},
"selectAccount": "Select account",
"selectAccount": "Select Account",
"@selectAccount": {
"description": "select account message"
},
"removeAccount": "Remove account",
"removeAccount": "Remove Account",
"@removeAccount": {
"description": "remove account"
},
"somethingBadHappens": "Something bad happens:",
"somethingBadHappens": "Something Bad Happens:",
"@somethingBadHappens": {
"description": "error message"
},
@ -346,5 +354,494 @@
"fontStyle": "FONT STYLE",
"@fontStyle": {
"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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class BbIssueCommentScreen extends StatefulWidget {
final String owner;
@ -31,7 +32,7 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) {
setState(() {
_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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class BbIssueFormScreen extends StatefulWidget {
final String owner;
@ -25,14 +26,14 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context);
return CommonScaffold(
title: Text('Submit an issue'),
title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column(
children: <Widget>[
Padding(
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Title',
placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) {
setState(() {
_title = v;
@ -44,7 +45,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) {
setState(() {
_body = v;
@ -54,7 +55,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
),
),
CupertinoButton.filled(
child: Text('Submit'),
child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async {
await auth.fetchBbJson(
'/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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GeIssueCommentScreen extends StatefulWidget {
final String owner;
@ -46,7 +47,7 @@ class _GeIssueCommentScreenState extends State<GeIssueCommentScreen> {
child: CupertinoTextField(
controller: _controller,
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GeIssueFormScreen extends StatefulWidget {
final String owner;
@ -25,14 +26,14 @@ class _GeIssueFormScreenState extends State<GeIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context);
return CommonScaffold(
title: Text('Submit an issue'),
title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column(
children: <Widget>[
Padding(
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Title',
placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) {
setState(() {
_title = v;
@ -44,7 +45,7 @@ class _GeIssueFormScreenState extends State<GeIssueFormScreen> {
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) {
setState(() {
_body = v;
@ -54,7 +55,7 @@ class _GeIssueFormScreenState extends State<GeIssueFormScreen> {
),
),
CupertinoButton.filled(
child: Text('Submit'),
child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async {
final res = await auth.fetchGitee(
'/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:github/github.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GhIssueFormScreen extends StatefulWidget {
final String owner;
@ -25,14 +26,14 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context);
return CommonScaffold(
title: Text('Submit an issue'),
title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column(
children: <Widget>[
Padding(
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Title',
placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) {
setState(() {
_title = v;
@ -44,7 +45,7 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) {
setState(() {
_body = v;
@ -54,7 +55,7 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
),
),
CupertinoButton.filled(
child: Text('Submit'),
child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async {
final slug = RepositorySlug(widget.owner, widget.name);
final res = await context

View File

@ -313,7 +313,7 @@ class GhRepoScreen extends StatelessWidget {
),
TableViewItem(
leftIconData: Octicons.book,
text: Text("Releases"),
text: Text(AppLocalizations.of(context)!.releases),
url: '/github/$owner/$name/releases',
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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GlIssueFormScreen extends StatefulWidget {
final int id;
@ -24,14 +25,14 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context);
return CommonScaffold(
title: Text('Submit an issue'),
title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column(
children: <Widget>[
Padding(
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Title',
placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) {
setState(() {
_title = v;
@ -43,7 +44,7 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) {
setState(() {
_body = v;
@ -53,7 +54,7 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
),
),
CupertinoButton.filled(
child: Text('Submit'),
child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async {
final res = await auth.fetchGitlab(
'/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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GtIssueCommentScreen extends StatefulWidget {
final String owner;
@ -46,7 +47,7 @@ class _GtIssueCommentScreenState extends State<GtIssueCommentScreen> {
child: CupertinoTextField(
controller: _controller,
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
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/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class GtIssueFormScreen extends StatefulWidget {
final String owner;
@ -25,14 +26,14 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
final theme = Provider.of<ThemeModel>(context);
final auth = Provider.of<AuthModel>(context);
return CommonScaffold(
title: Text('Submit an issue'),
title: Text(AppLocalizations.of(context)!.submitAnIssue),
body: Column(
children: <Widget>[
Padding(
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Title',
placeholder: AppLocalizations.of(context)!.title,
onChanged: (v) {
setState(() {
_title = v;
@ -44,7 +45,7 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
padding: CommonStyle.padding,
child: CupertinoTextField(
style: TextStyle(color: theme.palette.text),
placeholder: 'Body',
placeholder: AppLocalizations.of(context)!.body,
onChanged: (v) {
setState(() {
_body = v;
@ -54,7 +55,7 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
),
),
CupertinoButton.filled(
child: Text('Submit'),
child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async {
await auth.fetchGitea(
'/repos/${widget.owner}/${widget.name}/issues',

View File

@ -27,34 +27,52 @@ class SettingsScreen extends StatelessWidget {
children: <Widget>[
CommonStyle.verticalGap,
TableView(
hasIcon: false,
headerText: AppLocalizations.of(context)!.system,
items: [
if (auth.activeAccount!.platform == PlatformType.github) ...[
hasIcon: false,
headerText: AppLocalizations.of(context)!.system,
items: [
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(
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',
text: Text(AppLocalizations.of(context)!.switchAccounts),
url: '/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(
leftIconData: Octicons.info,
text: Text(AppLocalizations.of(context)!.giteaStatus),
@ -67,54 +85,53 @@ class SettingsScreen extends StatelessWidget {
},
),
),
TableViewItem(
text: Text(AppLocalizations.of(context)!.switchAccounts),
url: '/login',
rightWidget: Text(auth.activeAccount!.login),
),
TableViewItem(
text: Text('App Language'),
rightWidget: Text(theme.locale == null
? AppLocalizations.of(context)!.followSystem
: localeNameMap[theme.locale!] ?? theme.locale!),
onTap: () {
theme.showActions(context, [
for (final key in [
null,
...AppLocalizations.supportedLocales
.map((l) => l.toString())
.where((key) => localeNameMap[key] != null)
])
ActionItem(
text: key == null
? AppLocalizations.of(context)!.followSystem
: localeNameMap[key],
onTap: (_) async {
final res = await theme.showConfirm(
context,
Text(
'The app will reload to make the language setting take effect'),
);
if (res == true && theme.locale != key) {
await theme.setLocale(key);
auth.reloadApp();
}
},
)
]);
},
)
],
),
TableViewItem(
text: Text(AppLocalizations.of(context)!.switchAccounts),
url: '/login',
rightWidget: Text(auth.activeAccount!.login),
),
TableViewItem(
text: Text(AppLocalizations.of(context)!.appLanguage),
rightWidget: Text(theme.locale == null
? AppLocalizations.of(context)!.followSystem
: localeNameMap[theme.locale!] ?? theme.locale!),
onTap: () {
theme.showActions(context, [
for (final key in [
null,
...AppLocalizations.supportedLocales
.map((l) => l.toString())
.where((key) => localeNameMap[key] != null)
])
ActionItem(
text: key == null
? AppLocalizations.of(context)!.followSystem
: localeNameMap[key],
onTap: (_) async {
final res = await theme.showConfirm(
context,
Text(
'The app will reload to make the language setting take effect'),
);
if (res == true && theme.locale != key) {
await theme.setLocale(key);
auth.reloadApp();
}
},
)
]);
},
)
]),
CommonStyle.verticalGap,
TableView(headerText: 'theme', items: [
TableView(headerText: AppLocalizations.of(context)!.theme, items: [
TableViewItem(
text: Text(AppLocalizations.of(context)!.brightness),
rightWidget: Text(theme.brighnessValue == AppBrightnessType.light
? 'Light'
? AppLocalizations.of(context)!.light
: theme.brighnessValue == AppBrightnessType.dark
? 'Dark'
: 'Follow system'),
? AppLocalizations.of(context)!.dark
: AppLocalizations.of(context)!.followSystem),
onTap: () {
theme.showActions(context, [
for (var t in [

View File

@ -9,6 +9,7 @@ import 'package:timeago/timeago.dart' as timeago;
import 'avatar.dart';
import '../widgets/link.dart';
import '../utils/utils.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
class EventItem extends StatelessWidget {
final GithubEvent e;
@ -104,7 +105,8 @@ class EventItem extends StatelessWidget {
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),
children: [
TextSpan(
text: e.payload!.commits!.length.toString() +
' commits to '),
text:
'${AppLocalizations.of(context)!.nCommitsTo(e.payload!.commits!.length)} '),
WidgetSpan(
child: PrimerBranchName(
e.payload!.ref!.replaceFirst('refs/heads/', '')),
@ -302,7 +304,7 @@ class EventItem extends StatelessWidget {
return _buildItem(context: context, spans: [
TextSpan(
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':
// Needs checks permission
@ -310,16 +312,19 @@ class EventItem extends StatelessWidget {
switch (e.payload!.checkSuite!.conclusion) {
case 'success':
case 'failure':
conclusion = 'it is a ' + e.payload!.checkSuite!.conclusion!;
conclusion =
'${AppLocalizations.of(context)!.checkSuiteEventConclusionMessage(e.payload!.checkSuite!.conclusion!)} ';
break;
case 'neutral':
case 'cancelled':
case 'timed_out':
case 'stale':
conclusion = 'it is ' + e.payload!.checkSuite!.conclusion!;
conclusion =
'${AppLocalizations.of(context)!.checkSuiteEventConclusionMessage(e.payload!.checkSuite!.conclusion!)} ';
break;
case 'action_required':
conclusion = ' it requires more action';
conclusion =
' ${AppLocalizations.of(context)!.actionRequiredConclusion}';
break;
}
return _buildItem(
@ -327,22 +332,25 @@ class EventItem extends StatelessWidget {
spans: [
TextSpan(
text:
' ${e.payload!.action} the check suite and the conclusion is that $conclusion'),
' ${AppLocalizations.of(context)!.checkSuiteEventMessage(e.payload!.action!)} $conclusion'),
],
);
case 'CommitCommentEvent':
return _buildItem(
context: context,
spans: [
TextSpan(text: ' commented on a commit '),
TextSpan(text: ' at '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.commitCommentEventMessage} '),
_buildRepo(context),
],
card: _buildCommitCommentCard(context),
);
case 'ContentReferenceEvent':
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,
e.payload!.contentReference!.reference),
]);
@ -350,10 +358,9 @@ class EventItem extends StatelessWidget {
return _buildItem(
context: context,
spans: <InlineSpan>[
TextSpan(text: ' created a ${e.payload!.refType}'),
TextSpan(
text:
'${e.payload!.ref == null ? '' : ' ' + e.payload!.ref! + ' at'} '),
' ${AppLocalizations.of(context)!.createdEventMessage(e.payload!.refType!, e.payload!.ref ?? '')}'),
_buildRepo(context),
],
);
@ -361,10 +368,9 @@ class EventItem extends StatelessWidget {
return _buildItem(
context: context,
spans: <InlineSpan>[
TextSpan(text: ' deleted the ${e.payload!.refType}'),
TextSpan(
text:
'${e.payload!.ref == null ? '' : ' ' + e.payload!.ref! + ' at'} '),
' ${AppLocalizations.of(context)!.deletedEventMessage(e.payload!.refType!, e.payload!.ref ?? '')}'),
_buildRepo(context),
],
);
@ -374,9 +380,9 @@ class EventItem extends StatelessWidget {
return _buildItem(
context: context,
spans: [
TextSpan(text: ' forked '),
TextSpan(text: ' ${AppLocalizations.of(context)!.forked} '),
_buildRepo(context, '$forkeeOwner/$forkeeName'),
TextSpan(text: ' from '),
TextSpan(text: ' ${AppLocalizations.of(context)!.from} '),
_buildRepo(context),
],
);
@ -391,10 +397,12 @@ class EventItem extends StatelessWidget {
}
}
if (pageNamesCreated.length > 0) {
pageNamesCreated = " created the pages: \n" + pageNamesCreated + "\n";
pageNamesCreated =
" ${AppLocalizations.of(context)!.createdPages(pageNamesCreated)}";
}
if (pageNamesEdited.length > 0) {
pageNamesEdited = " edited the pages: \n" + pageNamesEdited + "\n";
pageNamesEdited =
" ${AppLocalizations.of(context)!.editedPages(pageNamesEdited)}";
}
return _buildItem(
@ -403,14 +411,14 @@ class EventItem extends StatelessWidget {
case 'InstallationEvent':
String? action = e.payload!.action;
if (action == 'new_permissions_accepted') {
action = "new permission were accepted for";
action = "${AppLocalizations.of(context)!.newPermissionsAccepted}";
}
return _buildItem(
context: context,
spans: [
TextSpan(
text:
' $action for the Github App with id ${e.payload!.installation!.id}'),
' $action ${AppLocalizations.of(context)!.forGithubAppWithId(e.payload!.installation!.id.toString())}'),
],
);
case 'InstallationRepositoriesEvent':
@ -428,17 +436,17 @@ class EventItem extends StatelessWidget {
}
String finalListOfRepos = "";
if (addedRepos != "") {
finalListOfRepos += addedRepos + " were added to\n ";
finalListOfRepos +=
"${AppLocalizations.of(context)!.wereAddedTo(addedRepos, e.payload!.installation!.id.toString())}\n ";
}
if (removedRepos != "") {
finalListOfRepos += removedRepos + " were removed from";
finalListOfRepos += removedRepos +
" ${AppLocalizations.of(context)!.wereRemovedFrom(removedRepos, e.payload!.installation!.id.toString())}";
}
return _buildItem(
context: context,
spans: [
TextSpan(
text:
' $finalListOfRepos the installation id ${e.payload!.installation!.id} '),
TextSpan(text: '$finalListOfRepos'),
],
);
case 'IssueCommentEvent':
@ -447,13 +455,13 @@ class EventItem extends StatelessWidget {
spans: [
TextSpan(
text:
' commented on ${e.payload!.issue!.isPullRequestComment ? 'pull request' : 'issue'} '),
' ${AppLocalizations.of(context)!.commentedOn} ${e.payload!.issue!.isPullRequestComment ? 'pull request' : 'issue'} '),
_buildIssue(
context,
e.payload!.issue!.number,
isPullRequest: e.payload!.issue!.isPullRequestComment,
),
TextSpan(text: ' at '),
TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context),
],
card: _buildIssueCard(
@ -468,9 +476,11 @@ class EventItem extends StatelessWidget {
return _buildItem(
context: context,
spans: [
TextSpan(text: ' ${e.payload!.action} issue '),
TextSpan(
text:
' ${e.payload!.action} ${AppLocalizations.of(context)!.issue} '),
_buildIssue(context, issue.number),
TextSpan(text: ' at '),
TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context),
],
card: _buildIssueCard(context, issue, issue.body),
@ -480,19 +490,24 @@ class EventItem extends StatelessWidget {
var messageToDisplay;
switch (action) {
case "purchased":
messageToDisplay = "purchased a Marketplace Plan";
messageToDisplay =
AppLocalizations.of(context)!.purchasedMarketplacePlan;
break;
case "cancelled":
messageToDisplay = "cancelled their Marketplace Plan";
messageToDisplay =
AppLocalizations.of(context)!.cancelledMarketplacePlan;
break;
case "pending_change":
messageToDisplay = " Marketplace Plan is pending change";
messageToDisplay =
AppLocalizations.of(context)!.pendingMarketplacePlan;
break;
case "pending_change_cancelled":
messageToDisplay = " Pending Marketplace Plan was cancelled";
messageToDisplay =
AppLocalizations.of(context)!.pendingChangeCancelled;
break;
case "changed":
messageToDisplay = " changed their Marketplace Plan";
messageToDisplay =
AppLocalizations.of(context)!.changedMarketplacePlan;
break;
}
return _buildItem(
@ -511,21 +526,22 @@ class EventItem extends StatelessWidget {
spans: [
TextSpan(
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),
],
);
case 'ProjectCardEvent':
String? action = e.payload!.action;
if (action == 'converted') {
action = ' converted the project card into an issue ';
action = ' ${AppLocalizations.of(context)!.convertProjectCard} ';
} else {
action = action! + ' the project card ';
action =
action! + ' ${AppLocalizations.of(context)!.theProjectCard} ';
}
return _buildItem(
context: context,
spans: [
TextSpan(text: ' $action at '),
TextSpan(text: ' $action ${AppLocalizations.of(context)!.at} '),
_buildRepo(context),
],
);
@ -533,22 +549,22 @@ class EventItem extends StatelessWidget {
return _buildItem(context: context, spans: [
TextSpan(
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),
]);
case 'ProjectEvent':
return _buildItem(context: context, spans: [
TextSpan(
text:
' ${e.payload!.action} the project ${e.payload!.project!.name} '),
' ${AppLocalizations.of(context)!.projectEventMessage(e.payload!.action!, e.payload!.project!.name!)}} '),
]);
case 'PublicEvent':
return _buildItem(
context: context,
spans: [
TextSpan(text: ' made '),
TextSpan(text: ' ${AppLocalizations.of(context)!.made} '),
_buildRepo(context),
TextSpan(text: ' public'),
TextSpan(text: ' ${AppLocalizations.of(context)!.public}'),
],
);
case 'PullRequestEvent':
@ -556,9 +572,11 @@ class EventItem extends StatelessWidget {
return _buildItem(
context: context,
spans: [
TextSpan(text: ' ${e.payload!.action} pull request '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.pullRequestEventMessage(e.payload!.action!)} '),
_buildIssue(context, pr.number, isPullRequest: true),
TextSpan(text: ' at '),
TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context),
],
card: _buildIssueCard(context, pr, pr.body, isPullRequest: true),
@ -566,9 +584,11 @@ class EventItem extends StatelessWidget {
case 'PullRequestReviewEvent':
final pr = e.payload!.pullRequest!;
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),
TextSpan(text: ' at '),
TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context),
]);
case 'PullRequestReviewCommentEvent':
@ -576,9 +596,11 @@ class EventItem extends StatelessWidget {
return _buildItem(
context: context,
spans: [
TextSpan(text: ' reviewed pull request '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.pullRequestReviewCommentEventMessage} '),
_buildIssue(context, pr.number, isPullRequest: true),
TextSpan(text: ' at '),
TextSpan(text: ' ${AppLocalizations.of(context)!.at} '),
_buildRepo(context),
],
card: _buildIssueCard(context, pr, e.payload!.comment!.body,
@ -587,14 +609,17 @@ class EventItem extends StatelessWidget {
case 'PushEvent':
return _buildItem(
context: context,
spans: [TextSpan(text: ' pushed to '), _buildRepo(context)],
spans: [
TextSpan(text: ' ${AppLocalizations.of(context)!.pushedTo} '),
_buildRepo(context)
],
card: _buildCommitsCard(context),
);
case 'ReleaseEvent':
return _buildItem(
context: context,
spans: [
TextSpan(text: ' released '),
TextSpan(text: '${AppLocalizations.of(context)!.released} '),
_buildLinkSpan(context, e.payload!.release!.tagName,
e.payload!.release!.htmlUrl),
TextSpan(text: ' at '),
@ -607,20 +632,23 @@ class EventItem extends StatelessWidget {
return _buildItem(context: context, spans: [
TextSpan(
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':
return _buildItem(context: context, spans: [
TextSpan(
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':
return _buildItem(
context: context,
spans: [TextSpan(text: ' starred '), _buildRepo(context)],
spans: [
TextSpan(text: ' ${AppLocalizations.of(context)!.starred} '),
_buildRepo(context)
],
);
default:
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:provider/provider.dart';
import 'package:timeago/timeago.dart' as timeago;
import 'package:flutter_gen/gen_l10n/S.dart';
class ReleaseItem extends StatelessWidget {
final String? login;
@ -61,8 +62,9 @@ class ReleaseItem extends StatelessWidget {
color: theme.palette.secondaryText,
fontSize: 16,
),
child: Text(
login! + " released " + timeago.format(publishedAt!)),
child: Text(login! +
" ${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 '../utils/utils.dart';
import 'comment_item.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
TextSpan createUserSpan(BuildContext context, String? login) {
return createLinkSpan(context, login, '/github/$login');
@ -57,12 +58,14 @@ class TimelineItem extends StatelessWidget {
final dynamic node;
TimelineItem(this.node);
Widget _buildFallback(String? type) {
Widget _buildFallback(String? type, BuildContext context) {
return TimelineEventItem(
actor: '',
iconData: Octicons.octoface,
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,
iconData: Octicons.git_commit,
textSpan: TextSpan(children: [
TextSpan(text: ' added commit '),
TextSpan(text: p.commit.oid.substring(0, 8))
TextSpan(
text:
' ${AppLocalizations.of(context)!.pullRequestCommitMessage(p.commit.oid.substring(0, 8))} '),
]),
);
case 'IssueComment':
@ -97,7 +101,9 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.primitive_dot,
iconColor: GithubPalette.open,
textSpan: TextSpan(children: [
TextSpan(text: ' referenced this on '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.crossReferencedEventMessage} '),
createLinkSpan(context, '$owner/$name#$number',
'/github/$owner/$name/$prefix/$number'),
]),
@ -108,7 +114,8 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.circle_slash,
iconColor: GithubPalette.closed,
textSpan: TextSpan(text: ' closed this '),
textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.closedEventMessage} '),
);
case 'ReopenedEvent':
@ -117,19 +124,24 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.primitive_dot,
iconColor: GithubPalette.open,
textSpan: TextSpan(text: ' reopened this '),
textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.reopenedEventMessage} '),
);
case 'SubscribedEvent':
final p = node as GSubscribedEventParts;
return TimelineEventItem(
actor: p.actor!.login,
textSpan: TextSpan(text: ' subscribed to this issue '),
textSpan: TextSpan(
text:
' ${AppLocalizations.of(context)!.subscribedEventMessage} '),
);
case 'UnsubscribedEvent':
final p = node as GUnsubscribedEventParts;
return TimelineEventItem(
actor: p.actor!.login,
textSpan: TextSpan(text: ' unsubscribed from this issue '),
textSpan: TextSpan(
text:
' ${AppLocalizations.of(context)!.unsubscribedEventMessage} '),
);
case 'ReferencedEvent':
final p = node as GReferencedEventParts;
@ -142,9 +154,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.bookmark,
textSpan: TextSpan(children: [
TextSpan(text: ' referenced this pull request from commit '),
TextSpan(text: p.commit!.oid.substring(0, 8)),
TextSpan(text: ' from ' + p.commitRepository.name),
TextSpan(
text:
' ${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,
iconData: Octicons.bookmark,
textSpan: TextSpan(children: [
TextSpan(text: ' referenced this pull request from commit '),
TextSpan(text: p.commit!.oid.substring(0, 8)),
TextSpan(
text:
' ${AppLocalizations.of(context)!.referencedEventMessage(p.commit!.oid.substring(0, 8), '')} '),
]),
);
case 'AssignedEvent':
@ -163,7 +176,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.key,
textSpan: TextSpan(children: [
TextSpan(text: ' assigned this to '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.assignedEventMessage} '),
createLinkSpan(context, assignee, '/github/$assignee'),
]),
);
@ -174,7 +189,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.key,
textSpan: TextSpan(children: [
TextSpan(text: ' unassigned this from '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.unassignedEventMessage} '),
createLinkSpan(context, assignee, '/github/$assignee')
]),
);
@ -184,10 +201,10 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.tag,
textSpan: TextSpan(children: [
TextSpan(text: ' added '),
TextSpan(text: ' ${AppLocalizations.of(context)!.added} '),
WidgetSpan(
child: MyLabel(name: p.label.name, cssColor: p.label.color)),
TextSpan(text: ' label'),
TextSpan(text: ' ${AppLocalizations.of(context)!.label}'),
]),
);
case 'UnlabeledEvent':
@ -196,10 +213,10 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.tag,
textSpan: TextSpan(children: [
TextSpan(text: ' removed '),
TextSpan(text: ' ${AppLocalizations.of(context)!.removed} '),
WidgetSpan(
child: MyLabel(name: p.label.name, cssColor: p.label.color)),
TextSpan(text: ' label'),
TextSpan(text: ' ${AppLocalizations.of(context)!.label}'),
]),
);
case 'MilestonedEvent':
@ -208,9 +225,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.milestone,
textSpan: TextSpan(children: [
TextSpan(text: ' added this to '),
TextSpan(text: p.milestoneTitle),
TextSpan(text: ' milestone'),
TextSpan(
text:
' ${AppLocalizations.of(context)!.milestonedEventMessage(p.milestoneTitle)} '),
]),
);
case 'DemilestonedEvent':
@ -219,9 +236,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.milestone,
textSpan: TextSpan(children: [
TextSpan(text: ' removed this from '),
TextSpan(text: p.milestoneTitle),
TextSpan(text: ' milestone'),
TextSpan(
text:
' ${AppLocalizations.of(context)!.demilestonedEventMessage(p.milestoneTitle)} '),
]),
);
case 'RenamedTitleEvent':
@ -230,13 +247,13 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.pencil,
textSpan: TextSpan(children: [
TextSpan(text: ' changed the title '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.renamedTitleEventMessage(p.currentTitle)} '),
TextSpan(
text: p.previousTitle,
style: TextStyle(decoration: TextDecoration.lineThrough),
),
TextSpan(text: ' to '),
TextSpan(text: p.currentTitle)
]),
);
case 'LockedEvent':
@ -245,7 +262,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.lock,
textSpan: TextSpan(children: [
TextSpan(text: ' locked this conversation '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.lockedConversationEventMessage} '),
]),
);
case 'UnlockedEvent':
@ -254,7 +273,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.key,
textSpan: TextSpan(children: [
TextSpan(text: ' unlocked this conversation '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.unlockedConversationEventMessage} '),
]),
);
case 'TransferredEvent':
@ -265,14 +286,14 @@ class TimelineItem extends StatelessWidget {
children: [
TextSpan(
text:
' transferred this issue from ' + p.fromRepository!.name)
' ${AppLocalizations.of(context)!.transferredEventMessage(p.fromRepository!.name)} ')
],
),
);
// pull request only types
case 'CommitCommentThread':
return _buildFallback(type); // TODO:
return _buildFallback(type, context); // TODO:
case 'PullRequestReview':
final p = node as GPullRequestReviewParts;
return Column(
@ -282,9 +303,12 @@ class TimelineItem extends StatelessWidget {
iconColor: GithubPalette.open,
iconData: Octicons.check,
textSpan: p.state == GPullRequestReviewState.APPROVED
? TextSpan(text: ' approved these changes')
? TextSpan(
text:
' ${AppLocalizations.of(context)!.approvedChanges}')
: p.state == GPullRequestReviewState.COMMENTED
? TextSpan(text: ' reviewed ')
? TextSpan(
text: ' ${AppLocalizations.of(context)!.reviewed} ')
: warningSpan),
Container(
padding: CommonStyle.padding.copyWith(left: 50),
@ -299,7 +323,7 @@ class TimelineItem extends StatelessWidget {
);
case 'PullRequestReviewThread':
case 'PullRequestReviewComment':
return _buildFallback(type); // TODO:
return _buildFallback(type, context); // TODO:
case 'MergedEvent':
final p = node as GMergedEventParts;
return TimelineEventItem(
@ -307,10 +331,9 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.git_merge,
iconColor: GithubPalette.merged,
textSpan: TextSpan(children: [
TextSpan(text: ' merged commit '),
TextSpan(text: p.commit!.oid.substring(0, 8)),
TextSpan(text: ' into '),
TextSpan(text: p.mergeRefName),
TextSpan(
text:
' ${AppLocalizations.of(context)!.mergedEventMessage(p.commit!.oid.substring(0, 8), p.mergeRefName)} '),
]),
);
case 'MentionedEvent':
@ -318,14 +341,16 @@ class TimelineItem extends StatelessWidget {
return TimelineEventItem(
actor: p.actor!.login,
iconData: Octicons.bookmark,
textSpan: TextSpan(text: ' was mentioned '),
textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.mentionedEventMessage} '),
);
case 'PinnedEvent':
final p = node as GPinnedEventParts;
return TimelineEventItem(
actor: p.actor!.login,
iconData: Octicons.pin,
textSpan: TextSpan(text: ' pinned this issue '),
textSpan: TextSpan(
text: ' ${AppLocalizations.of(context)!.pinnedEventMessage} '),
);
case 'DeployedEvent':
final p = node as GDeployedEventParts;
@ -333,15 +358,15 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
textSpan: TextSpan(
text:
' deployed the pull request ' + p.pullRequest.headRef!.name),
' ${AppLocalizations.of(context)!.deployedPR(p.pullRequest.headRef!.name)} '),
);
case 'DeploymentEnvironmentChangedEvent':
final p = node as GDeploymentEnvironmentChangedEventParts;
return TimelineEventItem(
actor: p.actor!.login,
textSpan: TextSpan(
text: ' changed the deployment environment to ' +
p.deploymentStatus.deployment.environment!),
text:
' ${AppLocalizations.of(context)!.deploymentEnvironmentChangedEventMessage(p.deploymentStatus.deployment.environment!)} '),
);
case 'HeadRefDeletedEvent':
final p = node as GHeadRefDeletedEventParts;
@ -349,9 +374,9 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
iconData: Octicons.git_branch,
textSpan: TextSpan(children: [
TextSpan(text: ' deleted the '),
TextSpan(text: p.headRefName),
TextSpan(text: ' branch'),
TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefDeletedEventMessage(p.headRefName)} '),
]),
);
case 'HeadRefRestoredEvent':
@ -359,9 +384,9 @@ class TimelineItem extends StatelessWidget {
return TimelineEventItem(
actor: p.actor!.login,
textSpan: TextSpan(children: [
TextSpan(text: ' restored the '),
WidgetSpan(child: PrimerBranchName(p.pullRequest.headRefName)),
TextSpan(text: ' branch')
TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefRestoredEventMessage(p.pullRequest.headRefName)} '),
]),
);
case 'HeadRefForcePushedEvent':
@ -371,14 +396,18 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
textSpan: TextSpan(
children: [
TextSpan(text: ' force-pushed the '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventFirstMessage} '),
WidgetSpan(child: PrimerBranchName(p.pullRequest.headRefName)),
TextSpan(text: ' branch from '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventSecondMessage} '),
TextSpan(
text: p.beforeCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary),
),
TextSpan(text: ' to '),
TextSpan(text: ' ${AppLocalizations.of(context)!.to} '),
TextSpan(
text: p.afterCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary),
@ -393,14 +422,18 @@ class TimelineItem extends StatelessWidget {
actor: p.actor!.login,
textSpan: TextSpan(
children: [
TextSpan(text: ' force-pushed the '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventFirstMessage} '),
WidgetSpan(child: PrimerBranchName(p.pullRequest.baseRef!.name)),
TextSpan(text: ' branch from '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.headRefForcedPushedEventSecondMessage} '),
TextSpan(
text: p.beforeCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary),
),
TextSpan(text: ' to '),
TextSpan(text: ' ${AppLocalizations.of(context)!.to} '),
TextSpan(
text: p.afterCommit!.oid.substring(0, 7),
style: TextStyle(color: theme.palette.primary),
@ -414,7 +447,9 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.eye,
actor: p.actor!.login,
textSpan: TextSpan(children: [
TextSpan(text: ' requested a review from '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.reviewRequestEventMessage} '),
createUserSpan(
context,
(p.requestedReviewer
@ -434,7 +469,8 @@ class TimelineItem extends StatelessWidget {
(p.requestedReviewer
as GReviewRequestRemovedEventParts_requestedReviewer__asUser)
.login),
TextSpan(text: ' from the review request '),
TextSpan(
text: ' ${AppLocalizations.of(context)!.fromReviewRequest} '),
]),
);
case 'ReviewDismissedEvent':
@ -443,12 +479,14 @@ class TimelineItem extends StatelessWidget {
iconData: Octicons.eye,
actor: p.actor!.login,
textSpan: TextSpan(children: [
TextSpan(text: ' dismissed the pull request review requested by '),
TextSpan(
text:
' ${AppLocalizations.of(context)!.reviewDismissedEventMessage} '),
createUserSpan(context, p.pullRequest.author!.login),
]),
);
default:
return _buildFallback(type);
return _buildFallback(type, context);
}
}