How to use the react-i18next.withTranslation function in react-i18next

To help you get started, we’ve selected a few react-i18next examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dezede / dezede / src / ModelToolbar.js View on Github external
import EditIcon from "@material-ui/icons/Edit";
import DeleteIcon from "@material-ui/icons/Delete";
import PersonIcon from "@material-ui/icons/Person";
import LinkIcon from "@material-ui/icons/Link";
import User from "./models/User";


const styles = theme => ({
  buttonGroup: {
    background: 'white',
  },
});


@withStyles(styles)
@withTranslation('base')
class ModelToolbar extends React.Component {
  static propTypes = {
    instance: PropTypes.any.isRequired,
    extraButtons: PropTypes.any,
    className: PropTypes.string,
    justify: PropTypes.string,
  };

  @computed get owner() {
    return User.getById(this.props.instance.owner);
  }

  render() {
    const {
      instance, extraButtons, className, justify, classes, style, t,
    } = this.props;
github Talend / component-runtime / component-starter-server / src / main / frontend / src / app / components / DatastoreDelete / DatastoreDelete.component.js View on Github external
);
}
DoDelete.propTypes = {
	t: PropTypes.func,
	onClick: PropTypes.func,
};

const DoDeleteTrans = withTranslation('Help')(DoDelete);


export default class DatastoreDelete extends React.Component {
	static propTypes = {
		item: PropTypes.shape({
			$id: PropTypes.string,
		}),
	};

	constructor(props) {
		super(props);
		this.onService = this.onService.bind(this);
		this.onDelete = this.onDelete.bind(this);
	}

	onService(datastore, dataset, components) {
github Talend / ui / packages / components / src / DateTimePickers / pickers / CalendarPicker / index.js View on Github external
import { withTranslation } from 'react-i18next';
import I18N_DOMAIN_COMPONENTS from '../../../constants';
import CalendarPicker from './CalendarPicker.component';

export default withTranslation(I18N_DOMAIN_COMPONENTS)(CalendarPicker);
github GenesisVision / web-client / packages / investor / src / modules / copytrading-tables / components / trade-history-sub-row.tsx View on Github external
pathname: composeProgramDetailsUrl(program.url),
              state: `/ ${title}`
            }}
          >
            
              {program.title}
            
          
        
      
    
  );
};

const TradeHistorySubRow = compose>(
  translate(),
  React.memo
)(_TradeHistorySubRow);
export default TradeHistorySubRow;

interface Props extends OwnProps, WithTranslation {}

interface OwnProps {
  title: string;
  provider: OrderSignalProgramInfo;
  symbol: string;
}
github openpitrix / dashboard / src / pages / Dashboard / Versions / Detail / index.jsx View on Github external
suspended: 'suspended'
};
const actionName = {
  submit: 'Submit review',
  submitted: 'Cancel review',
  release: 'Release to store',
  active: 'View in store',
  suspended: 'View in store'
};
const tags = [
  { name: 'Config File', value: 'configFile' },
  { name: 'Set Price', value: 'setPrice', disabled: true },
  { name: 'Update Log', value: 'updateLog' }
];

@withTranslation()
@inject(({ rootStore }) => ({
  rootStore,
  appVersionStore: rootStore.appVersionStore,
  appStore: rootStore.appStore,
  clusterStore: rootStore.clusterStore,
  appCreateStore: rootStore.appCreateStore,
  categoryStore: rootStore.categoryStore,
  userStore: rootStore.userStore
}))
@observer
export default class VersionDetail extends Component {
  state = {
    isLoading: false
  };

  async componentDidMount() {
github GenesisVision / web-client / packages / shared / modules / asset-notifications / custom-notification.tsx View on Github external
success: typeof alertMessageActions.success;
  removeNotification: TRemoveNotification;
  toggleNotifications: TToggleNotification;
}
interface DispatchProps {
  service: ResolveThunks;
}

interface OwnProps {
  settings: NotificationSettingViewModel;
  removeNotification: TRemoveNotification;
  toggleNotifications: TToggleNotification;
}

export default compose>(
  translate(),
  connect(
    undefined,
    mapDispatchToProps
  ),
  React.memo
)(CustomNotification);
github ipfs-shipyard / ipfs-webui / src / files / modals / delete-modal / DeleteModal.js View on Github external
DeleteModal.propTypes = {
  onCancel: PropTypes.func.isRequired,
  onDelete: PropTypes.func.isRequired,
  files: PropTypes.number,
  folders: PropTypes.number,
  t: PropTypes.func.isRequired,
  tReady: PropTypes.bool.isRequired
}

DeleteModal.defaultProps = {
  className: '',
  files: 0,
  folders: 0
}

export default withTranslation('files')(DeleteModal)
github evgeny-nadymov / telegram-react / src / Components / ColumnLeft / MainMenuButton.js View on Github external
aria-haspopup='true'
                    className={classes.menuIconButton}
                    aria-label='Menu'
                    onClick={this.handleMenuOpen}>
                    
                
                {mainMenuControl}
                 (this.themePicker = ref)} />
                 (this.languagePicker = ref)} />
            
        );
    }
}

const enhance = compose(
    withTranslation(),
    withStyles(styles, { withTheme: true })
);

export default enhance(MainMenuButton);
github GenesisVision / web-client / packages / shared / modules / asset-notifications / asset-notifications-custom.tsx View on Github external
interface StateProps {
  errorMessage?: string;
}

interface ServiceThunks extends ActionCreatorsMapObject {
  addNotification: TAddNotification;
}
interface DispatchProps {
  service: ResolveThunks;
}

const AssetNotificationsCustom = compose<
  React.ComponentType
>(
  withLoader,
  translate(),
  connect(
    mapStateToProps,
    mapDispatchToProps
  ),
  React.memo
)(_AssetNotificationsCustom);
export default AssetNotificationsCustom;
github celo-org / celo-monorepo / packages / verifier / src / components / ErrorBox.tsx View on Github external
return (
      
    )
  }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(withTranslation('global')(ErrorBox))