- {{ tt('format.misc.selectedCount', { count: getDisplayCount(selectedImportTransactionCount), totalCount: getDisplayCount(importTransactions.length) }) }}
+ {{ tt('format.misc.selectedCount', { count: formatNumberToLocalizedNumerals(selectedImportTransactionCount), totalCount: formatNumberToLocalizedNumerals(importTransactions.length) }) }}
{{ tt('Transactions Per Page') }}
@@ -416,7 +416,7 @@ import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
import { useTransactionTagsStore } from '@/stores/transactionTag.ts';
import { type NameValue, type NameNumeralValue, itemAndIndex, reversed, keys } from '@/core/base.ts';
-import { type NumeralSystem, AmountFilterType } from '@/core/numeral.ts';
+import { AmountFilterType } from '@/core/numeral.ts';
import { CategoryType } from '@/core/category.ts';
import { TransactionType } from '@/core/transaction.ts';
import { KnownFileType } from '@/core/file.ts';
@@ -509,11 +509,11 @@ const props = defineProps<{
const {
tt,
- getCurrentNumeralSystemType,
formatDateTimeToLongDateTime,
formatDateTimeToGregorianDefaultDateTime,
formatAmountToWesternArabicNumeralsWithoutDigitGrouping,
formatAmountToLocalizedNumeralsWithCurrency,
+ formatNumberToLocalizedNumerals,
getCategorizedAccountsWithDisplayBalance
} = useI18n();
@@ -553,7 +553,6 @@ const currentAmountFilterValue1 = ref
(0);
const currentAmountFilterValue2 = ref(0);
const currentDescriptionFilterValue = ref(null);
-const numeralSystem = computed(() => getCurrentNumeralSystemType());
const showAccountBalance = computed(() => settingsStore.appSettings.showAccountBalance);
const customAccountCategoryOrder = computed(() => settingsStore.appSettings.accountCategoryOrders);
@@ -1205,10 +1204,6 @@ const displayFilterCustomDateRange = computed(() => {
return `${minDisplayTime} - ${maxDisplayTime}`
});
-function getDisplayCount(count: number): string {
- return numeralSystem.value.formatNumber(count);
-}
-
function getTablePageOptions(linesCount?: number): NameNumeralValue[] {
const pageOptions: NameNumeralValue[] = [];
@@ -1222,7 +1217,7 @@ function getTablePageOptions(linesCount?: number): NameNumeralValue[] {
break;
}
- pageOptions.push({ value: count, name: getDisplayCount(count) });
+ pageOptions.push({ value: count, name: formatNumberToLocalizedNumerals(count) });
}
pageOptions.push({ value: -1, name: tt('All') });
@@ -1777,7 +1772,7 @@ function showBatchReplaceDialog(type: BatchReplaceDialogDataType, allSourceTagIt
if (updatedCount > 0) {
snackbar.value?.showMessage('format.misc.youHaveUpdatedTransactions', {
- count: getDisplayCount(updatedCount)
+ count: formatNumberToLocalizedNumerals(updatedCount)
});
}
});
@@ -1840,7 +1835,7 @@ function showBatchAddDialog(type: BatchReplaceDialogDataType): void {
if (updatedCount > 0) {
snackbar.value?.showMessage('format.misc.youHaveUpdatedTransactions', {
- count: getDisplayCount(updatedCount)
+ count: formatNumberToLocalizedNumerals(updatedCount)
});
}
});
@@ -1940,7 +1935,7 @@ function showReplaceInvalidItemDialog(type: BatchReplaceDialogDataType, invalidI
if (updatedCount > 0) {
snackbar.value?.showMessage('format.misc.youHaveUpdatedTransactions', {
- count: getDisplayCount(updatedCount)
+ count: formatNumberToLocalizedNumerals(updatedCount)
});
}
});
@@ -2017,7 +2012,7 @@ function showReplaceAllTypesDialog(): void {
if (updatedCount > 0) {
snackbar.value?.showMessage('format.misc.youHaveUpdatedTransactions', {
- count: getDisplayCount(updatedCount)
+ count: formatNumberToLocalizedNumerals(updatedCount)
});
}
});
@@ -2087,7 +2082,7 @@ function showBatchCreateInvalidItemDialog(type: BatchCreateDialogDataType, inval
if (updatedCount > 0) {
snackbar.value?.showMessage('format.misc.youHaveUpdatedTransactions', {
- count: getDisplayCount(updatedCount)
+ count: formatNumberToLocalizedNumerals(updatedCount)
});
}
});
diff --git a/src/views/desktop/transactions/import/tabs/ImportTransactionDefineColumnTab.vue b/src/views/desktop/transactions/import/tabs/ImportTransactionDefineColumnTab.vue
index d2ce3203..161a2897 100644
--- a/src/views/desktop/transactions/import/tabs/ImportTransactionDefineColumnTab.vue
+++ b/src/views/desktop/transactions/import/tabs/ImportTransactionDefineColumnTab.vue
@@ -46,7 +46,7 @@
{{ tt('Transaction Type Mapping') }}
- ({{ getObjectOwnFieldCount(parsedFileValidMappedTransactionTypes) || tt('None') }})
+ ({{ formatNumberToLocalizedNumerals(getObjectOwnFieldCount(parsedFileValidMappedTransactionTypes)) || tt('None') }})
@@ -229,7 +229,7 @@ import { ref, computed, useTemplateRef, watch } from 'vue';
import { useI18n } from '@/locales/helpers.ts';
import { type NameValue, type NameNumeralValue, type TypeAndDisplayName, itemAndIndex, keys, entries } from '@/core/base.ts';
-import { type NumeralSystem, KnownAmountFormat } from '@/core/numeral.ts';
+import { KnownAmountFormat } from '@/core/numeral.ts';
import { type DateFormatOrder, KnownDateTimeFormat } from '@/core/datetime.ts';
import { KnownDateTimezoneFormat } from '@/core/timezone.ts';
import { TransactionType } from '@/core/transaction.ts';
@@ -286,10 +286,10 @@ const props = defineProps<{
const {
tt,
ti,
- getCurrentNumeralSystemType,
getLongDateFormatOrder,
getShortDateFormatOrder,
- getAllImportTransactionColumnTypes
+ getAllImportTransactionColumnTypes,
+ formatNumberToLocalizedNumerals
} = useI18n();
const snackbar = useTemplateRef('snackbar');
@@ -298,7 +298,6 @@ const currentPage = ref(1);
const countPerPage = ref(10);
const parsedFileDataColumnMapping = ref(ImportTransactionDataMapping.createEmpty());
-const numeralSystem = computed(() => getCurrentNumeralSystemType());
const longDateFormatOrder = computed(() => getLongDateFormatOrder());
const shortDateFormatOrder = computed(() => getShortDateFormatOrder());
const allImportTransactionColumnTypes = computed(() => getAllImportTransactionColumnTypes());
@@ -453,10 +452,6 @@ const displayFileAutoDetectedAmountFormat = computed(() => {
return tt('Unknown');
});
-function getDisplayCount(count: number): string {
- return numeralSystem.value.formatNumber(count);
-}
-
function getTablePageOptions(linesCount?: number): NameNumeralValue[] {
const pageOptions: NameNumeralValue[] = [];
@@ -470,7 +465,7 @@ function getTablePageOptions(linesCount?: number): NameNumeralValue[] {
break;
}
- pageOptions.push({ value: count, name: getDisplayCount(count) });
+ pageOptions.push({ value: count, name: formatNumberToLocalizedNumerals(count) });
}
pageOptions.push({ value: -1, name: tt('All') });
diff --git a/src/views/desktop/transactions/import/tabs/ImportTransactionExecuteCustomScriptTab.vue b/src/views/desktop/transactions/import/tabs/ImportTransactionExecuteCustomScriptTab.vue
index 7ff2611d..e4a4bb4c 100644
--- a/src/views/desktop/transactions/import/tabs/ImportTransactionExecuteCustomScriptTab.vue
+++ b/src/views/desktop/transactions/import/tabs/ImportTransactionExecuteCustomScriptTab.vue
@@ -19,7 +19,7 @@
- {{ tt('format.misc.previewCount', { count: previewCount > 0 ? getDisplayCount(previewCount) : tt('All') }) }}
+ {{ tt('format.misc.previewCount', { count: previewCount > 0 ? formatNumberToLocalizedNumerals(previewCount) : tt('All') }) }}
('');
const previewCount = ref(10);
const currentTimezoneName = computed(() => settingsStore.appSettings.timeZone || getBrowserTimezoneName());
-const numeralSystem = computed(() => getCurrentNumeralSystemType());
const previewCounts = computed(() => getTablePageOptions(previewResult.value?.length));
const sampleScript = computed(() => `// ${tt('sample.importTransactionCustomScript.headerComment')}
@@ -195,10 +193,6 @@ const menus = computed(() => [
}
]);
-function getDisplayCount(count: number): string {
- return numeralSystem.value.formatNumber(count);
-}
-
function getTablePageOptions(linesCount?: number): NameNumeralValue[] {
const pageOptions: NameNumeralValue[] = [];
@@ -211,7 +205,7 @@ function getTablePageOptions(linesCount?: number): NameNumeralValue[] {
break;
}
- pageOptions.push({ value: count, name: getDisplayCount(count) });
+ pageOptions.push({ value: count, name: formatNumberToLocalizedNumerals(count) });
}
pageOptions.push({ value: -1, name: tt('All') });