mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
rename translation files
This fixes case-insensitive file name conflicts, e.g. editor.ts Editor.ts
This commit is contained in:
committed by
David Lechner
parent
712117c8d8
commit
e0e2d98cd0
@@ -4,8 +4,8 @@
|
||||
import { Button, Intent, Position, Tooltip } from '@blueprintjs/core';
|
||||
import { WithI18nProps, withI18n } from '@shopify/react-i18n';
|
||||
import React from 'react';
|
||||
import { TooltipId } from './button';
|
||||
import en from './button.en.json';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import en from './button-i18n.en.json';
|
||||
|
||||
export interface ActionButtonProps {
|
||||
/** A unique id for each instance. */
|
||||
|
||||
@@ -8,7 +8,7 @@ import { RootState } from '../reducers';
|
||||
import { BleConnectionState } from '../reducers/ble';
|
||||
import { BootloaderConnectionState } from '../reducers/bootloader';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import btConnectedIcon from './images/bt-connected.svg';
|
||||
import btDisconnectedIcon from './images/bt-disconnected.svg';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { connect } from 'react-redux';
|
||||
import { Action, Dispatch } from '../actions';
|
||||
import { toggleDocs } from '../actions/app';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import docsIcon from './images/run.svg'; // FIXME: need proper icon
|
||||
|
||||
type StateProps = undefined;
|
||||
|
||||
@@ -12,8 +12,8 @@ import { IAceEditor } from 'react-ace/lib/types';
|
||||
import { connect } from 'react-redux';
|
||||
import { Action, Dispatch } from '../actions';
|
||||
import { setEditSession, storageChanged } from '../actions/editor';
|
||||
import { EditorStringId } from './editor';
|
||||
import en from './editor.en.json';
|
||||
import { EditorStringId } from './editor-i18n';
|
||||
import en from './editor-i18n.en.json';
|
||||
|
||||
import 'ace-builds/src-noconflict/mode-python';
|
||||
import 'ace-builds/src-noconflict/theme-xcode';
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as notification from '../actions/notification';
|
||||
import { RootState } from '../reducers';
|
||||
import { BootloaderConnectionState } from '../reducers/bootloader';
|
||||
import OpenFileButton, { OpenFileButtonProps } from './OpenFileButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import firmwareIcon from './images/firmware.svg';
|
||||
|
||||
type StateProps = Pick<OpenFileButtonProps, 'enabled'>;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Button, Intent, Position, Tooltip } from '@blueprintjs/core';
|
||||
import { WithI18nProps, withI18n } from '@shopify/react-i18n';
|
||||
import React from 'react';
|
||||
import { TooltipId } from './button';
|
||||
import en from './button.en.json';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import en from './button-i18n.en.json';
|
||||
|
||||
export interface LinkButtonProps {
|
||||
/** A unique id for each instance. */
|
||||
|
||||
@@ -9,7 +9,8 @@ import { connect } from 'react-redux';
|
||||
import { Action, Dispatch } from '../actions';
|
||||
import { NotificationLevel, remove } from '../actions/notification';
|
||||
import { Level, MessageAction } from '../reducers/notification';
|
||||
import en from './notification.en.json';
|
||||
import { MessageId } from './notification-i18n';
|
||||
import en from './notification-i18n.en.json';
|
||||
|
||||
interface DispatchProps {
|
||||
onAction: (action: Action) => void;
|
||||
@@ -20,7 +21,7 @@ interface OwnProps {
|
||||
id: number;
|
||||
level: NotificationLevel;
|
||||
message?: string;
|
||||
messageId?: string;
|
||||
messageId?: MessageId;
|
||||
replacements?: PrimitiveReplacementDictionary;
|
||||
helpUrl?: string;
|
||||
action?: MessageAction;
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as editor from '../actions/editor';
|
||||
import * as notification from '../actions/notification';
|
||||
import { RootState } from '../reducers';
|
||||
import OpenFileButton, { OpenFileButtonProps } from './OpenFileButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import openIcon from './images/open.svg';
|
||||
|
||||
type StateProps = Pick<OpenFileButtonProps, 'enabled'>;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { Button, Intent, Position, Tooltip } from '@blueprintjs/core';
|
||||
import { WithI18nProps, withI18n } from '@shopify/react-i18n';
|
||||
import React from 'react';
|
||||
import Dropzone, { FileRejection } from 'react-dropzone';
|
||||
import { TooltipId } from './button';
|
||||
import en from './button.en.json';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import en from './button-i18n.en.json';
|
||||
|
||||
export interface OpenFileButtonProps {
|
||||
/** A unique id for each instance. */
|
||||
|
||||
@@ -7,7 +7,7 @@ import { repl } from '../actions/hub';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import replIcon from './images/repl.svg';
|
||||
|
||||
type StateProps = Pick<ActionButtonProps, 'enabled'>;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { downloadAndRun } from '../actions/hub';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import runIcon from './images/run.svg';
|
||||
|
||||
type StateProps = Pick<ActionButtonProps, 'enabled'>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Dispatch } from '../actions';
|
||||
import * as editor from '../actions/editor';
|
||||
import { RootState } from '../reducers';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import downloadIcon from './images/download.svg';
|
||||
|
||||
type StateProps = Pick<ActionButtonProps, 'enabled'>;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { stop } from '../actions/hub';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import stopIcon from './images/stop.svg';
|
||||
|
||||
type StateProps = Pick<ActionButtonProps, 'enabled'>;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import LinkButton, { LinkButtonProps } from './LinkButton';
|
||||
import { TooltipId } from './button';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import supportIcon from './images/stop.svg'; // FIXME: replace with correct icon
|
||||
|
||||
type StateProps = undefined;
|
||||
|
||||
@@ -13,8 +13,8 @@ import { FitAddon } from 'xterm-addon-fit';
|
||||
import { Dispatch } from '../actions';
|
||||
import { receiveData } from '../actions/terminal';
|
||||
import { RootState } from '../reducers';
|
||||
import { TerminalStringId } from './terminal';
|
||||
import en from './terminal.en.json';
|
||||
import { TerminalStringId } from './terminal-i18n';
|
||||
import en from './terminal-i18n.en.json';
|
||||
|
||||
import 'xterm/css/xterm.css';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
|
||||
import { lookup } from '../../test';
|
||||
import { TooltipId } from './button';
|
||||
import en from './button.en.json';
|
||||
import { TooltipId } from './button-i18n';
|
||||
import en from './button-i18n.en.json';
|
||||
|
||||
describe('Ensure .json file has matches for TooltipIds', () => {
|
||||
test.each(Object.values(TooltipId))('%s', (id) => {
|
||||
@@ -1,5 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
// File: components/button-i18n.ts
|
||||
// Button translation keys.
|
||||
|
||||
export enum TooltipId {
|
||||
Open = 'open.tooltip',
|
||||
@@ -2,8 +2,8 @@
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
|
||||
import { lookup } from '../../test';
|
||||
import { EditorStringId } from './editor';
|
||||
import en from './editor.en.json';
|
||||
import { EditorStringId } from './editor-i18n';
|
||||
import en from './editor-i18n.en.json';
|
||||
|
||||
describe('Ensure .json file has matches for EditorStringId', () => {
|
||||
test.each(Object.values(EditorStringId))('%s', (id) => {
|
||||
@@ -1,5 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
// File: components/editor-i18n.ts
|
||||
// Editor translation keys.
|
||||
|
||||
export enum EditorStringId {
|
||||
Placeholder = 'editor.placeholder',
|
||||
@@ -2,8 +2,8 @@
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
|
||||
import { lookup } from '../../test';
|
||||
import { MessageId } from '../reducers/notification';
|
||||
import en from './notification.en.json';
|
||||
import { MessageId } from './notification-i18n';
|
||||
import en from './notification-i18n.en.json';
|
||||
|
||||
describe('Ensure .json file has matches for MessageIds', () => {
|
||||
test.each(Object.values(MessageId))('%s', (id) => {
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
// File: components/notification-i18n.ts
|
||||
// Notification translation keys.
|
||||
|
||||
export enum MessageId {
|
||||
BleCannotWriteWithoutResponse = 'ble.cannotWriteWithoutResponse',
|
||||
BleConnectFailed = 'ble.connectFailed',
|
||||
BleGattPermission = 'ble.gattPermission',
|
||||
BleGattServiceNotFound = 'ble.gattServiceNotFound',
|
||||
BleNoWebBluetooth = 'ble.noWebBluetooth',
|
||||
ProgramChanged = 'editor.programChanged',
|
||||
ServiceWorkerSuccess = 'serviceWorker.success',
|
||||
ServiceWorkerUpdate = 'serviceWorker.update',
|
||||
YesReloadProgram = 'editor.yesReloadProgram',
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
|
||||
import { lookup } from '../../test';
|
||||
import { TerminalStringId } from './terminal';
|
||||
import en from './terminal.en.json';
|
||||
import { TerminalStringId } from './terminal-i18n';
|
||||
import en from './terminal-i18n.en.json';
|
||||
|
||||
describe('Ensure .json file has matches for TerminalStringIds', () => {
|
||||
test.each(Object.values(TerminalStringId))('%s', (id) => {
|
||||
@@ -1,5 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
// File: components/terminal-i18n.ts
|
||||
// Terminal translation keys.
|
||||
|
||||
export enum TerminalStringId {
|
||||
Copy = 'terminal.copy',
|
||||
Reference in New Issue
Block a user