From c8b068b2f143d255ad2fea2b1455a3c1c186edcf Mon Sep 17 00:00:00 2001
From: chrisgarrity <chrisg@media.mit.edu>
Date: Fri, 6 Oct 2017 12:51:51 -0400
Subject: [PATCH] updating string ids to follow convention (#700)

Changed existing string ids to use the convention `<repo>.<component>.<identifier>`
---
 scripts/generate-locale-messages.js           |  2 +-
 src/components/gui/gui.jsx                    |  2 +-
 src/components/sound-editor/sound-editor.jsx  | 30 +++++++++----------
 .../sprite-selector-item.jsx                  |  2 +-
 .../sprite-selector/sprite-selector.jsx       |  2 +-
 .../stage-selector/stage-selector.jsx         |  4 +--
 src/components/turbo-mode/turbo-mode.jsx      |  2 +-
 src/containers/costume-tab.jsx                |  4 +--
 src/containers/sound-tab.jsx                  |  4 +--
 src/locale.js                                 | 22 ++++++++++----
 10 files changed, 43 insertions(+), 31 deletions(-)

diff --git a/scripts/generate-locale-messages.js b/scripts/generate-locale-messages.js
index fb6bf359a..1d92f4ba8 100755
--- a/scripts/generate-locale-messages.js
+++ b/scripts/generate-locale-messages.js
@@ -43,7 +43,7 @@ const fs = require('fs');
 const path = require('path');
 const mkdirp = require('mkdirp');
 
-const locales = ['en', 'es', 'fr'];
+const locales = ['en', 'es', 'de', 'ar', 'he'];
 const LANG_DIR = './translations/';
 const MSGS_DIR = './locale/';
 
diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx
index 2257c2cee..354baecdb 100644
--- a/src/components/gui/gui.jsx
+++ b/src/components/gui/gui.jsx
@@ -26,7 +26,7 @@ const addExtensionMessage = (
     <FormattedMessage
         defaultMessage="Extensions"
         description="Button to add an extension in the target pane"
-        id="targetPane.addExtension"
+        id="gui.gui.addExtension"
     />
 );
 
diff --git a/src/components/sound-editor/sound-editor.jsx b/src/components/sound-editor/sound-editor.jsx
index 21c2613bf..9a0e551cb 100644
--- a/src/components/sound-editor/sound-editor.jsx
+++ b/src/components/sound-editor/sound-editor.jsx
@@ -30,72 +30,72 @@ const BufferedInput = BufferedInputHOC(Input);
 
 const messages = defineMessages({
     sound: {
-        id: 'soundEditor.sound',
-        description: 'Lable for the name of the sound',
+        id: 'gui.soundEditor.sound',
+        description: 'Label for the name of the sound',
         defaultMessage: 'Sound'
     },
     play: {
-        id: 'soundEditor.play',
+        id: 'gui.soundEditor.play',
         description: 'Title of the button to start playing the sound',
         defaultMessage: 'Play'
     },
     stop: {
-        id: 'soundEditor.stop',
+        id: 'gui.soundEditor.stop',
         description: 'Title of the button to stop the sound',
         defaultMessage: 'Stop'
     },
     trim: {
-        id: 'soundEditor.trim',
+        id: 'gui.soundEditor.trim',
         description: 'Title of the button to start trimminging the sound',
         defaultMessage: 'Trim'
     },
     save: {
-        id: 'soundEditor.save',
+        id: 'gui.soundEditor.save',
         description: 'Title of the button to save trimmed sound',
         defaultMessage: 'Save'
     },
     undo: {
-        id: 'soundEditor.undo',
+        id: 'gui.soundEditor.undo',
         description: 'Title of the button to undo',
         defaultMessage: 'Undo'
     },
     redo: {
-        id: 'soundEditor.redo',
+        id: 'gui.soundEditor.redo',
         description: 'Title of the button to redo',
         defaultMessage: 'Redo'
     },
     faster: {
-        id: 'soundEditor.faster',
+        id: 'gui.soundEditor.faster',
         description: 'Title of the button to apply the faster effect',
         defaultMessage: 'Faster'
     },
     slower: {
-        id: 'soundEditor.slower',
+        id: 'gui.soundEditor.slower',
         description: 'Title of the button to apply the slower effect',
         defaultMessage: 'Slower'
     },
     echo: {
-        id: 'soundEditor.echo',
+        id: 'gui.soundEditor.echo',
         description: 'Title of the button to apply the echo effect',
         defaultMessage: 'Echo'
     },
     robot: {
-        id: 'soundEditor.robot',
+        id: 'gui.soundEditor.robot',
         description: 'Title of the button to apply the robot effect',
         defaultMessage: 'Robot'
     },
     louder: {
-        id: 'soundEditor.louder',
+        id: 'gui.soundEditor.louder',
         description: 'Title of the button to apply the louder effect',
         defaultMessage: 'Louder'
     },
     softer: {
-        id: 'soundEditor.softer',
+        id: 'gui.soundEditor.softer',
         description: 'Title of the button to apply thr.softer effect',
         defaultMessage: 'Softer'
     },
     reverse: {
-        id: 'soundEditor.reverse',
+        id: 'gui.soundEditor.reverse',
         description: 'Title of the button to apply the reverse effect',
         defaultMessage: 'Reverse'
     }
diff --git a/src/components/sprite-selector-item/sprite-selector-item.jsx b/src/components/sprite-selector-item/sprite-selector-item.jsx
index 2db6a7fea..8dd048312 100644
--- a/src/components/sprite-selector-item/sprite-selector-item.jsx
+++ b/src/components/sprite-selector-item/sprite-selector-item.jsx
@@ -43,7 +43,7 @@ const SpriteSelectorItem = props => (
                 <FormattedMessage
                     defaultMessage="delete"
                     description="Menu item to delete in the right click menu"
-                    id="contextMenu.delete"
+                    id="gui.spriteSelectorItem.contextMenuDelete"
                 />
             </MenuItem>
         </ContextMenu>
diff --git a/src/components/sprite-selector/sprite-selector.jsx b/src/components/sprite-selector/sprite-selector.jsx
index 399d8062b..005a976f3 100644
--- a/src/components/sprite-selector/sprite-selector.jsx
+++ b/src/components/sprite-selector/sprite-selector.jsx
@@ -14,7 +14,7 @@ const addSpriteMessage = (
     <FormattedMessage
         defaultMessage="Add Sprite"
         description="Button to add a sprite in the target pane"
-        id="targetPane.addSprite"
+        id="gui.spriteSelector.addSprite"
     />
 );
 
diff --git a/src/components/stage-selector/stage-selector.jsx b/src/components/stage-selector/stage-selector.jsx
index 93002f9ef..5ffad63e5 100644
--- a/src/components/stage-selector/stage-selector.jsx
+++ b/src/components/stage-selector/stage-selector.jsx
@@ -13,7 +13,7 @@ const addBackdropMessage = (
     <FormattedMessage
         defaultMessage="Add Backdrop"
         description="Button to add a backdrop in the target pane"
-        id="targetPane.addBackdrop"
+        id="gui.stageSelector.targetPaneAddBackdrop"
     />
 );
 
@@ -49,7 +49,7 @@ const StageSelector = props => {
                 <FormattedMessage
                     defaultMessage="Backdrops"
                     description="Label for the backdrops in the stage selector"
-                    id="stageSelector.backdrops"
+                    id="gui.stageSelector.backdrops"
                 />
             </div>
             <div className={styles.count}>{backdropCount}</div>
diff --git a/src/components/turbo-mode/turbo-mode.jsx b/src/components/turbo-mode/turbo-mode.jsx
index 724af24d1..4475b86d6 100644
--- a/src/components/turbo-mode/turbo-mode.jsx
+++ b/src/components/turbo-mode/turbo-mode.jsx
@@ -15,7 +15,7 @@ const TurboMode = () => (
             <FormattedMessage
                 defaultMessage="Turbo Mode"
                 description="Label indicating turbo mode is active"
-                id="controls.turboMode"
+                id="gui.turboMode.active"
             />
         </div>
     </div>
diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx
index 594f1a7b9..6929608c1 100644
--- a/src/containers/costume-tab.jsx
+++ b/src/containers/costume-tab.jsx
@@ -65,14 +65,14 @@ class CostumeTab extends React.Component {
             <FormattedMessage
                 defaultMessage="Add Backdrop"
                 description="Button to add a backdrop in the editor tab"
-                id="action.addBackdrop"
+                id="gui.costumeTab.addBackdrop"
             />
         );
         const addCostumeMsg = (
             <FormattedMessage
                 defaultMessage="Add Costume"
                 description="Button to add a costume in the editor tab"
-                id="action.addCostume"
+                id="gui.costumeTab.addCostume"
             />
         );
 
diff --git a/src/containers/sound-tab.jsx b/src/containers/sound-tab.jsx
index 3edde50a0..1984923d5 100644
--- a/src/containers/sound-tab.jsx
+++ b/src/containers/sound-tab.jsx
@@ -76,14 +76,14 @@ class SoundTab extends React.Component {
             <FormattedMessage
                 defaultMessage="Record Sound"
                 description="Button to record a sound in the editor tab"
-                id="action.recordSound"
+                id="gui.soundTab.recordSound"
             />
         );
         const addSoundMsg = (
             <FormattedMessage
                 defaultMessage="Add Sound"
                 description="Button to add a sound in the editor tab"
-                id="action.addSound"
+                id="gui.soundTab.addSound"
             />
         );
 
diff --git a/src/locale.js b/src/locale.js
index ad3fcff79..922c9f796 100644
--- a/src/locale.js
+++ b/src/locale.js
@@ -1,6 +1,8 @@
 import localeDataEn from 'react-intl/locale-data/en';
 import localeDataEs from 'react-intl/locale-data/es';
-import localeDataFr from 'react-intl/locale-data/fr';
+import localeDataAr from 'react-intl/locale-data/ar';
+import localeDataDe from 'react-intl/locale-data/de';
+import localeDataHe from 'react-intl/locale-data/he';
 
 import messages from '../locale/messages.json'; // eslint-disable-line import/no-unresolved
 
@@ -15,9 +17,19 @@ export default {
         localeData: localeDataEs,
         messages: messages.es
     },
-    fr: {
-        name: 'Français',
-        localeData: localeDataFr,
-        messages: messages.fr
+    ar: {
+        name: 'العربية',
+        localeData: localeDataAr,
+        messages: messages.ar
+    },
+    de: {
+        name: 'Deutsch',
+        localeData: localeDataDe,
+        messages: messages.de
+    },
+    he: {
+        name: 'עִבְרִית',
+        localeData: localeDataHe,
+        messages: messages.he
     }
 };
-- 
GitLab