Skip to content

Commit

Permalink
Fix missing "Code copied..." string (#1200)
Browse files Browse the repository at this point in the history
Closes #1199
  • Loading branch information
microbit-matt-hillsdon authored Dec 16, 2024
1 parent 9947c9a commit 346e4e0
Show file tree
Hide file tree
Showing 26 changed files with 125 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Copia el programa",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Crea",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Code kopieren",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Erstellen",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Copy code",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Toast shown when you copy from API or Reference snippets"
},
"create-action": {
"defaultMessage": "Create",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Copiar código",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Crea",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Copier le code",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Créez",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "コードをコピー",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "作る",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "코드 복사",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Create",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.lol.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "crwdns331458:0crwdne331458:0",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "crwdns331460:0crwdne331460:0",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Kopieer code",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Maak",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "Skopiuj kod",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "Twórz",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "复制代码",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "创作",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
"defaultMessage": "複製程式碼",
"description": "Copy code to clipboard action text"
},
"copy-snippet-advice": {
"defaultMessage": "Code copied, use paste to insert it.",
"description": "Copy code to clipboard action text"
},
"create-action": {
"defaultMessage": "創造",
"description": "Create action label (e.g. in create file dialog)"
Expand Down
6 changes: 4 additions & 2 deletions src/editor/active-editor-hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ActionFeedback } from "../common/use-action-feedback";
import { Logging } from "../logging/logging";
import { copyCodeSnippet } from "./codemirror/copypaste";
import { CodeInsertType } from "./codemirror/dnd";
import { IntlShape } from "react-intl";

/**
* Actions that operate on a CM editor.
Expand All @@ -26,7 +27,8 @@ export class EditorActions {
constructor(
private view: EditorView,
private logging: Logging,
private actionFeedback: ActionFeedback
private actionFeedback: ActionFeedback,
private intl: IntlShape
) {}

copyCode = async (
Expand All @@ -46,7 +48,7 @@ export class EditorActions {
id,
});
this.actionFeedback.success({
title: "Code copied, use paste to insert it.",
title: this.intl.formatMessage({ id: "copy-snippet-advice" }),
});
};
undo = (): void => {
Expand Down
2 changes: 1 addition & 1 deletion src/editor/codemirror/CodeMirror.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const CodeMirror = ({
});

viewRef.current = view;
setActiveEditor(new EditorActions(view, logging, actionFeedback));
setActiveEditor(new EditorActions(view, logging, actionFeedback, intl));
}
}, [
actionFeedback,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@
"value": "Copia el programa"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@
"value": "Code kopieren"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@
"value": "Copy code"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@
"value": "Copiar código"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@
"value": "Copier le code"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,12 @@
"value": "コードをコピー"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@
"value": "코드 복사"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.lol.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@
"value": "crwdns331458:0crwdne331458:0"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@
"value": "Kopieer code"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@
"value": "Skopiuj kod"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@
"value": "复制代码"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@
"value": "複製程式碼"
}
],
"copy-snippet-advice": [
{
"type": 0,
"value": "Code copied, use paste to insert it."
}
],
"create-action": [
{
"type": 0,
Expand Down

0 comments on commit 346e4e0

Please sign in to comment.