mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
HostSetup: Make all remaining strings translatable
This commit is contained in:
@ -242,7 +242,34 @@ setup:
|
|||||||
keyEditors:
|
keyEditors:
|
||||||
public: Invalid Public Key - Doesn't start with ssh-rsa
|
public: Invalid Public Key - Doesn't start with ssh-rsa
|
||||||
private: Invalid Private Key
|
private: Invalid Private Key
|
||||||
|
sshKey:
|
||||||
|
generate: Generating SSH Key
|
||||||
|
title: In order to access this repository, this public key must be copied as a deploy key
|
||||||
|
step1: 1. Copy the key
|
||||||
|
step2a: 2. Open webpage, and paste the deploy key. Make sure it is given Write Access.
|
||||||
|
step2b: 2. Give this SSH Key access to the git repo. (You need to figure it out yourself)
|
||||||
|
step3: 3. Try Cloning ..
|
||||||
|
copy: Copy Key
|
||||||
|
copied: Public Key copied to Clipboard
|
||||||
|
regenerate: Regenerate Key
|
||||||
|
openDeploy: Open Deploy Key Webpage
|
||||||
|
clone: Clone Repo
|
||||||
|
addDeploy: Adding as a Deploy Key
|
||||||
|
sshKeyChoice:
|
||||||
|
title: We need SSH keys to authenticate -
|
||||||
|
generate: Generate new keys
|
||||||
|
custom: Provide Custom SSH Keys
|
||||||
|
sshKeyUserProvided:
|
||||||
|
public: Public Key -
|
||||||
|
private: Private Key -
|
||||||
|
cloning: Cloning ...
|
||||||
|
host:
|
||||||
|
title: Select a Git Hosting Provider -
|
||||||
|
custom: Custom
|
||||||
|
autoConfigure:
|
||||||
|
title: How do you want to do this?
|
||||||
|
automatic: Setup Automatically
|
||||||
|
manual: Let me do it manually
|
||||||
|
|
||||||
feature:
|
feature:
|
||||||
darkMode: Dark Mode
|
darkMode: Dark Mode
|
||||||
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import 'package:dots_indicator/dots_indicator.dart';
|
import 'package:dots_indicator/dots_indicator.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:function_types/function_types.dart';
|
import 'package:function_types/function_types.dart';
|
||||||
import 'package:git_bindings/git_bindings.dart';
|
import 'package:git_bindings/git_bindings.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
@ -14,15 +15,15 @@ import 'package:gitjournal/analytics.dart';
|
|||||||
import 'package:gitjournal/apis/githost_factory.dart';
|
import 'package:gitjournal/apis/githost_factory.dart';
|
||||||
import 'package:gitjournal/error_reporting.dart';
|
import 'package:gitjournal/error_reporting.dart';
|
||||||
import 'package:gitjournal/settings.dart';
|
import 'package:gitjournal/settings.dart';
|
||||||
|
import 'package:gitjournal/setup/autoconfigure.dart';
|
||||||
|
import 'package:gitjournal/setup/button.dart';
|
||||||
|
import 'package:gitjournal/setup/clone_url.dart';
|
||||||
|
import 'package:gitjournal/setup/loading_error.dart';
|
||||||
import 'package:gitjournal/setup/repo_selector.dart';
|
import 'package:gitjournal/setup/repo_selector.dart';
|
||||||
|
import 'package:gitjournal/setup/sshkey.dart';
|
||||||
import 'package:gitjournal/state_container.dart';
|
import 'package:gitjournal/state_container.dart';
|
||||||
import 'package:gitjournal/utils.dart';
|
import 'package:gitjournal/utils.dart';
|
||||||
import 'package:gitjournal/utils/logger.dart';
|
import 'package:gitjournal/utils/logger.dart';
|
||||||
import 'autoconfigure.dart';
|
|
||||||
import 'button.dart';
|
|
||||||
import 'clone_url.dart';
|
|
||||||
import 'loading_error.dart';
|
|
||||||
import 'sshkey.dart';
|
|
||||||
|
|
||||||
class GitHostSetupScreen extends StatefulWidget {
|
class GitHostSetupScreen extends StatefulWidget {
|
||||||
final String repoFolderName;
|
final String repoFolderName;
|
||||||
@ -253,7 +254,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
if (pos == 4) {
|
if (pos == 4) {
|
||||||
if (_pageChoice[0] == PageChoice0.CustomProvider) {
|
if (_pageChoice[0] == PageChoice0.CustomProvider) {
|
||||||
return GitHostSetupLoadingErrorPage(
|
return GitHostSetupLoadingErrorPage(
|
||||||
loadingMessage: "Cloning ...",
|
loadingMessage: tr('setup.cloning'),
|
||||||
errorMessage: gitCloneErrorMessage,
|
errorMessage: gitCloneErrorMessage,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -303,7 +304,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
|
|
||||||
if (pos == 5) {
|
if (pos == 5) {
|
||||||
return GitHostSetupLoadingErrorPage(
|
return GitHostSetupLoadingErrorPage(
|
||||||
loadingMessage: "Cloning ...",
|
loadingMessage: tr('setup.cloning'),
|
||||||
errorMessage: gitCloneErrorMessage,
|
errorMessage: gitCloneErrorMessage,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -409,7 +410,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
|
|
||||||
void _copyKeyToClipboard(BuildContext context) {
|
void _copyKeyToClipboard(BuildContext context) {
|
||||||
Clipboard.setData(ClipboardData(text: publicKey));
|
Clipboard.setData(ClipboardData(text: publicKey));
|
||||||
showSnackbar(context, "Public Key copied to Clipboard");
|
showSnackbar(context, tr('setup.sshKey.copied'));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _launchDeployKeyPage() async {
|
void _launchDeployKeyPage() async {
|
||||||
@ -534,12 +535,12 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
try {
|
try {
|
||||||
Log.i("Generating SSH Key");
|
Log.i("Generating SSH Key");
|
||||||
setState(() {
|
setState(() {
|
||||||
_autoConfigureMessage = "Generating SSH Key";
|
_autoConfigureMessage = tr('setup.sshKey.generate');
|
||||||
});
|
});
|
||||||
var publicKey = await generateSSHKeys(comment: "GitJournal");
|
var publicKey = await generateSSHKeys(comment: "GitJournal");
|
||||||
|
|
||||||
Log.i("Adding as a deploy key");
|
Log.i("Adding as a deploy key");
|
||||||
_autoConfigureMessage = "Adding as a Deploy Key";
|
_autoConfigureMessage = tr('setup.sshKey.addDeploy');
|
||||||
|
|
||||||
await _gitHost.addDeployKey(publicKey, _gitHostRepo.fullName);
|
await _gitHost.addDeployKey(publicKey, _gitHostRepo.fullName);
|
||||||
} on Exception catch (e, stacktrace) {
|
} on Exception catch (e, stacktrace) {
|
||||||
@ -622,7 +623,7 @@ class GitHostChoicePage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
"Select a Git Hosting Provider -",
|
tr('setup.host.title'),
|
||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
@ -643,7 +644,7 @@ class GitHostChoicePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Custom",
|
text: tr('setup.host.custom'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
onCustomGitHost();
|
onCustomGitHost();
|
||||||
},
|
},
|
||||||
@ -672,19 +673,19 @@ class GitHostAutoConfigureChoicePage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
"How do you want to do this?",
|
tr('setup.autoConfigure.title'),
|
||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Setup Automatically",
|
text: tr('setup.autoConfigure.automatic'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
onDone(GitHostSetupType.Auto);
|
onDone(GitHostSetupType.Auto);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Let me do it manually",
|
text: tr('setup.autoConfigure.manual'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
onDone(GitHostSetupType.Manual);
|
onDone(GitHostSetupType.Manual);
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:function_types/function_types.dart';
|
import 'package:function_types/function_types.dart';
|
||||||
|
|
||||||
import 'button.dart';
|
import 'button.dart';
|
||||||
@ -25,7 +26,7 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (publicKey == null || publicKey.isEmpty) {
|
if (publicKey == null || publicKey.isEmpty) {
|
||||||
return GitHostSetupLoadingPage("Generating SSH Key ...");
|
return GitHostSetupLoadingPage(tr("setup.sshKey.generate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
var columns = Column(
|
var columns = Column(
|
||||||
@ -33,14 +34,14 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
'In order to access this repository, this public key must be copied as a deploy key',
|
tr("setup.sshKey.title"),
|
||||||
style: Theme.of(context).textTheme.headline6,
|
style: Theme.of(context).textTheme.headline6,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
|
|
||||||
// Step 1
|
// Step 1
|
||||||
Text(
|
Text(
|
||||||
'1. Copy the key',
|
tr("setup.sshKey.step1"),
|
||||||
style: Theme.of(context).textTheme.subtitle2,
|
style: Theme.of(context).textTheme.subtitle2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
@ -48,35 +49,35 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
|||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
|
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Copy Key",
|
text: tr("setup.sshKey.copy"),
|
||||||
onPressed: () => copyKeyFunction(context),
|
onPressed: () => copyKeyFunction(context),
|
||||||
),
|
),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Regenerate Key",
|
text: tr("setup.sshKey.regenerate"),
|
||||||
onPressed: regenerateFunction,
|
onPressed: regenerateFunction,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
Text(
|
Text(
|
||||||
'2. Open webpage, and paste the deploy key. Make sure it is given Write Access. ',
|
tr("setup.sshKey.step2a"),
|
||||||
style: Theme.of(context).textTheme.subtitle2,
|
style: Theme.of(context).textTheme.subtitle2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Open Deploy Key Webpage",
|
text: tr("setup.sshKey.openDeploy"),
|
||||||
onPressed: openDeployKeyPage,
|
onPressed: openDeployKeyPage,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
Text(
|
Text(
|
||||||
'3. Try Cloning ..',
|
tr("setup.sshKey.step3"),
|
||||||
style: Theme.of(context).textTheme.subtitle2,
|
style: Theme.of(context).textTheme.subtitle2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Clone Repo",
|
text: tr("setup.sshKey.clone"),
|
||||||
onPressed: doneFunction,
|
onPressed: doneFunction,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -106,7 +107,7 @@ class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (publicKey == null || publicKey.isEmpty) {
|
if (publicKey == null || publicKey.isEmpty) {
|
||||||
return GitHostSetupLoadingPage("Generating SSH Key ...");
|
return GitHostSetupLoadingPage(tr("setup.sshKey.generate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
var columns = Column(
|
var columns = Column(
|
||||||
@ -114,14 +115,14 @@ class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
'In order to access this repository, this public key must be copied as a deploy key',
|
tr("setup.sshKey.title"),
|
||||||
style: Theme.of(context).textTheme.headline6,
|
style: Theme.of(context).textTheme.headline6,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
|
|
||||||
// Step 1
|
// Step 1
|
||||||
Text(
|
Text(
|
||||||
'1. Copy the key',
|
tr("setup.sshKey.step1"),
|
||||||
style: Theme.of(context).textTheme.subtitle2,
|
style: Theme.of(context).textTheme.subtitle2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
@ -129,30 +130,30 @@ class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
|||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
|
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Copy Key",
|
text: tr("setup.sshKey.copy"),
|
||||||
onPressed: () => copyKeyFunction(context),
|
onPressed: () => copyKeyFunction(context),
|
||||||
),
|
),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Regenerate Key",
|
text: tr("setup.sshKey.regenerate"),
|
||||||
onPressed: regenerateFunction,
|
onPressed: regenerateFunction,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
Text(
|
Text(
|
||||||
'2. Give this SSH Key access to the git repo. (You need to figure it out yourself)',
|
tr("setup.sshKey.step2b"),
|
||||||
style: Theme.of(context).textTheme.subtitle2,
|
style: Theme.of(context).textTheme.subtitle2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
Text(
|
Text(
|
||||||
'3. Try Cloning ..',
|
tr("setup.sshKey.step3"),
|
||||||
style: Theme.of(context).textTheme.subtitle2,
|
style: Theme.of(context).textTheme.subtitle2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Clone Repo",
|
text: tr("setup.sshKey.clone"),
|
||||||
onPressed: doneFunction,
|
onPressed: doneFunction,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -181,17 +182,17 @@ class GitHostSetupKeyChoice extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
"We need SSH keys to authenticate -",
|
tr("setup.sshKeyChoice.title"),
|
||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Generate new keys",
|
text: tr("setup.sshKeyChoice.generate"),
|
||||||
onPressed: onGenerateKeys,
|
onPressed: onGenerateKeys,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Provide Custom SSH Keys",
|
text: tr("setup.sshKeyChoice.custom"),
|
||||||
onPressed: onUserProvidedKeys,
|
onPressed: onUserProvidedKeys,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -244,21 +245,21 @@ class _GitHostUserProvidedKeysState extends State<GitHostUserProvidedKeys> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
"Public Key -",
|
tr("setup.sshKeyUserProvided.public"),
|
||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
PublicKeyEditor(_publicFormKey, _publicKeyController),
|
PublicKeyEditor(_publicFormKey, _publicKeyController),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
Text(
|
Text(
|
||||||
"Private Key -",
|
tr("setup.sshKeyUserProvided.private"),
|
||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
PrivateKeyEditor(_privateFormKey, _privateKeyController),
|
PrivateKeyEditor(_privateFormKey, _privateKeyController),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Next",
|
text: tr("setup.next"),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
var publicValid = _publicFormKey.currentState.validate();
|
var publicValid = _publicFormKey.currentState.validate();
|
||||||
var privateValid = _privateFormKey.currentState.validate();
|
var privateValid = _privateFormKey.currentState.validate();
|
||||||
|
Reference in New Issue
Block a user