Skip to content

Commit 68aa2a2

Browse files
committed
Fix Nuclide Decay Info tool showing all nuclides as stable.
This bug was introduced when "internationalizing" the app. Closes #39.
1 parent 9e2d706 commit 68aa2a2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

InterSpec_resources/app_text/InterSpec.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<message id="Unknown">Unknown</message>
8282
<message id="Energy (keV)">Energy (keV)</message>
8383
<message id="Efficiency">Efficiency</message>
84+
<message id="stable">stable</message>
8485

8586
<!-- Units the user may use to write time duration.
8687
Note that we dont have very good changing case (i.e., from lower to upper, or upper to lower)

src/DecayChainChart.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,9 @@ void DecayChainChart::jsonInfoForNuclide( const SandiaDecay::Nuclide * const nuc
469469

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

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

474476
js << "{ \"nuclide\": \"" << nuc->symbol << "\","
475477
<< " \"massNumber\": " << static_cast<int>(nuc->massNumber) << ","
@@ -597,7 +599,7 @@ std::vector<std::string> DecayChainChart::getTextInfoForNuclide( const SandiaDec
597599
}else
598600
{
599601
const string hl = PhysicalUnitsLocalized::printToBestTimeUnits( nuc->halfLife );
600-
information.push_back( WString::tr("dcc-nuc-info-hl-stable").arg(hl).toUTF8() );
602+
information.push_back( WString::tr("dcc-nuc-info-hl").arg(hl).toUTF8() );
601603
}
602604

603605
if( parentNuclide && (nuc != parentNuclide) )

0 commit comments

Comments
 (0)