Merged in feature/i18n_for_plugins_v2 (pull request #92)

Feature/i18n for plugins v2
This commit is contained in:
Sebastian Sdorra
2018-10-24 09:22:47 +00:00
14 changed files with 548 additions and 16 deletions

View File

@@ -2,26 +2,28 @@
import React from "react";
import { repositories } from "@scm-manager/ui-components";
import type { Repository } from "@scm-manager/ui-types";
import { translate } from "react-i18next";
type Props = {
repository: Repository
repository: Repository,
t: string => string
}
class ProtocolInformation extends React.Component<Props> {
render() {
const { repository } = this.props;
const { repository, t } = this.props;
const href = repositories.getProtocolLinkByType(repository, "http");
if (!href) {
return null;
}
return (
<div>
<h4>Clone the repository</h4>
<h4>{t("scm-hg-plugin.information.clone")}</h4>
<pre>
<code>hg clone {href}</code>
</pre>
<h4>Create a new repository</h4>
<h4>{t("scm-hg-plugin.information.create")}</h4>
<pre>
<code>
hg init {repository.name}
@@ -41,7 +43,7 @@ class ProtocolInformation extends React.Component<Props> {
<br />
</code>
</pre>
<h4>Push an existing repository</h4>
<h4>{t("scm-hg-plugin.information.replace")}</h4>
<pre>
<code>
# add the repository url as default to your .hg/hgrc e.g:
@@ -59,4 +61,4 @@ class ProtocolInformation extends React.Component<Props> {
}
export default ProtocolInformation;
export default translate("plugins")(ProtocolInformation);

View File

@@ -0,0 +1,9 @@
{
"scm-hg-plugin": {
"information": {
"clone" : "Repository Klonen",
"create" : "Neue Repository erstellen",
"replace" : "Eine existierende Repository aktualisieren"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"scm-hg-plugin": {
"information": {
"clone" : "Clone the repository",
"create" : "Create a new repository",
"replace" : "Push an existing repository"
}
}
}