📚 Missing translations [rules and to budget] (#4770)

* Missing translations

* md

* wrong md name
This commit is contained in:
lelemm
2025-04-08 11:04:04 -03:00
committed by GitHub
parent 91aa2ae47b
commit cefc8da7bc
5 changed files with 45 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import React, { type CSSProperties, type MouseEventHandler } from 'react';
import { useTranslation } from 'react-i18next';
import { Block } from '@actual-app/components/block';
import { styles } from '@actual-app/components/styles';
@@ -35,6 +36,7 @@ export function ToBudgetAmount({
isTotalsListTooltipDisabled = false,
onContextMenu,
}: ToBudgetAmountProps) {
const { t } = useTranslation();
const sheetName = useEnvelopeSheetName(envelopeBudget.toBudget);
const sheetValue = useEnvelopeSheetValue({
name: envelopeBudget.toBudget,
@@ -52,7 +54,7 @@ export function ToBudgetAmount({
return (
<View style={{ alignItems: 'center', ...style }}>
<Block>{isNegative ? 'Overbudgeted:' : 'To Budget:'}</Block>
<Block>{isNegative ? t('Overbudgeted:') : t('To Budget:')}</Block>
<View>
<Tooltip
content={

View File

@@ -1,4 +1,4 @@
import React, { useState, useRef, useEffect, useReducer } from 'react';
import React, { useState, useRef, useEffect, useReducer, useMemo } from 'react';
import { FocusScope } from 'react-aria';
import { Form } from 'react-aria-components';
import { useHotkeys } from 'react-hotkeys-hook';
@@ -264,6 +264,18 @@ export function FilterButton({ onApply, compact, hover, exclude }) {
const dateFormat = useDateFormat() || 'MM/dd/yyyy';
const translatedFilterFields = useMemo(() => {
const retValue = [...filterFields];
if (retValue && retValue.length > 0) {
retValue.forEach(field => {
field[1] = mapField(field[0]);
});
}
return retValue;
}, []);
const [state, dispatch] = useReducer(
(state, action) => {
switch (action.type) {
@@ -379,12 +391,12 @@ export function FilterButton({ onApply, compact, hover, exclude }) {
onMenuSelect={name => {
dispatch({ type: 'configure', field: name });
}}
items={filterFields
items={translatedFilterFields
.filter(f => (exclude ? !exclude.includes(f[0]) : true))
.sort()
.map(([name, text]) => ({
name,
text: titleFirst(mapField(text)),
text: titleFirst(text),
}))}
/>
</Popover>

View File

@@ -237,6 +237,18 @@ function ConditionEditor({
inputKey,
} = condition;
const translatedConditions = useMemo(() => {
const retValue = [...conditionFields];
if (retValue && retValue.length > 0) {
retValue.forEach(field => {
field[1] = mapField(field[0]);
});
}
return retValue;
}, []);
let field = originalField;
if (field === 'amount' && options) {
if (options.inflow) {
@@ -273,7 +285,7 @@ function ConditionEditor({
return (
<Editor style={editorStyle} error={error}>
<FieldSelect
fields={conditionFields}
fields={translatedConditions}
value={field}
onChange={value => onChange('field', value)}
/>
@@ -581,6 +593,12 @@ function ConditionsList({
onChangeConditions,
}) {
function addCondition(index) {
if (conditionFields && conditionFields.length > 0) {
conditionFields.forEach(field => {
field[1] = mapField(field[0]);
});
}
// (remove the inflow and outflow pseudo-fields since theyd be a pain to get right)
let fields = conditionFields
.map(f => f[0])