Skip to content

Commit

Permalink
require strings instead of string objects for translation, see #56
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarlow12 committed Mar 13, 2018
1 parent aba92ca commit e69191f
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 17 deletions.
42 changes: 42 additions & 0 deletions gravity-force-lab-basics-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,47 @@
},
"billionKg": {
"value": "billion kg"
},
"moveMassHeading": {
"value": "Move Mass"
},
"moveMassLabel": {
"value": "Move mass"
},
"moveInLargerSteps": {
"value": "Move in larger steps"
},
"jumpToLeft": {
"value": "Jump to left"
},
"jumpToRight": {
"value": "Jump to right"
},
"changeMassHeading": {
"value": "Change Mass"
},
"increaseMass": {
"value": "Increase mass"
},
"decreaseMass": {
"value": "Decrease mass"
},
"changeMassInLargerSteps": {
"value": "Change mass in larger steps"
},
"jumpToMaximumMass": {
"value": "Jump to maximum mass"
},
"jumpToMinimumMass": {
"value": "Jump to minimum mass"
},
"massReadoutPattern": {
"value": "{{value}} kilograms"
},
"mass1ControlLabel": {
"value": "Mass 1"
},
"mass2ControlLabel": {
"value": "Mass 2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define( function( require ) {
var ArrowKeyNode = require( 'SCENERY_PHET/keyboard/ArrowKeyNode' );
var EndKeyNode = require( 'SCENERY_PHET/keyboard/EndKeyNode' );
var GeneralNavigationHelpContent = require( 'SCENERY_PHET/keyboard/help/GeneralNavigationHelpContent' );
var GFLBA11yStrings = require( 'GRAVITY_FORCE_LAB_BASICS/GFLBA11yStrings' );
var gravityForceLabBasics = require( 'GRAVITY_FORCE_LAB_BASICS/gravityForceLabBasics' );
var HBox = require( 'SCENERY/nodes/HBox' );
var HelpContent = require( 'SCENERY_PHET/keyboard/help/HelpContent' );
Expand All @@ -24,17 +23,17 @@ define( function( require ) {
var VBox = require( 'SCENERY/nodes/VBox' );

// strings
var moveMassHeadingString = GFLBA11yStrings.moveMassHeadingString.value;
var moveMassLabelString = GFLBA11yStrings.moveMassLabelString.value;
var changeMassHeadingString = GFLBA11yStrings.changeMassHeadingString.value;
var moveInLargerStepsString = GFLBA11yStrings.moveInLargerStepsString.value;
var jumpToLeftString = GFLBA11yStrings.jumpToLeftString.value;
var jumpToRightString = GFLBA11yStrings.jumpToRightString.value;
var increaseMassString = GFLBA11yStrings.increaseMassString.value;
var decreaseMassString = GFLBA11yStrings.decreaseMassString.value;
var changeMassInLargerStepsString = GFLBA11yStrings.changeMassInLargerStepsString.value;
var jumpToMaximumMassString = GFLBA11yStrings.jumpToMaximumMassString.value;
var jumpToMinimumMassString = GFLBA11yStrings.jumpToMinimumMassString.value;
var moveMassHeadingString = require( 'string!GRAVITY_FORCE_LAB_BASICS/moveMassHeading' );
var moveMassLabelString = require( 'string!GRAVITY_FORCE_LAB_BASICS/moveMassLabel' );
var changeMassHeadingString = require( 'string!GRAVITY_FORCE_LAB_BASICS/changeMassHeading' );
var moveInLargerStepsString = require( 'string!GRAVITY_FORCE_LAB_BASICS/moveInLargerSteps' );
var jumpToLeftString = require( 'string!GRAVITY_FORCE_LAB_BASICS/jumpToLeft' );
var jumpToRightString = require( 'string!GRAVITY_FORCE_LAB_BASICS/jumpToRight' );
var increaseMassString = require( 'string!GRAVITY_FORCE_LAB_BASICS/increaseMass' );
var decreaseMassString = require( 'string!GRAVITY_FORCE_LAB_BASICS/decreaseMass' );
var changeMassInLargerStepsString = require( 'string!GRAVITY_FORCE_LAB_BASICS/changeMassInLargerSteps' );
var jumpToMaximumMassString = require( 'string!GRAVITY_FORCE_LAB_BASICS/jumpToMaximumMass' );
var jumpToMinimumMassString = require( 'string!GRAVITY_FORCE_LAB_BASICS/jumpToMinimumMass' );

// constants
var DEFAULT_LABEL_OPTIONS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ define( function( require ) {
var DistanceArrowNode = require( 'GRAVITY_FORCE_LAB_BASICS/gravity-force-lab-basics/view/DistanceArrowNode' );
var GFLBMassNode = require( 'GRAVITY_FORCE_LAB_BASICS/gravity-force-lab-basics/view/GFLBMassNode' );
var gravityForceLabBasics = require( 'GRAVITY_FORCE_LAB_BASICS/gravityForceLabBasics' );
var GFLBA11yStrings = require( 'GRAVITY_FORCE_LAB_BASICS/GFLBA11yStrings' );
var GravityForceLabBasicsConstants = require( 'GRAVITY_FORCE_LAB_BASICS/gravity-force-lab-basics/GravityForceLabBasicsConstants' );
var HBox = require( 'SCENERY/nodes/HBox' );
var inherit = require( 'PHET_CORE/inherit' );
Expand Down Expand Up @@ -46,8 +45,8 @@ define( function( require ) {
var showValuesString = require( 'string!GRAVITY_FORCE_LAB_BASICS/showValues' );

// a11y strings
var mass1ControlLabelString = GFLBA11yStrings.mass1ControlLabelString.value;
var mass2ControlLabelString = GFLBA11yStrings.mass2ControlLabelString.value;
var mass1ControlLabelString = require( 'string!GRAVITY_FORCE_LAB_BASICS/mass1ControlLabel' );
var mass2ControlLabelString = require( 'string!GRAVITY_FORCE_LAB_BASICS/mass2ControlLabel' );

/**
* @param {GravityForceLabBasicsModel} model
Expand Down
3 changes: 1 addition & 2 deletions js/gravity-force-lab-basics/view/MassControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ define( function( require ) {
var Color = require( 'SCENERY/util/Color' );
var gravityForceLabBasics = require( 'GRAVITY_FORCE_LAB_BASICS/gravityForceLabBasics' );
var GravityForceLabBasicsConstants = require( 'GRAVITY_FORCE_LAB_BASICS/gravity-force-lab-basics/GravityForceLabBasicsConstants' );
var GFLBA11yStrings = require( 'GRAVITY_FORCE_LAB_BASICS/GFLBA11yStrings' );
var HBox = require( 'SCENERY/nodes/HBox' );
var inherit = require( 'PHET_CORE/inherit' );
var NumberPicker = require( 'SCENERY_PHET/NumberPicker' );
Expand All @@ -27,7 +26,7 @@ define( function( require ) {
var billionKgString = require( 'string!GRAVITY_FORCE_LAB_BASICS/billionKg' );

// a11y strings
var massReadoutPatternString = GFLBA11yStrings.massReadoutPatternString.value;
var massReadoutPatternString = require( 'string!GRAVITY_FORCE_LAB_BASICS/massReadoutPattern' );

// constants
var MIN_PANEL_WIDTH = 150;
Expand Down

0 comments on commit e69191f

Please sign in to comment.