diff --git a/src/client/jsx/getTranslationReportRows.jsx b/src/client/jsx/getTranslationReportRows.jsx index b4b808aa..864e2002 100644 --- a/src/client/jsx/getTranslationReportRows.jsx +++ b/src/client/jsx/getTranslationReportRows.jsx @@ -53,8 +53,6 @@ const getTranslationReportRows = ( {simNamesAndTitles[ simName ]} Loading... - Loading... - Loading... ); } @@ -80,19 +78,31 @@ const getTranslationReportRows = ( const simSpecificPercent = Math.floor( ( reportObject.numSimSpecificTranslatedStrings / reportObject.numSimSpecificStrings ) * 100 ); let sharedPercent = 0; const hasSharedStrings = reportObject.numSharedStrings !== null; - let sharedJsx = N/A; + let sharedStatsString = 'N/A'; const commonPercent = Math.floor( ( reportObject.numCommonTranslatedStrings / reportObject.numCommonStrings ) * 100 ); if ( hasSharedStrings ) { sharedPercent = Math.floor( ( reportObject.numSharedTranslatedStrings / reportObject.numSharedStrings ) * 100 ); - sharedJsx = {sharedPercent}% ({reportObject.numSharedTranslatedStrings} of {reportObject.numSharedStrings}); + sharedStatsString = `${sharedPercent}% (${reportObject.numSharedTranslatedStrings} of ${reportObject.numSharedStrings})`; + } + let totalStrings = reportObject.numSimSpecificStrings + + reportObject.numCommonStrings; + let totalTranslatedStrings = reportObject.numSimSpecificTranslatedStrings + + reportObject.numCommonTranslatedStrings; + if ( hasSharedStrings ) { + totalStrings += reportObject.numSharedStrings; + totalTranslatedStrings += reportObject.numSharedTranslatedStrings; } + const simSpecificStatsString = `${simSpecificPercent}% (${reportObject.numSimSpecificTranslatedStrings} of ${reportObject.numSimSpecificStrings})`; + const commonStatsString = `${commonPercent}% (${reportObject.numCommonTranslatedStrings} of ${reportObject.numCommonStrings})`; + console.log( sharedStatsString ); + console.log( simSpecificStatsString ); + console.log( commonStatsString ); + const totalPercent = Math.floor( ( totalTranslatedStrings / totalStrings ) * 100 ); if ( Object.keys( translationReportJsx ).includes( reportObject.simName ) ) { translationReportJsx[ reportObject.simName ] = ( {reportObject.simTitle}{pendingUpdate} - {simSpecificPercent}% ({reportObject.numSimSpecificTranslatedStrings} of {reportObject.numSimSpecificStrings}) - {sharedJsx} - {commonPercent}% ({reportObject.numCommonTranslatedStrings} of {reportObject.numCommonStrings}) + {totalPercent}% ({totalTranslatedStrings} of {totalStrings}) ); }