Skip to content

Commit

Permalink
feat: slovenian adjustments, change median colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanzavisic committed Oct 22, 2024
1 parent 978c7a2 commit 818dd81
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
14 changes: 9 additions & 5 deletions packages/lib/src/main-result/main-result.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
function getText() {
if (glycanage === chronoage) {
return 'Same as';
return getTranslation(lang, 'SAME_AS');
} else if (glycanage < chronoage) {
return diff === 1 ? `${diff} year younger` : `${diff} years younger`;
return diff === 1 ? `${diff} ${getTranslation(lang, 'YEAR_YOUNGER')}` : `${diff} ${getTranslation(lang, 'YEARS_YOUNGER')}`;
} else if (glycanage > chronoage) {
return diff === 1 ? `${diff} year older` : `${diff} years older`;
return diff === 1 ? `${diff} ${getTranslation(lang, 'YEAR_OLDER')}` : `${diff} ${getTranslation(lang, 'YEARS_OLDER')}`;
}
}
Expand Down Expand Up @@ -120,8 +120,12 @@
</div>
</div>
<div class="msg-parent">
<div class="result-text" style="color: {getColor()};"><b>{getText()} {#if diff !== 0}than{/if}</b></div>
<div class="chrono-text">chronological age</div>
<div class="result-text" style="color: {getColor()};"><b>{getText()} {#if diff !== 0}{getTranslation(lang, 'THAN')}{/if}</b></div>
{#if diff === 0 && lang === 'slovenian'}
<div class="chrono-text">kronološka starost</div>
{:else}
<div class="chrono-text">{getTranslation(lang, 'CHRONOLOGICAL_AGE_TWO')}</div>
{/if}
</div>
</div>
{/if}
Expand Down
9 changes: 4 additions & 5 deletions packages/lib/src/results-overview/results-overview.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<div class="main">
<div class="label">
<div class="label-container">
<b style="font-size: {lang === 'slovenian' ? 0.68 : 0.8}rem;">{getTranslation(lang, label)}</b>
<b style="font-size: {lang === 'slovenian' ? 0.70 : 0.8}rem;">{getTranslation(lang, label)}</b>
<div style="font-size: 0.7rem;">
{getTranslation(lang, description)}
</div>
Expand Down Expand Up @@ -126,10 +126,10 @@
{:else if type === 'median'}
<div class="colorBoxShort" style="background-color: #DF2120;"></div>
<div class="colorBox" style="background-color: #F2800D;"></div>
<div class="colorBox" style="background-color: #13A195;"></div>
<div class="colorBox" style="background-color: #66CCAA;"></div>
<div class="colorBox" style="background-color: #66CCAA;"></div>
<div class="colorBox" style="background-color: #13A195;"></div>
<div class="colorBox" style="background-color: #13A195;"></div>
<div class="colorBox" style="background-color: #66CCAA;"></div>
<div class="colorBox" style="background-color: #F2800D;"></div>
<div class="colorBoxShort" style="background-color: #DF2120;"></div>
{/if}
Expand All @@ -148,7 +148,7 @@
<div class="text-left" style="width: {type === 'median' ? '19.7' : '34.7'}%;">
{type === 'shield' || type === 'youth' || type === 'median' ? getTranslation(lang, 'WORSE') : getTranslation(lang, 'BETTER')}
</div>
<div class="text-middle" style="width: 30%;">
<div class="text-middle" style="width: {type === 'median' ? 35 : 30}%; left: {type === 'median' ? 32.4 : 35}%;">
{type === 'age' ? '' : type === 'median' ? getTranslation(lang, 'AROUND_AVERAGE') : getTranslation(lang, 'AVERAGE')}
</div>
<div class="text-right" style="width: {type === 'median' ? '19.8' : '34.7'}%;">
Expand Down Expand Up @@ -236,7 +236,6 @@
position: absolute;
height: 15%;
top: 62%;
left: 35%;
display: flex;
align-items: center;
justify-content: center;
Expand Down
14 changes: 14 additions & 0 deletions packages/lib/src/shared/consts/languages.const.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export let english = {
BIOLOGICAL_AGE: 'Biological age',
CHRONOLOGICAL_AGE: 'Chronological age',
CHRONOLOGICAL_AGE_TWO: 'chronological age',
SI_SCORE: 'SI score',
GLYCAN: 'Glycan',
PEAK: 'Peak',
Expand Down Expand Up @@ -96,6 +97,12 @@ export let english = {
MEASURED_RESULT: 'Measured result',
POPULATION_AVERAGE: 'Population average',
AGE: 'Age',
SAME_AS: 'Same as',
THAN: 'than',
YEAR_OLDER: 'year older',
YEARS_OLDER: 'years older',
YEAR_YOUNGER: 'year younger',
YEARS_YOUNGER: 'years younger',
};

export let polish = {
Expand Down Expand Up @@ -192,6 +199,7 @@ export let polish = {
export let slovenian = {
BIOLOGICAL_AGE: 'Biološka starost',
CHRONOLOGICAL_AGE: 'Kronološka starost',
CHRONOLOGICAL_AGE_TWO: 'kronološke starosti',
RANKS_YOU: 'Ta rezultat vas uvršča med',
PERCENTILE: 'percentilov',
SINGLE_PERCENTILE: 'percentil',
Expand All @@ -214,6 +222,12 @@ export let slovenian = {
MEASURED_RESULT: 'Vaš rezultat',
POPULATION_AVERAGE: 'Povprečje prebivalstva',
AGE: 'Dob',
SAME_AS: 'Enako kot',
THAN: 'od',
YEAR_OLDER: 'starejši',
YEARS_OLDER: 'starejši',
YEAR_YOUNGER: 'let mlajši',
YEARS_YOUNGER: 'let mlajši'
};

export let japanese = {
Expand Down
6 changes: 3 additions & 3 deletions packages/lib/src/shared/functions/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ export function getColorMedianWithPercentile(percentile: number) {
} else if (percentile >= 2 && percentile < 18) {
return '#F2800D';
} else if (percentile >= 18 && percentile < 34) {
return '#13A195';
} else if (percentile >= 34 && percentile < 67) {
return '#66CCAA';
} else if (percentile >= 67 && percentile <= 82) {
} else if (percentile >= 34 && percentile < 67) {
return '#13A195';
} else if (percentile >= 67 && percentile <= 82) {
return '#66CCAA';
} else if (percentile > 82 && percentile <= 98) {
return '#F2800D';
} else if (percentile > 98) {
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/src/single-overview/single-overview.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
{:else if type === 'median'}
<div class="colorBoxShort" style="background-color: #DF2120;"></div>
<div class="colorBox" style="background-color: #F2800D;"></div>
<div class="colorBox" style="background-color: #13A195;"></div>
<div class="colorBox" style="background-color: #66CCAA;"></div>
<div class="colorBox" style="background-color: #66CCAA;"></div>
<div class="colorBox" style="background-color: #13A195;"></div>
<div class="colorBox" style="background-color: #13A195;"></div>
<div class="colorBox" style="background-color: #66CCAA;"></div>
<div class="colorBox" style="background-color: #F2800D;"></div>
<div class="colorBoxShort" style="background-color: #DF2120;"></div>
{/if}
Expand Down

0 comments on commit 818dd81

Please sign in to comment.