Skip to content

Commit

Permalink
Fix Nuclide Decay Info tool showing all nuclides as stable.
Browse files Browse the repository at this point in the history
This bug was introduced when "internationalizing" the app.
Closes #39.
  • Loading branch information
wcjohns committed Jan 15, 2025
1 parent 9e2d706 commit 68aa2a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions InterSpec_resources/app_text/InterSpec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<message id="Unknown">Unknown</message>
<message id="Energy (keV)">Energy (keV)</message>
<message id="Efficiency">Efficiency</message>
<message id="stable">stable</message>

<!-- Units the user may use to write time duration.
Note that we dont have very good changing case (i.e., from lower to upper, or upper to lower)
Expand Down
6 changes: 4 additions & 2 deletions src/DecayChainChart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ void DecayChainChart::jsonInfoForNuclide( const SandiaDecay::Nuclide * const nuc

vector<string> info = getTextInfoForNuclide( nuc, m_nuclide, m_useCurie );

const string hl = (IsInf(nuc->halfLife) ? std::string("stable") : PhysicalUnitsLocalized::printToBestTimeUnits(nuc->halfLife, 2));

const string hl = IsInf(nuc->halfLife) ? WString::tr("stable").toUTF8()
: PhysicalUnitsLocalized::printToBestTimeUnits(nuc->halfLife, 2);

js << "{ \"nuclide\": \"" << nuc->symbol << "\","
<< " \"massNumber\": " << static_cast<int>(nuc->massNumber) << ","
Expand Down Expand Up @@ -597,7 +599,7 @@ std::vector<std::string> DecayChainChart::getTextInfoForNuclide( const SandiaDec
}else
{
const string hl = PhysicalUnitsLocalized::printToBestTimeUnits( nuc->halfLife );
information.push_back( WString::tr("dcc-nuc-info-hl-stable").arg(hl).toUTF8() );
information.push_back( WString::tr("dcc-nuc-info-hl").arg(hl).toUTF8() );
}

if( parentNuclide && (nuc != parentNuclide) )
Expand Down

0 comments on commit 68aa2a2

Please sign in to comment.