Skip to content

Commit

Permalink
Update string names. See #112.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Aug 11, 2023
1 parent ed9a228 commit b4dfd4c
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
10 changes: 5 additions & 5 deletions build-a-nucleus-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"build-a-nucleus.title": {
"value": "Build a Nucleus"
},
"decay": {
"screen.decay": {
"value": "Decay"
},
"screen.chartIntro": {
"value": "Chart Intro"
},
"protonsColon": {
"value": "Protons:"
},
Expand Down Expand Up @@ -167,9 +170,6 @@
"availableDecaysInfoPanelText": {
"value": "While other decays may exist, the available decays shown are the most common. In cases where there is no known decay, no available decays are shown."
},
"chartIntro": {
"value": "Chart Intro"
},
"energy": {
"value": "Energy"
},
Expand Down Expand Up @@ -197,7 +197,7 @@
"fullChartInfoPanelTextPattern": {
"value": "A full, interactive chart of the nuclides and their decays is available from Energy Education Project at University of Calgary, see {{link}}."
},
"fullChart": {
"fullChartLowercase": {
"value": "full chart"
},
"fullNuclideChart": {
Expand Down
4 changes: 2 additions & 2 deletions build-a-nucleus_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
],
"supportsOutputJS": true,
"screenNameKeys": [
"BUILD_A_NUCLEUS/decay",
"BUILD_A_NUCLEUS/chartIntro"
"BUILD_A_NUCLEUS/screen.decay",
"BUILD_A_NUCLEUS/screen.chartIntro"
]
},
"eslintConfig": {
Expand Down
8 changes: 5 additions & 3 deletions js/BuildANucleusStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ type StringsType = {
'build-a-nucleus': {
'titleStringProperty': LocalizedStringProperty;
};
'decayStringProperty': LocalizedStringProperty;
'screen': {
'decayStringProperty': LocalizedStringProperty;
'chartIntroStringProperty': LocalizedStringProperty;
};
'protonsColonStringProperty': LocalizedStringProperty;
'neutronsColonStringProperty': LocalizedStringProperty;
'secondsStringProperty': LocalizedStringProperty;
Expand Down Expand Up @@ -67,7 +70,6 @@ type StringsType = {
'electronCloudStringProperty': LocalizedStringProperty;
'clusterOfNeutronsPatternStringProperty': LocalizedStringProperty;
'availableDecaysInfoPanelTextStringProperty': LocalizedStringProperty;
'chartIntroStringProperty': LocalizedStringProperty;
'energyStringProperty': LocalizedStringProperty;
'nuclearShellModelStringProperty': LocalizedStringProperty;
'partialNuclideChartStringProperty': LocalizedStringProperty;
Expand All @@ -79,7 +81,7 @@ type StringsType = {
'percentageInParenthesesPatternStringProperty': LocalizedStringProperty;
'magicNumbersStringProperty': LocalizedStringProperty;
'fullChartInfoPanelTextPatternStringProperty': LocalizedStringProperty;
'fullChartStringProperty': LocalizedStringProperty;
'fullChartLowercaseStringProperty': LocalizedStringProperty;
'fullNuclideChartStringProperty': LocalizedStringProperty;
'fullChartCapitalizedStringProperty': LocalizedStringProperty;
};
Expand Down
2 changes: 1 addition & 1 deletion js/chart-intro/ChartIntroScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ChartIntroScreen extends Screen<ChartIntroModel, ChartIntroScreenView> {
public constructor( providedOptions?: NuclideChartIntroScreenOptions ) {

const options = optionize<NuclideChartIntroScreenOptions, EmptySelfOptions, ScreenOptions>()( {
name: BuildANucleusStrings.chartIntroStringProperty,
name: BuildANucleusStrings.screen.chartIntroStringProperty,

backgroundColorProperty: BANColors.screenBackgroundColorProperty,

Expand Down
6 changes: 3 additions & 3 deletions js/chart-intro/view/FullChartDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class FullChartDialog extends Dialog {
const stringProperty = new DerivedStringProperty( [
allowLinksProperty,
BuildANucleusStrings.fullChartInfoPanelTextPatternStringProperty,
BuildANucleusStrings.fullChartStringProperty
], ( allowLinks, fullChartInfoText, fullChartText ) => {
BuildANucleusStrings.fullChartLowercaseStringProperty
], ( allowLinks, fullChartInfoText, fullChartLowercaseText ) => {
return allowLinks ?
StringUtils.fillIn( fullChartInfoText, { link: `<a href="{{url}}">${fullChartText}</a>` } ) :
StringUtils.fillIn( fullChartInfoText, { link: `<a href="{{url}}">${fullChartLowercaseText}</a>` } ) :
StringUtils.fillIn( fullChartInfoText, { link: linkText } );
} );

Expand Down
2 changes: 1 addition & 1 deletion js/chart-intro/view/NuclideChartAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NuclideChartAccordionBox extends AccordionBox {

const decayEquationNode = new DecayEquationNode( decayEquationModel, zoomInNuclideChartNode.width / 2 );

const decayPushButton = new TextPushButton( BuildANucleusStrings.decayStringProperty, {
const decayPushButton = new TextPushButton( BuildANucleusStrings.screen.decayStringProperty, {
enabledProperty: new DerivedProperty( [ decayEquationModel.currentCellModelProperty ], currentCellModel => !!currentCellModel?.decayType ),
baseColor: BANColors.decayButtonColorProperty,
textNodeOptions: {
Expand Down
2 changes: 1 addition & 1 deletion js/decay/DecayScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DecayScreen extends Screen<DecayModel, DecayScreenView> {
public constructor( providedOptions?: DecayScreenOptions ) {

const options = optionize<DecayScreenOptions, EmptySelfOptions, ScreenOptions>()( {
name: BuildANucleusStrings.decayStringProperty,
name: BuildANucleusStrings.screen.decayStringProperty,

backgroundColorProperty: BANColors.screenBackgroundColorProperty,
homeScreenIcon: createScreenIcon()
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
],
"supportsOutputJS": true,
"screenNameKeys": [
"BUILD_A_NUCLEUS/decay",
"BUILD_A_NUCLEUS/chartIntro"
"BUILD_A_NUCLEUS/screen.decay",
"BUILD_A_NUCLEUS/screen.chartIntro"
]
},
"eslintConfig": {
Expand Down

0 comments on commit b4dfd4c

Please sign in to comment.