Skip to content

Commit

Permalink
Support dynamic locale for AtomIdentifier element name, phetsims/buil…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Nov 16, 2023
1 parent a69214f commit 301f869
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/make-isotopes/view/InteractiveIsotopeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class InteractiveIsotopeNode extends Node {
};

// get element name and append mass number to identify isotope
let name = `${AtomIdentifier.getName( numProtons )}-${numProtons + numNeutrons}`;
let name = `${AtomIdentifier.getName( numProtons ).value}-${numProtons + numNeutrons}`;
if ( name.length === 0 ) {
name = '';
}
Expand Down
2 changes: 1 addition & 1 deletion js/make-isotopes/view/TwoItemPieChartNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class TwoItemPieChartNode extends Node {
// Attach otherIsotopeLabel with protonCountProperty to change element name on proton count change
function updateOtherIsotopeLabel( isotope ) {
const abundanceTo6Digits = AtomIdentifier.getNaturalAbundance( isotope, 6 );
const name = AtomIdentifier.getName( makeIsotopesModel.particleAtom.protonCountProperty.get() );
const name = AtomIdentifier.getName( makeIsotopesModel.particleAtom.protonCountProperty.get() ).value;
if ( makeIsotopesModel.particleAtom.protonCountProperty.get() > 0 && abundanceTo6Digits < 1 ) {
otherIsotopeLabel.string = StringUtils.format( otherIsotopesPatternString, name );
otherIsotopeLabel.visible = true;
Expand Down
2 changes: 1 addition & 1 deletion js/mix-isotopes/model/MixIsotopesModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class MixIsotopesModel {
// Add the controllers.
for ( let i = 0; i < this.possibleIsotopesProperty.get().length; i++ ) {
const isotopeConfig = this.possibleIsotopesProperty.get()[ i ];
const isotopeCaption = `${AtomIdentifier.getName( isotopeConfig.protonCountProperty.get() )
const isotopeCaption = `${AtomIdentifier.getName( isotopeConfig.protonCountProperty.get() ).value
}-${isotopeConfig.massNumberProperty.get()}`;
if ( buckets ) {
const newBucket = new MonoIsotopeBucket(
Expand Down

0 comments on commit 301f869

Please sign in to comment.