Upgrade i18next

pull/1137/head
Rick Carlino 2019-04-02 14:59:37 -05:00
parent 977f7244a4
commit 5aa5fccad4
243 changed files with 498 additions and 261 deletions

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next"; import { t } from "./i18next_wrapper";
// No reusability here. Why not just keep it from taking up sass? // No reusability here. Why not just keep it from taking up sass?
const STYLES: React.CSSProperties = { const STYLES: React.CSSProperties = {

View File

@ -33,7 +33,7 @@ jest.mock("../routes", () => {
import { stopIE } from "../util/stop_ie"; import { stopIE } from "../util/stop_ie";
import { shortRevision } from "../util/util"; import { shortRevision } from "../util/util";
import { detectLanguage } from "../i18n"; import { detectLanguage } from "../i18n";
import { init } from "i18next"; import I from "i18next";
describe("entry file", () => { describe("entry file", () => {
it("Calls the expected callbacks", async () => { it("Calls the expected callbacks", async () => {
@ -42,6 +42,6 @@ describe("entry file", () => {
expect(stopIE).toHaveBeenCalled(); expect(stopIE).toHaveBeenCalled();
expect(shortRevision).toHaveBeenCalled(); expect(shortRevision).toHaveBeenCalled();
expect(detectLanguage).toHaveBeenCalled(); expect(detectLanguage).toHaveBeenCalled();
expect(init).toHaveBeenCalled(); expect(I.init).toHaveBeenCalled();
}); });
}); });

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { import {
Widget, Widget,
WidgetHeader, WidgetHeader,
@ -14,6 +14,7 @@ import { success, error } from "farmbot-toastr/dist";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { uniq } from "lodash"; import { uniq } from "lodash";
import { BlurablePassword } from "../../ui/blurable_password"; import { BlurablePassword } from "../../ui/blurable_password";
import { t } from "../../i18next_wrapper";
interface PasswordForm { interface PasswordForm {
new_password: string; new_password: string;

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { import {
Widget, Widget,
WidgetHeader, WidgetHeader,
@ -10,6 +10,7 @@ import {
import { DeleteAccountProps, DeleteAccountState } from "../interfaces"; import { DeleteAccountProps, DeleteAccountState } from "../interfaces";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { BlurablePassword } from "../../ui/blurable_password"; import { BlurablePassword } from "../../ui/blurable_password";
import { t } from "../../i18next_wrapper";
export class DeleteAccount extends export class DeleteAccount extends
React.Component<DeleteAccountProps, DeleteAccountState> { React.Component<DeleteAccountProps, DeleteAccountState> {

View File

@ -1,7 +1,8 @@
import * as React from "react"; import * as React from "react";
import { Widget, WidgetHeader, WidgetBody, Row, Col } from "../../ui"; import { Widget, WidgetHeader, WidgetBody, Row, Col } from "../../ui";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export function ExportAccountPanel(props: { onClick: () => void }) { export function ExportAccountPanel(props: { onClick: () => void }) {
return <Widget> return <Widget>

View File

@ -1,9 +1,10 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { import {
BlurableInput, Widget, WidgetHeader, WidgetBody, SaveBtn BlurableInput, Widget, WidgetHeader, WidgetBody, SaveBtn
} from "../../ui/index"; } from "../../ui/index";
import { SettingsPropTypes } from "../interfaces"; import { SettingsPropTypes } from "../interfaces";
import { t } from "../../i18next_wrapper";
export class Settings extends React.Component<SettingsPropTypes, {}> { export class Settings extends React.Component<SettingsPropTypes, {}> {
render() { render() {

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Settings, DeleteAccount, ChangePassword } from "./components"; import { Settings, DeleteAccount, ChangePassword } from "./components";
import { Props } from "./interfaces"; import { Props } from "./interfaces";
@ -16,6 +15,7 @@ import { requestAccountExport } from "./request_account_export";
import { DevWidget } from "./dev/dev_widget"; import { DevWidget } from "./dev/dev_widget";
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app"; import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";
import { DevMode } from "./dev/dev_mode"; import { DevMode } from "./dev/dev_mode";
import { t } from "../i18next_wrapper";
const KEYS: (keyof User)[] = ["id", "name", "email", "created_at", "updated_at"]; const KEYS: (keyof User)[] = ["id", "name", "email", "created_at", "updated_at"];

View File

@ -2,9 +2,10 @@ import * as React from "react";
import { WidgetHeader, Widget, WidgetBody } from "../../ui/index"; import { WidgetHeader, Widget, WidgetBody } from "../../ui/index";
import { LabsFeaturesList } from "./labs_features_list_ui"; import { LabsFeaturesList } from "./labs_features_list_ui";
import { maybeToggleFeature } from "./labs_features_list_data"; import { maybeToggleFeature } from "./labs_features_list_data";
import { t } from "i18next";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { GetWebAppConfigValue } from "../../config_storage/actions"; import { GetWebAppConfigValue } from "../../config_storage/actions";
import { t } from "../../i18next_wrapper";
interface LabsFeaturesProps { interface LabsFeaturesProps {
getConfigValue: GetWebAppConfigValue; getConfigValue: GetWebAppConfigValue;

View File

@ -1,9 +1,10 @@
import { t } from "i18next";
import { BooleanSetting } from "../../session_keys"; import { BooleanSetting } from "../../session_keys";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { VirtualTrail } from "../../farm_designer/map/layers/farmbot/bot_trail"; import { VirtualTrail } from "../../farm_designer/map/layers/farmbot/bot_trail";
import { GetWebAppConfigValue, setWebAppConfigValue } from "../../config_storage/actions"; import { GetWebAppConfigValue, setWebAppConfigValue } from "../../config_storage/actions";
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app"; import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";
import { t } from "../../i18next_wrapper";
export interface LabsFeature { export interface LabsFeature {
/** Toggle label. */ /** Toggle label. */

View File

@ -1,9 +1,10 @@
import { API } from "../api"; import { API } from "../api";
import { Content } from "../constants"; import { Content } from "../constants";
import { success } from "farmbot-toastr"; import { success } from "farmbot-toastr";
import { t } from "i18next";
import axios, { AxiosResponse } from "axios"; import axios, { AxiosResponse } from "axios";
import { DeviceAccountSettings } from "farmbot/dist/resources/api_resources"; import { DeviceAccountSettings } from "farmbot/dist/resources/api_resources";
import { t } from "../i18next_wrapper";
interface DataDumpExport { device?: DeviceAccountSettings; } interface DataDumpExport { device?: DeviceAccountSettings; }
type Response = AxiosResponse<DataDumpExport | undefined>; type Response = AxiosResponse<DataDumpExport | undefined>;

View File

@ -17,11 +17,12 @@ import { ResourceIndex } from "../resources/interfaces";
import { SequenceBodyItem } from "farmbot/dist"; import { SequenceBodyItem } from "farmbot/dist";
import { Actions } from "../constants"; import { Actions } from "../constants";
import { maybeStartTracking } from "./maybe_start_tracking"; import { maybeStartTracking } from "./maybe_start_tracking";
import { t } from "i18next";
import { newTaggedResource } from "../sync/actions"; import { newTaggedResource } from "../sync/actions";
import { arrayUnwrap } from "../resources/util"; import { arrayUnwrap } from "../resources/util";
import { findByUuid } from "../resources/reducer_support"; import { findByUuid } from "../resources/reducer_support";
import { assign, noop } from "lodash"; import { assign, noop } from "lodash";
import { t } from "../i18next_wrapper";
export function edit(tr: TaggedResource, changes: Partial<typeof tr.body>): export function edit(tr: TaggedResource, changes: Partial<typeof tr.body>):
ReduxAction<EditResourceParams> { ReduxAction<EditResourceParams> {

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { init, error } from "farmbot-toastr"; import { init, error } from "farmbot-toastr";
import { NavBar } from "./nav"; import { NavBar } from "./nav";
@ -24,6 +24,7 @@ import { takeSortedLogs } from "./logs/state_to_props";
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware"; import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
import { getFirmwareConfig } from "./resources/getters"; import { getFirmwareConfig } from "./resources/getters";
import { intersection } from "lodash"; import { intersection } from "lodash";
import { t } from "./i18next_wrapper";
/** For the logger module */ /** For the logger module */
init(); init();

View File

@ -7,7 +7,7 @@ import { success, error, info, warning } from "farmbot-toastr";
import { HardwareState } from "../devices/interfaces"; import { HardwareState } from "../devices/interfaces";
import { GetState, ReduxAction } from "../redux/interfaces"; import { GetState, ReduxAction } from "../redux/interfaces";
import { Content, Actions } from "../constants"; import { Content, Actions } from "../constants";
import { t } from "i18next";
import { import {
EXPECTED_MAJOR, EXPECTED_MAJOR,
EXPECTED_MINOR, EXPECTED_MINOR,
@ -27,6 +27,7 @@ import { onLogs } from "./log_handlers";
import { ChannelName, MessageType } from "../sequences/interfaces"; import { ChannelName, MessageType } from "../sequences/interfaces";
import { DeepPartial } from "redux"; import { DeepPartial } from "redux";
import { slowDown } from "./slow_down"; import { slowDown } from "./slow_down";
import { t } from "../i18next_wrapper";
export const TITLE = "New message from bot"; export const TITLE = "New message from bot";
/** TODO: This ought to be stored in Redux. It is here because of historical /** TODO: This ought to be stored in Redux. It is here because of historical

View File

@ -1,8 +1,9 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Row, Col } from "../ui/index"; import { Row, Col } from "../ui/index";
import { AxisDisplayGroupProps } from "./interfaces"; import { AxisDisplayGroupProps } from "./interfaces";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import { t } from "../i18next_wrapper";
const Axis = ({ val }: { val: number | undefined }) => <Col xs={3}> const Axis = ({ val }: { val: number | undefined }) => <Col xs={3}>
<input disabled value={isNumber(val) ? val : "---"} /> <input disabled value={isNumber(val) ? val : "---"} />

View File

@ -1,10 +1,11 @@
import * as React from "react"; import * as React from "react";
import { AxisInputBox } from "./axis_input_box"; import { AxisInputBox } from "./axis_input_box";
import { t } from "i18next";
import { Row, Col } from "../ui/index"; import { Row, Col } from "../ui/index";
import { AxisInputBoxGroupProps, AxisInputBoxGroupState } from "./interfaces"; import { AxisInputBoxGroupProps, AxisInputBoxGroupState } from "./interfaces";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import { Vector3 } from "farmbot"; import { Vector3 } from "farmbot";
import { t } from "../i18next_wrapper";
/** Coordinate input and GO button for Move widget. */ /** Coordinate input and GO button for Move widget. */
export class AxisInputBoxGroup extends export class AxisInputBoxGroup extends

View File

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../ui/index"; import { Row, Col } from "../ui/index";
import { ToggleButton } from "./toggle_button"; import { ToggleButton } from "./toggle_button";
import { t } from "i18next"; import { t } from "../i18next_wrapper";
export interface KeyValRowProps { export interface KeyValRowProps {
label: string; label: string;

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Row, Col } from "../../ui"; import { Row, Col } from "../../ui";
import { BotLocationData } from "../../devices/interfaces"; import { BotLocationData } from "../../devices/interfaces";
import { moveAbs } from "../../devices/actions"; import { moveAbs } from "../../devices/actions";
@ -8,6 +8,7 @@ import { AxisDisplayGroup } from "../axis_display_group";
import { AxisInputBoxGroup } from "../axis_input_box_group"; import { AxisInputBoxGroup } from "../axis_input_box_group";
import { GetWebAppBool } from "./interfaces"; import { GetWebAppBool } from "./interfaces";
import { BooleanSetting } from "../../session_keys"; import { BooleanSetting } from "../../session_keys";
import { t } from "../../i18next_wrapper";
export interface BotPositionRowsProps { export interface BotPositionRowsProps {
locationData: BotLocationData; locationData: BotLocationData;

View File

@ -2,7 +2,7 @@ import * as React from "react";
import { moveRelative } from "../../devices/actions"; import { moveRelative } from "../../devices/actions";
import { DirectionButtonProps, Payl } from "./interfaces"; import { DirectionButtonProps, Payl } from "./interfaces";
import { CONFIG_DEFAULTS } from "farmbot/dist/config"; import { CONFIG_DEFAULTS } from "farmbot/dist/config";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export function directionDisabled(props: DirectionButtonProps): boolean { export function directionDisabled(props: DirectionButtonProps): boolean {
const { const {

View File

@ -4,8 +4,7 @@ import { homeAll, findHome } from "../../devices/actions";
import { JogMovementControlsProps } from "./interfaces"; import { JogMovementControlsProps } from "./interfaces";
import { getDevice } from "../../device"; import { getDevice } from "../../device";
import { buildDirectionProps } from "./direction_axes_props"; import { buildDirectionProps } from "./direction_axes_props";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
const DEFAULT_STEP_SIZE = 100; const DEFAULT_STEP_SIZE = 100;
/* /*

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { McuParams } from "farmbot"; import { McuParams } from "farmbot";
import { BotPosition } from "../../devices/interfaces"; import { BotPosition } from "../../devices/interfaces";
import { changeStepSize } from "../../devices/actions"; import { changeStepSize } from "../../devices/actions";
@ -7,6 +7,7 @@ import { StepSizeSelector } from "./step_size_selector";
import { GetWebAppBool } from "./interfaces"; import { GetWebAppBool } from "./interfaces";
import { JogButtons } from "./jog_buttons"; import { JogButtons } from "./jog_buttons";
import { BooleanSetting } from "../../session_keys"; import { BooleanSetting } from "../../session_keys";
import { t } from "../../i18next_wrapper";
interface JogControlsGroupProps { interface JogControlsGroupProps {
dispatch: Function; dispatch: Function;

View File

@ -3,8 +3,9 @@ import { Xyz, LocationName, Dictionary } from "farmbot";
import moment from "moment"; import moment from "moment";
import { BotLocationData, BotPosition } from "../../devices/interfaces"; import { BotLocationData, BotPosition } from "../../devices/interfaces";
import { trim } from "../../util"; import { trim } from "../../util";
import { t } from "i18next";
import { cloneDeep, max, get, isNumber, isEqual, takeRight, ceil, range } from "lodash"; import { cloneDeep, max, get, isNumber, isEqual, takeRight, ceil, range } from "lodash";
import { t } from "../../i18next_wrapper";
const HEIGHT = 50; const HEIGHT = 50;
const HISTORY_LENGTH_SECONDS = 120; const HISTORY_LENGTH_SECONDS = 120;

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Widget, WidgetBody, WidgetHeader } from "../../ui"; import { Widget, WidgetBody, WidgetHeader } from "../../ui";
import { EStopButton } from "../../devices/components/e_stop_btn"; import { EStopButton } from "../../devices/components/e_stop_btn";
import { MustBeOnline } from "../../devices/must_be_online"; import { MustBeOnline } from "../../devices/must_be_online";
@ -14,6 +14,7 @@ import { BotPositionRows } from "./bot_position_rows";
import { MotorPositionPlot } from "./motor_position_plot"; import { MotorPositionPlot } from "./motor_position_plot";
import { Popover, Position } from "@blueprintjs/core"; import { Popover, Position } from "@blueprintjs/core";
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app"; import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";
import { t } from "../../i18next_wrapper";
export class Move extends React.Component<MoveProps, {}> { export class Move extends React.Component<MoveProps, {}> {

View File

@ -1,10 +1,11 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { BooleanSetting } from "../../session_keys"; import { BooleanSetting } from "../../session_keys";
import { ToggleButton } from "../toggle_button"; import { ToggleButton } from "../toggle_button";
import { ToggleWebAppBool, GetWebAppBool } from "./interfaces"; import { ToggleWebAppBool, GetWebAppBool } from "./interfaces";
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app"; import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";
import { DevSettings } from "../../account/dev/dev_support"; import { DevSettings } from "../../account/dev/dev_support";
import { t } from "../../i18next_wrapper";
export const moveWidgetSetting = (toggle: ToggleWebAppBool, getValue: GetWebAppBool) => export const moveWidgetSetting = (toggle: ToggleWebAppBool, getValue: GetWebAppBool) =>
({ label, setting }: { label: string, setting: BooleanConfigKey }) => ({ label, setting }: { label: string, setting: BooleanConfigKey }) =>

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { error } from "farmbot-toastr"; import { error } from "farmbot-toastr";
import { PeripheralList } from "./peripheral_list"; import { PeripheralList } from "./peripheral_list";
import { PeripheralForm } from "./peripheral_form"; import { PeripheralForm } from "./peripheral_form";
@ -10,6 +10,7 @@ import { getArrayStatus } from "../../resources/tagged_resources";
import { saveAll, init } from "../../api/crud"; import { saveAll, init } from "../../api/crud";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { uniq } from "lodash"; import { uniq } from "lodash";
import { t } from "../../i18next_wrapper";
export class Peripherals export class Peripherals
extends React.Component<PeripheralsProps, PeripheralState> { extends React.Component<PeripheralsProps, PeripheralState> {

View File

@ -1,9 +1,10 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { destroy, edit } from "../../api/crud"; import { destroy, edit } from "../../api/crud";
import { PeripheralFormProps } from "./interfaces"; import { PeripheralFormProps } from "./interfaces";
import { sortResourcesById } from "../../util"; import { sortResourcesById } from "../../util";
import { KeyValEditRow } from "../key_val_edit_row"; import { KeyValEditRow } from "../key_val_edit_row";
import { t } from "../../i18next_wrapper";
export function PeripheralForm(props: PeripheralFormProps) { export function PeripheralForm(props: PeripheralFormProps) {
const { dispatch, peripherals } = props; const { dispatch, peripherals } = props;

View File

@ -3,7 +3,7 @@ import { pinToggle } from "../../devices/actions";
import { PeripheralListProps } from "./interfaces"; import { PeripheralListProps } from "./interfaces";
import { sortResourcesById } from "../../util"; import { sortResourcesById } from "../../util";
import { KeyValShowRow } from "../key_val_show_row"; import { KeyValShowRow } from "../key_val_show_row";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export function PeripheralList(props: PeripheralListProps) { export function PeripheralList(props: PeripheralListProps) {
const { pins, disabled } = props; const { pins, disabled } = props;

View File

@ -1,9 +1,10 @@
import * as React from "react"; import * as React from "react";
import moment from "moment"; import moment from "moment";
import { range, clamp } from "lodash"; import { range, clamp } from "lodash";
import { t } from "i18next";
import { SensorReadingPlotProps } from "./interfaces"; import { SensorReadingPlotProps } from "./interfaces";
import { calcEndOfPeriod } from "./filter_readings"; import { calcEndOfPeriod } from "./filter_readings";
import { t } from "../../i18next_wrapper";
/** For SensorReadings plot. */ /** For SensorReadings plot. */
export const calcTimeParams = (timePeriod: number): { export const calcTimeParams = (timePeriod: number): {

View File

@ -1,12 +1,13 @@
import * as React from "react"; import * as React from "react";
import { Row, Col, BlurableInput } from "../../ui"; import { Row, Col, BlurableInput } from "../../ui";
import { t } from "i18next";
import { AxisInputBoxGroupState } from "../interfaces"; import { AxisInputBoxGroupState } from "../interfaces";
import { Xyz } from "../../devices/interfaces"; import { Xyz } from "../../devices/interfaces";
import { AxisInputBox } from "../axis_input_box"; import { AxisInputBox } from "../axis_input_box";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import { LocationSelectionProps } from "./interfaces"; import { LocationSelectionProps } from "./interfaces";
import { parseIntInput } from "../../util"; import { parseIntInput } from "../../util";
import { t } from "../../i18next_wrapper";
/** Select a location filter for sensor readings. */ /** Select a location filter for sensor readings. */
export const LocationSelection = export const LocationSelection =

View File

@ -9,10 +9,11 @@ import {
import { LocationSelection, LocationDisplay } from "./location_selection"; import { LocationSelection, LocationDisplay } from "./location_selection";
import { SensorSelection } from "./sensor_selection"; import { SensorSelection } from "./sensor_selection";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { t } from "i18next";
import { TaggedSensor } from "farmbot"; import { TaggedSensor } from "farmbot";
import { AxisInputBoxGroupState } from "../interfaces"; import { AxisInputBoxGroupState } from "../interfaces";
import { SensorReadingsPlot } from "./graph"; import { SensorReadingsPlot } from "./graph";
import { t } from "../../i18next_wrapper";
export class SensorReadings export class SensorReadings
extends React.Component<SensorReadingsProps, SensorReadingsState> { extends React.Component<SensorReadingsProps, SensorReadingsState> {

View File

@ -1,8 +1,9 @@
import * as React from "react"; import * as React from "react";
import { FBSelect, DropDownItem } from "../../ui"; import { FBSelect, DropDownItem } from "../../ui";
import { t } from "i18next";
import { TaggedSensor } from "farmbot"; import { TaggedSensor } from "farmbot";
import { SensorSelectionProps } from "./interfaces"; import { SensorSelectionProps } from "./interfaces";
import { t } from "../../i18next_wrapper";
const ALL_CHOICE: DropDownItem = { label: t("All"), value: "" }; const ALL_CHOICE: DropDownItem = { label: t("All"), value: "" };

View File

@ -1,9 +1,10 @@
import * as React from "react"; import * as React from "react";
import { SensorReadingsTableProps, TableRowProps } from "./interfaces"; import { SensorReadingsTableProps, TableRowProps } from "./interfaces";
import { t } from "i18next";
import { xyzTableEntry } from "../../logs/components/logs_table"; import { xyzTableEntry } from "../../logs/components/logs_table";
import { formatLogTime } from "../../logs"; import { formatLogTime } from "../../logs";
import moment from "moment"; import moment from "moment";
import { t } from "../../i18next_wrapper";
enum TableColWidth { enum TableColWidth {
sensor = 125, sensor = 125,

View File

@ -1,10 +1,11 @@
import * as React from "react"; import * as React from "react";
import { FBSelect, Row, Col, BlurableInput } from "../../ui"; import { FBSelect, Row, Col, BlurableInput } from "../../ui";
import { t } from "i18next";
import moment from "moment"; import moment from "moment";
import { TaggedSensorReading } from "farmbot"; import { TaggedSensorReading } from "farmbot";
import { TimePeriodSelectionProps, DateDisplayProps } from "./interfaces"; import { TimePeriodSelectionProps, DateDisplayProps } from "./interfaces";
import { cloneDeep } from "lodash"; import { cloneDeep } from "lodash";
import { t } from "../../i18next_wrapper";
/** Look up time period label by seconds. */ /** Look up time period label by seconds. */
const timePeriodLookup = { const timePeriodLookup = {

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { error } from "farmbot-toastr"; import { error } from "farmbot-toastr";
import { SensorList } from "./sensor_list"; import { SensorList } from "./sensor_list";
import { SensorForm } from "./sensor_form"; import { SensorForm } from "./sensor_form";
@ -10,6 +10,7 @@ import { getArrayStatus } from "../../resources/tagged_resources";
import { saveAll, init } from "../../api/crud"; import { saveAll, init } from "../../api/crud";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { uniq } from "lodash"; import { uniq } from "lodash";
import { t } from "../../i18next_wrapper";
export class Sensors extends React.Component<SensorsProps, SensorState> { export class Sensors extends React.Component<SensorsProps, SensorState> {
constructor(props: SensorsProps) { constructor(props: SensorsProps) {

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { destroy, edit } from "../../api/crud"; import { destroy, edit } from "../../api/crud";
import { SensorFormProps } from "./interfaces"; import { SensorFormProps } from "./interfaces";
import { sortResourcesById } from "../../util"; import { sortResourcesById } from "../../util";
@ -8,6 +8,7 @@ import {
pinDropdowns pinDropdowns
} from "../../sequences/step_tiles/pin_and_peripheral_support"; } from "../../sequences/step_tiles/pin_and_peripheral_support";
import { PIN_MODES } from "../../sequences/step_tiles/tile_pin_support"; import { PIN_MODES } from "../../sequences/step_tiles/tile_pin_support";
import { t } from "../../i18next_wrapper";
export function SensorForm(props: SensorFormProps) { export function SensorForm(props: SensorFormProps) {
const { dispatch, sensors } = props; const { dispatch, sensors } = props;

View File

@ -3,9 +3,10 @@ import { readPin } from "../../devices/actions";
import { SensorListProps } from "./interfaces"; import { SensorListProps } from "./interfaces";
import { sortResourcesById } from "../../util"; import { sortResourcesById } from "../../util";
import { Row, Col } from "../../ui"; import { Row, Col } from "../../ui";
import { t } from "i18next";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import { ALLOWED_PIN_MODES } from "farmbot"; import { ALLOWED_PIN_MODES } from "farmbot";
import { t } from "../../i18next_wrapper";
const SensorReadingDisplay = const SensorReadingDisplay =
({ label, value, mode }: ({ label, value, mode }:

View File

@ -1,6 +1,7 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { ToggleButtonProps } from "./interfaces"; import { ToggleButtonProps } from "./interfaces";
import { t } from "../i18next_wrapper";
export class ToggleButton extends React.Component<ToggleButtonProps, {}> { export class ToggleButton extends React.Component<ToggleButtonProps, {}> {
caption() { caption() {

View File

@ -1,11 +1,12 @@
import * as React from "react"; import * as React from "react";
import { Widget, WidgetHeader, WidgetBody } from "../../ui/index"; import { Widget, WidgetHeader, WidgetBody } from "../../ui/index";
import { t } from "i18next";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { WebcamPanelProps } from "./interfaces"; import { WebcamPanelProps } from "./interfaces";
import { KeyValEditRow } from "../key_val_edit_row"; import { KeyValEditRow } from "../key_val_edit_row";
import { SpecialStatus, TaggedWebcamFeed } from "farmbot"; import { SpecialStatus, TaggedWebcamFeed } from "farmbot";
import { sortBy } from "lodash"; import { sortBy } from "lodash";
import { t } from "../../i18next_wrapper";
export function sortedFeeds(feeds: TaggedWebcamFeed[]): TaggedWebcamFeed[] { export function sortedFeeds(feeds: TaggedWebcamFeed[]): TaggedWebcamFeed[] {
return sortBy(feeds, (f) => { return f.body.id || Infinity; }); return sortBy(feeds, (f) => { return f.body.id || Infinity; });

View File

@ -5,8 +5,9 @@ import { WebcamPanelProps } from "./interfaces";
import { TaggedWebcamFeed, SpecialStatus } from "farmbot"; import { TaggedWebcamFeed, SpecialStatus } from "farmbot";
import { edit, save, destroy, init } from "../../api/crud"; import { edit, save, destroy, init } from "../../api/crud";
import { error } from "farmbot-toastr"; import { error } from "farmbot-toastr";
import { t } from "i18next";
import { WebcamFeed } from "farmbot/dist/resources/api_resources"; import { WebcamFeed } from "farmbot/dist/resources/api_resources";
import { t } from "../../i18next_wrapper";
const HTTP = "http://"; const HTTP = "http://";

View File

@ -1,11 +1,12 @@
import * as React from "react"; import * as React from "react";
import { Widget, WidgetHeader, FallbackImg, WidgetBody } from "../../ui/index"; import { Widget, WidgetHeader, FallbackImg, WidgetBody } from "../../ui/index";
import { t } from "i18next";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { WebcamPanelProps } from "./interfaces"; import { WebcamPanelProps } from "./interfaces";
import { PLACEHOLDER_FARMBOT } from "../../farmware/images/image_flipper"; import { PLACEHOLDER_FARMBOT } from "../../farmware/images/image_flipper";
import { Flipper } from "./flipper"; import { Flipper } from "./flipper";
import { sortedFeeds } from "./edit"; import { sortedFeeds } from "./edit";
import { t } from "../../i18next_wrapper";
type State = { type State = {
/** Current index in the webcam feed list. /** Current index in the webcam feed list.

View File

@ -1,4 +1,4 @@
import { t } from "i18next";
import axios from "axios"; import axios from "axios";
import { success, warning, info, error } from "farmbot-toastr"; import { success, warning, info, error } from "farmbot-toastr";
import { getDevice } from "../device"; import { getDevice } from "../device";
@ -23,6 +23,7 @@ import { FbosConfig } from "farmbot/dist/resources/configs/fbos";
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware"; import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
import { getFirmwareConfig, getFbosConfig } from "../resources/getters"; import { getFirmwareConfig, getFbosConfig } from "../resources/getters";
import { isObject, isString, get, noop } from "lodash"; import { isObject, isString, get, noop } from "lodash";
import { t } from "../i18next_wrapper";
const ON = 1, OFF = 0; const ON = 1, OFF = 0;
export type ConfigKey = keyof McuParams; export type ConfigKey = keyof McuParams;

View File

@ -3,7 +3,7 @@ import { Row, Col } from "../../ui";
import { TaggedDiagnosticDump } from "farmbot"; import { TaggedDiagnosticDump } from "farmbot";
import { destroy } from "../../api/crud"; import { destroy } from "../../api/crud";
import { ago } from "../connectivity/status_checks"; import { ago } from "../connectivity/status_checks";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export interface Props { export interface Props {
diag: TaggedDiagnosticDump; diag: TaggedDiagnosticDump;
@ -20,8 +20,7 @@ export class DiagnosticDumpRow extends React.Component<Props, {}> {
render() { render() {
return <Row> return <Row>
<Col xsOffset={3} xs={8}> <Col xsOffset={3} xs={8}>
{t("Report {{ticket}} (Saved {{age}})", {t("Report {{ticket}} (Saved {{age}})", { ticket: this.ticket, age: this.age })}
{ ticket: this.ticket, age: this.age })}
</Col> </Col>
<Col xs={1}> <Col xs={1}>
<button <button

View File

@ -1,8 +1,9 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { emergencyLock, emergencyUnlock } from "../actions"; import { emergencyLock, emergencyUnlock } from "../actions";
import { EStopButtonProps } from "../interfaces"; import { EStopButtonProps } from "../interfaces";
import { isBotUp } from "../must_be_online"; import { isBotUp } from "../must_be_online";
import { t } from "../../i18next_wrapper";
export class EStopButton extends React.Component<EStopButtonProps, {}> { export class EStopButton extends React.Component<EStopButtonProps, {}> {
render() { render() {

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { FarmbotOsProps, FarmbotOsState } from "../interfaces"; import { FarmbotOsProps, FarmbotOsState } from "../interfaces";
import { import {
Widget, Widget,
@ -25,6 +25,7 @@ import { PowerAndReset } from "./fbos_settings/power_and_reset";
import { SendDiagnosticReport } from "./send_diagnostic_report"; import { SendDiagnosticReport } from "./send_diagnostic_report";
import axios from "axios"; import axios from "axios";
import { t } from "../../i18next_wrapper";
export enum ColWidth { export enum ColWidth {
label = 3, label = 3,

View File

@ -1,11 +1,12 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { t } from "i18next";
import { ToggleButton } from "../../../controls/toggle_button"; import { ToggleButton } from "../../../controls/toggle_button";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { updateConfig } from "../../actions"; import { updateConfig } from "../../actions";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { AutoSyncRowProps } from "./interfaces"; import { AutoSyncRowProps } from "./interfaces";
import { t } from "../../../i18next_wrapper";
export function AutoSyncRow(props: AutoSyncRowProps) { export function AutoSyncRow(props: AutoSyncRowProps) {
const autoSync = props.sourceFbosConfig("auto_sync"); const autoSync = props.sourceFbosConfig("auto_sync");

View File

@ -1,11 +1,12 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { t } from "i18next";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { ToggleButton } from "../../../controls/toggle_button"; import { ToggleButton } from "../../../controls/toggle_button";
import { updateConfig } from "../../actions"; import { updateConfig } from "../../actions";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { AutoUpdateRowProps } from "./interfaces"; import { AutoUpdateRowProps } from "./interfaces";
import { t } from "../../../i18next_wrapper";
export function AutoUpdateRow(props: AutoUpdateRowProps) { export function AutoUpdateRow(props: AutoUpdateRowProps) {
const osAutoUpdate = props.sourceFbosConfig("os_auto_update"); const osAutoUpdate = props.sourceFbosConfig("os_auto_update");

View File

@ -1,12 +1,13 @@
import * as React from "react"; import * as React from "react";
import { Row, Col, DropDownItem, FBSelect } from "../../../ui/index"; import { Row, Col, DropDownItem, FBSelect } from "../../../ui/index";
import { t } from "i18next";
import { info } from "farmbot-toastr"; import { info } from "farmbot-toastr";
import { FirmwareHardware } from "farmbot"; import { FirmwareHardware } from "farmbot";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { updateConfig } from "../../actions"; import { updateConfig } from "../../actions";
import { BoardTypeProps } from "./interfaces"; import { BoardTypeProps } from "./interfaces";
import { Feature } from "../../interfaces"; import { Feature } from "../../interfaces";
import { t } from "../../../i18next_wrapper";
const ARDUINO = { label: "Arduino/RAMPS (Genesis v1.2)", value: "arduino" }; const ARDUINO = { label: "Arduino/RAMPS (Genesis v1.2)", value: "arduino" };
const FARMDUINO = { label: "Farmduino (Genesis v1.3)", value: "farmduino" }; const FARMDUINO = { label: "Farmduino (Genesis v1.3)", value: "farmduino" };

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { DropDownItem, Row, Col, FBSelect } from "../../../ui/index"; import { DropDownItem, Row, Col, FBSelect } from "../../../ui/index";
import { t } from "i18next";
import { import {
CameraSelectionProps, CameraSelectionState CameraSelectionProps, CameraSelectionState
} from "./interfaces"; } from "./interfaces";
@ -8,6 +8,7 @@ import { info, success, error } from "farmbot-toastr";
import { getDevice } from "../../../device"; import { getDevice } from "../../../device";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { Feature } from "../../interfaces"; import { Feature } from "../../interfaces";
import { t } from "../../../i18next_wrapper";
const CAMERA_CHOICES = [ const CAMERA_CHOICES = [
{ label: t("USB Camera"), value: "USB" }, { label: t("USB Camera"), value: "USB" },

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { Row, Col, BlurableInput } from "../../../ui/index"; import { Row, Col, BlurableInput } from "../../../ui/index";
import { t } from "i18next";
import { success, error } from "farmbot-toastr"; import { success, error } from "farmbot-toastr";
import { getDevice } from "../../../device"; import { getDevice } from "../../../device";
import { transferOwnership } from "../../transfer_ownership/transfer_ownership"; import { transferOwnership } from "../../transfer_ownership/transfer_ownership";
@ -8,6 +8,7 @@ import { API } from "../../../api";
import { NonsecureContentWarning } from "./nonsecure_content_warning"; import { NonsecureContentWarning } from "./nonsecure_content_warning";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { BlurablePassword } from "../../../ui/blurable_password"; import { BlurablePassword } from "../../../ui/blurable_password";
import { t } from "../../../i18next_wrapper";
interface ChangeOwnershipFormState { interface ChangeOwnershipFormState {
email: string; email: string;

View File

@ -1,12 +1,13 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { t } from "i18next";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { factoryReset, updateConfig } from "../../actions"; import { factoryReset, updateConfig } from "../../actions";
import { ToggleButton } from "../../../controls/toggle_button"; import { ToggleButton } from "../../../controls/toggle_button";
import { BotConfigInputBox } from "../bot_config_input_box"; import { BotConfigInputBox } from "../bot_config_input_box";
import { FactoryResetRowProps } from "./interfaces"; import { FactoryResetRowProps } from "./interfaces";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { t } from "../../../i18next_wrapper";
export function FactoryResetRow(props: FactoryResetRowProps) { export function FactoryResetRow(props: FactoryResetRowProps) {
const { dispatch, sourceFbosConfig, botOnline } = props; const { dispatch, sourceFbosConfig, botOnline } = props;

View File

@ -1,11 +1,12 @@
import * as React from "react"; import * as React from "react";
import { Row, Col, Markdown } from "../../../ui/index"; import { Row, Col, Markdown } from "../../../ui/index";
import { t } from "i18next";
import { OsUpdateButton } from "./os_update_button"; import { OsUpdateButton } from "./os_update_button";
import { Popover, Position } from "@blueprintjs/core"; import { Popover, Position } from "@blueprintjs/core";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { FarmbotOsRowProps } from "./interfaces"; import { FarmbotOsRowProps } from "./interfaces";
import { FbosDetails } from "./fbos_details"; import { FbosDetails } from "./fbos_details";
import { t } from "../../../i18next_wrapper";
const getVersionString = const getVersionString =
(fbosVersion: string | undefined, onBeta: boolean | undefined): string => { (fbosVersion: string | undefined, onBeta: boolean | undefined): string => {

View File

@ -1,7 +1,8 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../../../ui"; import { Row, Col } from "../../../ui";
import { t } from "i18next";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { t } from "../../../i18next_wrapper";
export interface FbosButtonRowProps { export interface FbosButtonRowProps {
botOnline: boolean; botOnline: boolean;

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { Saucer } from "../../../ui/index"; import { Saucer } from "../../../ui/index";
import { t } from "i18next";
import { ToggleButton } from "../../../controls/toggle_button"; import { ToggleButton } from "../../../controls/toggle_button";
import { updateConfig } from "../../actions"; import { updateConfig } from "../../actions";
import { last, isNumber } from "lodash"; import { last, isNumber } from "lodash";
@ -8,6 +8,7 @@ import { Content } from "../../../constants";
import { FbosDetailsProps } from "./interfaces"; import { FbosDetailsProps } from "./interfaces";
import { SourceFbosConfig, ShouldDisplay, Feature } from "../../interfaces"; import { SourceFbosConfig, ShouldDisplay, Feature } from "../../interfaces";
import { ConfigurationName } from "farmbot"; import { ConfigurationName } from "farmbot";
import { t } from "../../../i18next_wrapper";
/** Return an indicator color for the given temperature (C). */ /** Return an indicator color for the given temperature (C). */
export const colorFromTemp = (temp: number | undefined): string => { export const colorFromTemp = (temp: number | undefined): string => {

View File

@ -1,10 +1,11 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { t } from "i18next";
import moment from "moment"; import moment from "moment";
import { TaggedDevice } from "farmbot"; import { TaggedDevice } from "farmbot";
import { ColWidth } from "../farmbot_os_settings"; import { ColWidth } from "../farmbot_os_settings";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { t } from "../../../i18next_wrapper";
export interface LastSeenProps { export interface LastSeenProps {
onClick?(): void; onClick?(): void;

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { JobProgress, ConfigurationName } from "farmbot/dist"; import { JobProgress, ConfigurationName } from "farmbot/dist";
import { SemverResult, semverCompare } from "../../../util"; import { SemverResult, semverCompare } from "../../../util";
import { OsUpdateButtonProps } from "./interfaces"; import { OsUpdateButtonProps } from "./interfaces";
@ -7,6 +7,7 @@ import { checkControllerUpdates } from "../../actions";
import { isString } from "lodash"; import { isString } from "lodash";
import { BotState, Feature } from "../../interfaces"; import { BotState, Feature } from "../../interfaces";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { t } from "../../../i18next_wrapper";
/** FBOS update button states. */ /** FBOS update button states. */
enum UpdateButton { upToDate, needsUpdate, unknown, none } enum UpdateButton { upToDate, needsUpdate, unknown, none }

View File

@ -4,11 +4,12 @@ import { Collapse, Popover, Position } from "@blueprintjs/core";
import { FactoryResetRow } from "./factory_reset_row"; import { FactoryResetRow } from "./factory_reset_row";
import { PowerAndResetProps } from "./interfaces"; import { PowerAndResetProps } from "./interfaces";
import { ChangeOwnershipForm } from "./change_ownership_form"; import { ChangeOwnershipForm } from "./change_ownership_form";
import { t } from "i18next";
import { Feature } from "../../interfaces"; import { Feature } from "../../interfaces";
import { FbosButtonRow } from "./fbos_button_row"; import { FbosButtonRow } from "./fbos_button_row";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { reboot, powerOff, restartFirmware } from "../../actions"; import { reboot, powerOff, restartFirmware } from "../../actions";
import { t } from "../../../i18next_wrapper";
export function PowerAndReset(props: PowerAndResetProps) { export function PowerAndReset(props: PowerAndResetProps) {
const { dispatch, sourceFbosConfig, shouldDisplay, botOnline } = props; const { dispatch, sourceFbosConfig, shouldDisplay, botOnline } = props;

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { MCUFactoryReset, bulkToggleControlPanel } from "../actions"; import { MCUFactoryReset, bulkToggleControlPanel } from "../actions";
import { Widget, WidgetHeader, WidgetBody, SaveBtn } from "../../ui/index"; import { Widget, WidgetHeader, WidgetBody, SaveBtn } from "../../ui/index";
import { HardwareSettingsProps } from "../interfaces"; import { HardwareSettingsProps } from "../interfaces";
@ -16,6 +16,7 @@ import {
import { SpecialStatus } from "farmbot"; import { SpecialStatus } from "farmbot";
import { Popover, Position } from "@blueprintjs/core"; import { Popover, Position } from "@blueprintjs/core";
import { FwParamExportMenu } from "./hardware_settings/export_menu"; import { FwParamExportMenu } from "./hardware_settings/export_menu";
import { t } from "../../i18next_wrapper";
export class HardwareSettings extends export class HardwareSettings extends
React.Component<HardwareSettingsProps, {}> { React.Component<HardwareSettingsProps, {}> {

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { getDevice } from "../../../device"; import { getDevice } from "../../../device";
import { Axis } from "../../interfaces"; import { Axis } from "../../interfaces";
import { LockableButton } from "../lockable_button"; import { LockableButton } from "../lockable_button";
@ -8,6 +8,7 @@ import { ToolTips } from "../../../constants";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { CalibrationRowProps } from "../interfaces"; import { CalibrationRowProps } from "../interfaces";
import { commandErr } from "../../actions"; import { commandErr } from "../../actions";
import { t } from "../../../i18next_wrapper";
const calibrate = (axis: Axis) => getDevice() const calibrate = (axis: Axis) => getDevice()
.calibrate({ axis }) .calibrate({ axis })

View File

@ -1,10 +1,11 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { DangerZoneProps } from "../interfaces"; import { DangerZoneProps } from "../interfaces";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { Header } from "./header"; import { Header } from "./header";
import { Collapse } from "@blueprintjs/core"; import { Collapse } from "@blueprintjs/core";
import { Content } from "../../../constants"; import { Content } from "../../../constants";
import { t } from "../../../i18next_wrapper";
export function DangerZone(props: DangerZoneProps) { export function DangerZone(props: DangerZoneProps) {

View File

@ -1,7 +1,8 @@
import * as React from "react"; import * as React from "react";
import { McuParams, Encoder, McuParamName } from "farmbot/dist"; import { McuParams, Encoder, McuParamName } from "farmbot/dist";
import { t } from "i18next";
import { FBSelect, DropDownItem } from "../../../ui/index"; import { FBSelect, DropDownItem } from "../../../ui/index";
import { t } from "../../../i18next_wrapper";
export interface EncoderTypeProps { export interface EncoderTypeProps {
hardware: McuParams; hardware: McuParams;

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { BooleanMCUInputGroup } from "../boolean_mcu_input_group"; import { BooleanMCUInputGroup } from "../boolean_mcu_input_group";
import { ToolTips } from "../../../constants"; import { ToolTips } from "../../../constants";
import { NumericMCUInputGroup } from "../numeric_mcu_input_group"; import { NumericMCUInputGroup } from "../numeric_mcu_input_group";
@ -7,6 +6,7 @@ import { EncodersProps } from "../interfaces";
import { Header } from "./header"; import { Header } from "./header";
import { Collapse } from "@blueprintjs/core"; import { Collapse } from "@blueprintjs/core";
import { Feature } from "../../interfaces"; import { Feature } from "../../interfaces";
import { t } from "../../../i18next_wrapper";
export function EncodersAndEndStops(props: EncodersProps) { export function EncodersAndEndStops(props: EncodersProps) {

View File

@ -1,7 +1,8 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { ControlPanelState } from "../../interfaces"; import { ControlPanelState } from "../../interfaces";
import { toggleControlPanel } from "../../actions"; import { toggleControlPanel } from "../../actions";
import { t } from "../../../i18next_wrapper";
interface Props { interface Props {
dispatch: Function; dispatch: Function;

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { BooleanMCUInputGroup } from "../boolean_mcu_input_group"; import { BooleanMCUInputGroup } from "../boolean_mcu_input_group";
import { ToolTips } from "../../../constants"; import { ToolTips } from "../../../constants";
import { NumericMCUInputGroup } from "../numeric_mcu_input_group"; import { NumericMCUInputGroup } from "../numeric_mcu_input_group";
@ -11,6 +10,7 @@ import { HomingAndCalibrationProps } from "../interfaces";
import { Header } from "./header"; import { Header } from "./header";
import { Collapse } from "@blueprintjs/core"; import { Collapse } from "@blueprintjs/core";
import { minFwVersionCheck } from "../../../util"; import { minFwVersionCheck } from "../../../util";
import { t } from "../../../i18next_wrapper";
export function HomingAndCalibration(props: HomingAndCalibrationProps) { export function HomingAndCalibration(props: HomingAndCalibrationProps) {

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { HomingRowProps } from "../interfaces"; import { HomingRowProps } from "../interfaces";
import { LockableButton } from "../lockable_button"; import { LockableButton } from "../lockable_button";
import { axisTrackingStatus } from "../axis_tracking_status"; import { axisTrackingStatus } from "../axis_tracking_status";
@ -10,6 +9,7 @@ import { CONFIG_DEFAULTS } from "farmbot/dist/config";
import { commandErr } from "../../actions"; import { commandErr } from "../../actions";
import { Axis } from "../../interfaces"; import { Axis } from "../../interfaces";
import { getDevice } from "../../../device"; import { getDevice } from "../../../device";
import { t } from "../../../i18next_wrapper";
const speed = CONFIG_DEFAULTS.speed; const speed = CONFIG_DEFAULTS.speed;
const findHome = (axis: Axis) => getDevice() const findHome = (axis: Axis) => getDevice()

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { BooleanMCUInputGroup } from "../boolean_mcu_input_group"; import { BooleanMCUInputGroup } from "../boolean_mcu_input_group";
import { ToolTips } from "../../../constants"; import { ToolTips } from "../../../constants";
import { SpacePanelToolTip } from "../space_panel_tool_tip"; import { SpacePanelToolTip } from "../space_panel_tool_tip";
@ -12,6 +11,7 @@ import { Header } from "./header";
import { Collapse } from "@blueprintjs/core"; import { Collapse } from "@blueprintjs/core";
import { McuInputBox } from "../mcu_input_box"; import { McuInputBox } from "../mcu_input_box";
import { minFwVersionCheck } from "../../../util"; import { minFwVersionCheck } from "../../../util";
import { t } from "../../../i18next_wrapper";
const SingleSettingRow = const SingleSettingRow =
({ label, tooltip, settingType, children }: { ({ label, tooltip, settingType, children }: {

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { PinGuardMCUInputGroup } from "../pin_guard_input_group"; import { PinGuardMCUInputGroup } from "../pin_guard_input_group";
import { PinGuardProps } from "../interfaces"; import { PinGuardProps } from "../interfaces";
import { Header } from "./header"; import { Header } from "./header";
@ -7,6 +7,7 @@ import { Collapse } from "@blueprintjs/core";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { SpacePanelToolTip } from "../space_panel_tool_tip"; import { SpacePanelToolTip } from "../space_panel_tool_tip";
import { ToolTips } from "../../../constants"; import { ToolTips } from "../../../constants";
import { t } from "../../../i18next_wrapper";
export function PinGuard(props: PinGuardProps) { export function PinGuard(props: PinGuardProps) {

View File

@ -1,6 +1,7 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { t } from "../../../i18next_wrapper";
export function SpacePanelHeader(_: {}) { export function SpacePanelHeader(_: {}) {
return <Row> return <Row>

View File

@ -1,11 +1,12 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { getDevice } from "../../../device"; import { getDevice } from "../../../device";
import { Axis } from "../../interfaces"; import { Axis } from "../../interfaces";
import { ToolTips } from "../../../constants"; import { ToolTips } from "../../../constants";
import { Row, Col } from "../../../ui/index"; import { Row, Col } from "../../../ui/index";
import { ZeroRowProps } from "../interfaces"; import { ZeroRowProps } from "../interfaces";
import { commandErr } from "../../actions"; import { commandErr } from "../../actions";
import { t } from "../../../i18next_wrapper";
const zero = const zero =
(axis: Axis) => getDevice().setZero(axis).catch(commandErr("Zeroing")); (axis: Axis) => getDevice().setZero(axis).catch(commandErr("Zeroing"));

View File

@ -6,8 +6,9 @@ import { BlurableInput } from "../../ui/index";
import { import {
clampUnsignedInteger, IntegerSize, getMaxInputFromIntSize clampUnsignedInteger, IntegerSize, getMaxInputFromIntSize
} from "../../util"; } from "../../util";
import { t } from "i18next";
import { isUndefined } from "lodash"; import { isUndefined } from "lodash";
import { t } from "../../i18next_wrapper";
export class McuInputBox extends React.Component<McuInputBoxProps, {}> { export class McuInputBox extends React.Component<McuInputBoxProps, {}> {

View File

@ -4,8 +4,9 @@ import { PinGuardMCUInputGroupProps } from "./interfaces";
import { Row, Col } from "../../ui/index"; import { Row, Col } from "../../ui/index";
import { settingToggle } from "../actions"; import { settingToggle } from "../actions";
import { ToggleButton } from "../../controls/toggle_button"; import { ToggleButton } from "../../controls/toggle_button";
import { t } from "i18next";
import { isUndefined } from "lodash"; import { isUndefined } from "lodash";
import { t } from "../../i18next_wrapper";
export function PinGuardMCUInputGroup(props: PinGuardMCUInputGroupProps) { export function PinGuardMCUInputGroup(props: PinGuardMCUInputGroupProps) {

View File

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import { Row, Col } from "../../ui"; import { Row, Col } from "../../ui";
import { ColWidth } from "./farmbot_os_settings"; import { ColWidth } from "./farmbot_os_settings";
import { t } from "i18next";
import { Collapse } from "@blueprintjs/core"; import { Collapse } from "@blueprintjs/core";
import { Header } from "./hardware_settings/header"; import { Header } from "./hardware_settings/header";
import { ShouldDisplay, Feature } from "../interfaces"; import { ShouldDisplay, Feature } from "../interfaces";
@ -9,6 +9,7 @@ import { TaggedDiagnosticDump } from "farmbot";
import { DiagnosticDumpRow } from "./diagnostic_dump_row"; import { DiagnosticDumpRow } from "./diagnostic_dump_row";
import { requestDiagnostic } from "../actions"; import { requestDiagnostic } from "../actions";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { t } from "../../i18next_wrapper";
export interface DiagReportProps { export interface DiagReportProps {
dispatch: Function; dispatch: Function;

View File

@ -1,5 +1,6 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
interface SPTTProps { interface SPTTProps {
tooltip?: string | undefined; tooltip?: string | undefined;

View File

@ -3,7 +3,8 @@ import { DiagnosticMessages } from "./diagnostic_messages";
import { Col, Row } from "../../ui/index"; import { Col, Row } from "../../ui/index";
import { bitArray } from "../../util"; import { bitArray } from "../../util";
import { TRUTH_TABLE } from "./truth_table"; import { TRUTH_TABLE } from "./truth_table";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export type DiagnosisName = export type DiagnosisName =
| "userAPI" | "userAPI"

View File

@ -1,5 +1,5 @@
import { trim } from "../../util"; import { trim } from "../../util";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export namespace DiagnosticMessages { export namespace DiagnosticMessages {
// "SCV good to go, sir." is also appropriate. // "SCV good to go, sir." is also appropriate.

View File

@ -2,7 +2,7 @@ import * as React from "react";
import { StatusRowProps } from "./connectivity_row"; import { StatusRowProps } from "./connectivity_row";
import { CowardlyDictionary } from "../../util"; import { CowardlyDictionary } from "../../util";
import { Color } from "../../ui/index"; import { Color } from "../../ui/index";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
export interface ConnectivityDiagramProps { export interface ConnectivityDiagramProps {
rowData: StatusRowProps[]; rowData: StatusRowProps[];

View File

@ -1,6 +1,5 @@
import * as React from "react"; import * as React from "react";
import { Widget, WidgetHeader, WidgetBody, Row, Col } from "../../ui/index"; import { Widget, WidgetHeader, WidgetBody, Row, Col } from "../../ui/index";
import { t } from "i18next";
import { ConnectivityRow, StatusRowProps } from "./connectivity_row"; import { ConnectivityRow, StatusRowProps } from "./connectivity_row";
import { RetryBtn } from "./retry_btn"; import { RetryBtn } from "./retry_btn";
import { SpecialStatus, InformationalSettings } from "farmbot"; import { SpecialStatus, InformationalSettings } from "farmbot";
@ -9,6 +8,7 @@ import { ToolTips } from "../../constants";
import { import {
ChipTemperatureDisplay, WiFiStrengthDisplay ChipTemperatureDisplay, WiFiStrengthDisplay
} from "../components/fbos_settings/fbos_details"; } from "../components/fbos_settings/fbos_details";
import { t } from "../../i18next_wrapper";
interface Props { interface Props {
onRefresh(): void; onRefresh(): void;

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { SpecialStatus } from "farmbot"; import { SpecialStatus } from "farmbot";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
interface RetryBtnProps { interface RetryBtnProps {
flags: boolean[]; flags: boolean[];

View File

@ -2,7 +2,7 @@ import { isUndefined } from "lodash";
import moment from "moment"; import moment from "moment";
import { StatusRowProps } from "./connectivity_row"; import { StatusRowProps } from "./connectivity_row";
import { ConnectionStatus } from "../../connectivity/interfaces"; import { ConnectionStatus } from "../../connectivity/interfaces";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
const HOUR = 1000 * 60 * 60; const HOUR = 1000 * 60 * 60;

View File

@ -1,8 +1,8 @@
import * as React from "react"; import * as React from "react";
import { NetworkState } from "../connectivity/interfaces"; import { NetworkState } from "../connectivity/interfaces";
import { SyncStatus } from "farmbot"; import { SyncStatus } from "farmbot";
import { t } from "i18next";
import { Content } from "../constants"; import { Content } from "../constants";
import { t } from "../i18next_wrapper";
/** Properties for the <MustBeOnline/> element. */ /** Properties for the <MustBeOnline/> element. */
export interface MBOProps { export interface MBOProps {

View File

@ -1,4 +1,4 @@
import { t } from "i18next";
import { import {
PinBindingType, PinBindingType,
PinBindingSpecialAction PinBindingSpecialAction
@ -7,6 +7,7 @@ import { DropDownItem } from "../../ui";
import { gpio } from "./rpi_gpio_diagram"; import { gpio } from "./rpi_gpio_diagram";
import { flattenDeep, isNumber } from "lodash"; import { flattenDeep, isNumber } from "lodash";
import { sysBtnBindings } from "./tagged_pin_binding_init"; import { sysBtnBindings } from "./tagged_pin_binding_init";
import { t } from "../../i18next_wrapper";
export const bindingTypeLabelLookup: { [x: string]: string } = { export const bindingTypeLabelLookup: { [x: string]: string } = {
[PinBindingType.standard]: t("Sequence"), [PinBindingType.standard]: t("Sequence"),

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Row, Col, FBSelect, NULL_CHOICE, DropDownItem } from "../../ui"; import { Row, Col, FBSelect, NULL_CHOICE, DropDownItem } from "../../ui";
import { PinBindingColWidth } from "./pin_bindings"; import { PinBindingColWidth } from "./pin_bindings";
import { Popover, Position } from "@blueprintjs/core"; import { Popover, Position } from "@blueprintjs/core";
@ -23,6 +23,7 @@ import { ResourceIndex } from "../../resources/interfaces";
import { import {
PinBindingType, PinBindingSpecialAction PinBindingType, PinBindingSpecialAction
} from "farmbot/dist/resources/api_resources"; } from "farmbot/dist/resources/api_resources";
import { t } from "../../i18next_wrapper";
export class PinBindingInputGroup export class PinBindingInputGroup
extends React.Component<PinBindingInputGroupProps, PinBindingInputGroupState> { extends React.Component<PinBindingInputGroupProps, PinBindingInputGroupState> {

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Widget, WidgetBody, WidgetHeader, Row, Col } from "../../ui"; import { Widget, WidgetBody, WidgetHeader, Row, Col } from "../../ui";
import { ToolTips } from "../../constants"; import { ToolTips } from "../../constants";
import { selectAllPinBindings } from "../../resources/selectors"; import { selectAllPinBindings } from "../../resources/selectors";
@ -16,6 +15,7 @@ import {
PinBindingType, PinBindingType,
PinBinding PinBinding
} from "farmbot/dist/resources/api_resources"; } from "farmbot/dist/resources/api_resources";
import { t } from "../../i18next_wrapper";
/** Width of UI columns in Pin Bindings widget. */ /** Width of UI columns in Pin Bindings widget. */
export enum PinBindingColWidth { export enum PinBindingColWidth {

View File

@ -1,5 +1,4 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { import {
bindingTypeLabelLookup, specialActionLabelLookup, bindingTypeLabelLookup, specialActionLabelLookup,
generatePinLabel, sortByNameAndPin generatePinLabel, sortByNameAndPin
@ -11,6 +10,7 @@ import { findSequenceById } from "../../resources/selectors";
import { PinBindingColWidth } from "./pin_bindings"; import { PinBindingColWidth } from "./pin_bindings";
import { PinBindingsListProps } from "./interfaces"; import { PinBindingsListProps } from "./interfaces";
import { sysBtnBindings } from "./tagged_pin_binding_init"; import { sysBtnBindings } from "./tagged_pin_binding_init";
import { t } from "../../i18next_wrapper";
export const PinBindingsList = (props: PinBindingsListProps) => { export const PinBindingsList = (props: PinBindingsListProps) => {
const { pinBindings, resources, dispatch } = props; const { pinBindings, resources, dispatch } = props;

View File

@ -7,7 +7,7 @@ import {
import { PinBindingListItems } from "./interfaces"; import { PinBindingListItems } from "./interfaces";
import { stockPinBindings } from "./list_and_label_support"; import { stockPinBindings } from "./list_and_label_support";
import { initSave } from "../../api/crud"; import { initSave } from "../../api/crud";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
/** Return the correct Pin Binding resource according to binding type. */ /** Return the correct Pin Binding resource according to binding type. */
export const pinBindingBody = export const pinBindingBody =

View File

@ -1,6 +1,7 @@
import { t } from "i18next";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { isString } from "lodash"; import { isString } from "lodash";
import { t } from "../../i18next_wrapper";
/** Used for every new account the first time the Device page is loaded. */ /** Used for every new account the first time the Device page is loaded. */
const ONLY_ONCE = { const ONLY_ONCE = {

View File

@ -6,10 +6,11 @@
import { detectLanguage } from "./i18n"; import { detectLanguage } from "./i18n";
import { shortRevision } from "./util"; import { shortRevision } from "./util";
import { stopIE } from "./util/stop_ie"; import { stopIE } from "./util/stop_ie";
import { init } from "i18next";
import { attachAppToDom } from "./routes"; import { attachAppToDom } from "./routes";
import I from "i18next";
stopIE(); stopIE();
console.log(shortRevision()); console.log(shortRevision());
detectLanguage().then(config => init(config, attachAppToDom)); detectLanguage().then(config => I.init(config, attachAppToDom));

View File

@ -1,6 +1,7 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { Widget, WidgetHeader, WidgetBody } from "../ui"; import { Widget, WidgetHeader, WidgetBody } from "../ui";
import { t } from "../i18next_wrapper";
/* /*
* Widget to display if the desired widget fails to load. * Widget to display if the desired widget fails to load.

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import moment from "moment"; import moment from "moment";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { mapStateToPropsAddEdit, } from "./map_state_to_props_add_edit"; import { mapStateToPropsAddEdit, } from "./map_state_to_props_add_edit";
@ -17,6 +17,7 @@ import {
DesignerPanel, DesignerPanelHeader, DesignerPanelContent DesignerPanel, DesignerPanelHeader, DesignerPanelContent
} from "../plants/designer_panel"; } from "../plants/designer_panel";
import { variableList } from "../../sequences/locals_list/variable_support"; import { variableList } from "../../sequences/locals_list/variable_support";
import { t } from "../../i18next_wrapper";
interface State { interface State {
uuid: string; uuid: string;

View File

@ -5,7 +5,8 @@ import { mapStateToPropsAddEdit } from "./map_state_to_props_add_edit";
import { history } from "../../history"; import { history } from "../../history";
import { TaggedFarmEvent } from "farmbot"; import { TaggedFarmEvent } from "farmbot";
import { EditFEForm } from "./edit_fe_form"; import { EditFEForm } from "./edit_fe_form";
import { t } from "i18next"; import { t } from "../../i18next_wrapper";
@connect(mapStateToPropsAddEdit) @connect(mapStateToPropsAddEdit)
export class EditFarmEvent extends React.Component<AddEditFarmEventProps, {}> { export class EditFarmEvent extends React.Component<AddEditFarmEventProps, {}> {

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import moment from "moment"; import moment from "moment";
import { t } from "i18next";
import { success, error, warning } from "farmbot-toastr"; import { success, error, warning } from "farmbot-toastr";
import { import {
TaggedFarmEvent, SpecialStatus, TaggedSequence, TaggedRegimen, TaggedFarmEvent, SpecialStatus, TaggedSequence, TaggedRegimen,
@ -44,6 +44,7 @@ import {
import { import {
AllowedVariableNodes AllowedVariableNodes
} from "../../sequences/locals_list/locals_list_support"; } from "../../sequences/locals_list/locals_list_support";
import { t } from "../../i18next_wrapper";
type FormEvent = React.SyntheticEvent<HTMLInputElement>; type FormEvent = React.SyntheticEvent<HTMLInputElement>;
export const NEVER: TimeUnit = "never"; export const NEVER: TimeUnit = "never";

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { import {
Row, Col, BlurableInput, FBSelect, DropDownItem Row, Col, BlurableInput, FBSelect, DropDownItem
} from "../../ui/index"; } from "../../ui/index";
@ -8,6 +8,7 @@ import { keyBy } from "lodash";
import { FarmEventViewModel } from "./edit_fe_form"; import { FarmEventViewModel } from "./edit_fe_form";
import { EventTimePicker } from "./event_time_picker"; import { EventTimePicker } from "./event_time_picker";
import { TimeUnit } from "farmbot/dist/resources/api_resources"; import { TimeUnit } from "farmbot/dist/resources/api_resources";
import { t } from "../../i18next_wrapper";
type Ev = React.SyntheticEvent<HTMLInputElement>; type Ev = React.SyntheticEvent<HTMLInputElement>;
type Key = keyof FarmEventViewModel; type Key = keyof FarmEventViewModel;

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { t } from "i18next";
import { Row } from "../../ui/index"; import { Row } from "../../ui/index";
import { mapStateToProps } from "./map_state_to_props"; import { mapStateToProps } from "./map_state_to_props";
import { import {
@ -17,6 +17,7 @@ import {
EmptyStateWrapper, EmptyStateGraphic EmptyStateWrapper, EmptyStateGraphic
} from "../../ui/empty_state_wrapper"; } from "../../ui/empty_state_wrapper";
import { some, uniq, map, sortBy } from "lodash"; import { some, uniq, map, sortBy } from "lodash";
import { t } from "../../i18next_wrapper";
const filterSearch = (term: string) => (item: CalendarOccurrence) => const filterSearch = (term: string) => (item: CalendarOccurrence) =>
item.heading.toLowerCase().includes(term) item.heading.toLowerCase().includes(term)

View File

@ -1,7 +1,7 @@
import { AddEditFarmEventProps } from "../interfaces"; import { AddEditFarmEventProps } from "../interfaces";
import { Everything } from "../../interfaces"; import { Everything } from "../../interfaces";
import moment from "moment"; import moment from "moment";
import { t } from "i18next";
import { history, getPathArray } from "../../history"; import { history, getPathArray } from "../../history";
import { import {
selectAllFarmEvents, selectAllFarmEvents,
@ -33,6 +33,7 @@ import {
import { hasId } from "../../resources/util"; import { hasId } from "../../resources/util";
import { ExecutableType } from "farmbot/dist/resources/api_resources"; import { ExecutableType } from "farmbot/dist/resources/api_resources";
import { getFbosConfig } from "../../resources/getters"; import { getFbosConfig } from "../../resources/getters";
import { t } from "../../i18next_wrapper";
export let formatTime = (input: string, timeOffset: number) => { export let formatTime = (input: string, timeOffset: number) => {
const iso = new Date(input).toISOString(); const iso = new Date(input).toISOString();

View File

@ -1,7 +1,8 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { timezoneMismatch } from "../../devices/timezones/guess_timezone"; import { timezoneMismatch } from "../../devices/timezones/guess_timezone";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { t } from "../../i18next_wrapper";
interface TzWarningProps { interface TzWarningProps {
deviceTimezone: string | undefined; deviceTimezone: string | undefined;

View File

@ -1,9 +1,10 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { transformXY } from "../util"; import { transformXY } from "../util";
import { MapTransformProps, BotSize } from "../interfaces"; import { MapTransformProps, BotSize } from "../interfaces";
import { random, range, some, clamp, sample } from "lodash"; import { random, range, some, clamp, sample } from "lodash";
import { getEggStatus, setEggStatus, EggKeys } from "./status"; import { getEggStatus, setEggStatus, EggKeys } from "./status";
import { t } from "../../../i18next_wrapper";
export interface BugsProps { export interface BugsProps {
mapTransformProps: MapTransformProps; mapTransformProps: MapTransformProps;

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { BlurableInput } from "../../../../ui/index"; import { BlurableInput } from "../../../../ui/index";
import { t } from "i18next";
import { offsetTime } from "../../../farm_events/edit_fe_form"; import { offsetTime } from "../../../farm_events/edit_fe_form";
import { import {
setWebAppConfigValue, GetWebAppConfigValue setWebAppConfigValue, GetWebAppConfigValue
@ -10,6 +10,7 @@ import {
formatDate, formatTime formatDate, formatTime
} from "../../../farm_events/map_state_to_props_add_edit"; } from "../../../farm_events/map_state_to_props_add_edit";
import { Slider } from "@blueprintjs/core"; import { Slider } from "@blueprintjs/core";
import { t } from "../../../../i18next_wrapper";
interface ImageFilterMenuState { interface ImageFilterMenuState {
beginDate: string | undefined; beginDate: string | undefined;

View File

@ -1,4 +1,4 @@
import { t } from "i18next";
import { error } from "farmbot-toastr"; import { error } from "farmbot-toastr";
import { Content } from "../../../../constants"; import { Content } from "../../../../constants";
import { initSave, edit, save } from "../../../../api/crud"; import { initSave, edit, save } from "../../../../api/crud";
@ -15,6 +15,7 @@ import { findBySlug } from "../../../search_selectors";
import { transformXY, round } from "../../util"; import { transformXY, round } from "../../util";
import { movePlant } from "../../../actions"; import { movePlant } from "../../../actions";
import { cachedCrop } from "../../../../open_farm/icons"; import { cachedCrop } from "../../../../open_farm/icons";
import { t } from "../../../../i18next_wrapper";
/** Return a new plant or plantTemplate object. */ /** Return a new plant or plantTemplate object. */
export const newPlantKindAndBody = (props: { export const newPlantKindAndBody = (props: {

View File

@ -5,8 +5,9 @@ import { TaggedSensorReading } from "farmbot";
import { MapTransformProps } from "../../interfaces"; import { MapTransformProps } from "../../interfaces";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import { formatLogTime } from "../../../../logs"; import { formatLogTime } from "../../../../logs";
import { t } from "i18next";
import { Color } from "../../../../ui"; import { Color } from "../../../../ui";
import { t } from "../../../../i18next_wrapper";
const VISIBLE_PERIOD_SECONDS = 24 * 60 * 60.; const VISIBLE_PERIOD_SECONDS = 24 * 60 * 60.;

View File

@ -1,5 +1,5 @@
import * as React from "react"; import * as React from "react";
import { t } from "i18next";
import { LayerToggle } from "../legend/layer_toggle"; import { LayerToggle } from "../legend/layer_toggle";
import { GardenMapLegendProps } from "../interfaces"; import { GardenMapLegendProps } from "../interfaces";
import { history } from "../../../history"; import { history } from "../../../history";
@ -12,6 +12,7 @@ import { SavedGardensLink } from "../../saved_gardens/saved_gardens";
import { GetWebAppConfigValue } from "../../../config_storage/actions"; import { GetWebAppConfigValue } from "../../../config_storage/actions";
import { BooleanSetting } from "../../../session_keys"; import { BooleanSetting } from "../../../session_keys";
import { DevSettings } from "../../../account/dev/dev_support"; import { DevSettings } from "../../../account/dev/dev_support";
import { t } from "../../../i18next_wrapper";
const OriginSelector = ({ quadrant, update }: { const OriginSelector = ({ quadrant, update }: {
quadrant: BotOriginQuadrant, quadrant: BotOriginQuadrant,

View File

@ -1,6 +1,7 @@
import * as React from "react"; import * as React from "react";
import { Popover, Position } from "@blueprintjs/core"; import { Popover, Position } from "@blueprintjs/core";
import { t } from "i18next"; import { t } from "../../../i18next_wrapper";
export interface LayerToggleProps { export interface LayerToggleProps {
label: string; label: string;

View File

@ -3,7 +3,7 @@ import { Row, Col } from "../ui";
import { Everything } from "../interfaces"; import { Everything } from "../interfaces";
import { BotPosition } from "../devices/interfaces"; import { BotPosition } from "../devices/interfaces";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { t } from "i18next";
import { moveAbs } from "../devices/actions"; import { moveAbs } from "../devices/actions";
import { history } from "../history"; import { history } from "../history";
import { AxisInputBox } from "../controls/axis_input_box"; import { AxisInputBox } from "../controls/axis_input_box";
@ -17,6 +17,7 @@ import {
} from "./plants/designer_panel"; } from "./plants/designer_panel";
import { DevSettings } from "../account/dev/dev_support"; import { DevSettings } from "../account/dev/dev_support";
import { DesignerNavTabs } from "./panel_header"; import { DesignerNavTabs } from "./panel_header";
import { t } from "../i18next_wrapper";
export function mapStateToProps(props: Everything) { export function mapStateToProps(props: Everything) {
return { return {

Some files were not shown because too many files have changed in this diff Show More