mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 12:05:52 +01:00
Migrate react-i18next translate components in scm-plugins
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
url: string;
|
||||
repository: Repository;
|
||||
|
||||
// context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class CloneInformation extends React.Component<Props> {
|
||||
@@ -54,4 +51,4 @@ class CloneInformation extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(CloneInformation);
|
||||
export default withTranslation("plugins")(CloneInformation);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Branch } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
branch: Branch;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class GitBranchInformation extends React.Component<Props> {
|
||||
@@ -26,4 +25,4 @@ class GitBranchInformation extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(GitBranchInformation);
|
||||
export default withTranslation("plugins")(GitBranchInformation);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Links } from "@scm-manager/ui-types";
|
||||
|
||||
import { InputField, Checkbox } from "@scm-manager/ui-components";
|
||||
|
||||
type Configuration = {
|
||||
@@ -11,14 +10,11 @@ type Configuration = {
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
initialConfiguration: Configuration;
|
||||
readOnly: boolean;
|
||||
|
||||
onConfigurationChange: (p1: Configuration, p2: boolean) => void;
|
||||
|
||||
// context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
type State = Configuration & {};
|
||||
@@ -76,4 +72,4 @@ class GitConfigurationForm extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(GitConfigurationForm);
|
||||
export default withTranslation("plugins")(GitConfigurationForm);
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Title, Configuration } from "@scm-manager/ui-components";
|
||||
import GitConfigurationForm from "./GitConfigurationForm";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
link: string;
|
||||
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class GitGlobalConfiguration extends React.Component<Props> {
|
||||
@@ -22,4 +20,4 @@ class GitGlobalConfiguration extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(GitGlobalConfiguration);
|
||||
export default withTranslation("plugins")(GitGlobalConfiguration);
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
target: string;
|
||||
source: string;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class GitMergeInformation extends React.Component<Props> {
|
||||
@@ -47,4 +46,4 @@ class GitMergeInformation extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(GitMergeInformation);
|
||||
export default withTranslation("plugins")(GitMergeInformation);
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import React, { FormEvent } from "react";
|
||||
|
||||
import { apiClient, BranchSelector, ErrorPage, Loading, Subtitle, SubmitButton } from "@scm-manager/ui-components";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Branch, Repository, Link } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import { apiClient, BranchSelector, ErrorPage, Loading, Subtitle, SubmitButton } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -196,4 +194,4 @@ class RepositoryConfig extends React.Component<Props, State> {
|
||||
};
|
||||
}
|
||||
|
||||
export default translate("plugins")(RepositoryConfig);
|
||||
export default withTranslation("plugins")(RepositoryConfig);
|
||||
|
||||
Reference in New Issue
Block a user