mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
Migrate react-i18next translate components in scm-plugins
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import React from "react";
|
||||
import { repositories } from "@scm-manager/ui-components";
|
||||
import { withTranslation, WithTranslation } from "react-i18next";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import { repositories } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class ProtocolInformation extends React.Component<Props> {
|
||||
@@ -26,4 +25,4 @@ class ProtocolInformation extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(ProtocolInformation);
|
||||
export default withTranslation("plugins")(ProtocolInformation);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { withTranslation, WithTranslation } from "react-i18next";
|
||||
import { Links } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import { Checkbox, Select } from "@scm-manager/ui-components";
|
||||
|
||||
type Configuration = {
|
||||
@@ -9,14 +9,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;
|
||||
@@ -84,4 +81,4 @@ class SvnConfigurationForm extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(SvnConfigurationForm);
|
||||
export default withTranslation("plugins")(SvnConfigurationForm);
|
||||
|
||||
@@ -1,13 +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 SvnConfigurationForm from "./SvnConfigurationForm";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
link: string;
|
||||
|
||||
// context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class SvnGlobalConfiguration extends React.Component<Props> {
|
||||
@@ -22,4 +19,4 @@ class SvnGlobalConfiguration extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("plugins")(SvnGlobalConfiguration);
|
||||
export default withTranslation("plugins")(SvnGlobalConfiguration);
|
||||
|
||||
Reference in New Issue
Block a user