diff --git a/components/Amount.tsx b/components/Amount.tsx index fe528953c..0bfc558b6 100644 --- a/components/Amount.tsx +++ b/components/Amount.tsx @@ -11,7 +11,7 @@ import { Row } from './layout/Row'; import { Body } from './text/Body'; import LoadingIndicator from './LoadingIndicator'; -import { localeString } from '../utils/LocaleUtils'; +import { localeString, formatInlineNoun } from '../utils/LocaleUtils'; import { themeColor } from '../utils/ThemeUtils'; import { formatBitcoinWithSpaces } from '../utils/UnitsUtils'; import PrivacyUtils from '../utils/PrivacyUtils'; @@ -151,9 +151,9 @@ function AmountDisplay({ {plural ? 'sats' : 'sat'} {fee ? ' ' + - localeString( - 'views.Payment.fee' - ).toLowerCase() + formatInlineNoun( + localeString('views.Payment.fee') + ) : ''} @@ -179,9 +179,9 @@ function AmountDisplay({ color={color} colorOverride={colorOverride} > - {localeString( - 'views.Payment.fee' - ).toLowerCase()} + {formatInlineNoun( + localeString('views.Payment.fee') + )} @@ -246,9 +246,11 @@ function AmountDisplay({ color={color} colorOverride={colorOverride} > - {localeString( - 'views.Payment.fee' - ).toLowerCase()} + {formatInlineNoun( + localeString( + 'views.Payment.fee' + ) + )} diff --git a/utils/LocaleUtils.ts b/utils/LocaleUtils.ts index c38b28b55..262bbe26c 100644 --- a/utils/LocaleUtils.ts +++ b/utils/LocaleUtils.ts @@ -129,3 +129,16 @@ export function localeString(localeString: string): any { return English[localeString]; } } + +export const languagesWithNounCapitalization = ['de', 'pl', 'cs', 'sk']; + +export const formatInlineNoun = (text: string): string => { + if ( + !languagesWithNounCapitalization.includes( + stores.settingsStore?.settings?.locale || '' + ) + ) { + return text.toLowerCase(); + } + return text; +};