Repository navigation
Add translations for report field formula type #71790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4782,9 +4782,11 @@ const translations = { | |
| textType: 'Text', | ||
| dateType: 'Date', | ||
| dropdownType: 'List', | ||
| formulaType: 'Formula', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Good placement and consistencyThe |
||
| textAlternateText: 'Add a field for free text input.', | ||
| dateAlternateText: 'Add a calendar for date selection.', | ||
| dropdownAlternateText: 'Add a list of options to choose from.', | ||
| formulaAlternateText: 'Add a formula field.', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are we showing this?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we aren't showing it, can we remove it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Proper alternative text placementThe |
||
| nameInputSubtitle: 'Choose a name for the report field.', | ||
| typeInputSubtitle: 'Choose what type of report field to use.', | ||
| initialValueInputSubtitle: 'Enter a starting value to show in the report field.', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ function getReportFieldTypeTranslationKey(reportFieldType: PolicyReportFieldType | |
| [CONST.REPORT_FIELD_TYPES.TEXT]: 'workspace.reportFields.textType', | ||
| [CONST.REPORT_FIELD_TYPES.DATE]: 'workspace.reportFields.dateType', | ||
| [CONST.REPORT_FIELD_TYPES.LIST]: 'workspace.reportFields.dropdownType', | ||
| [CONST.REPORT_FIELD_TYPES.FORMULA]: 'workspace.reportFields.formulaType', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ Incomplete ImplementationWhile the translation keys have been added for the FORMULA type, the Suggested fix: if (reportField.type === CONST.REPORT_FIELD_TYPES.FORMULA) {
return reportField.defaultValue ?? '';
}
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Good addition of FORMULA type supportThe addition of FORMULA type to the translation key mapping is consistent with the existing pattern and correctly maps to the newly added translation key. |
||
| }; | ||
|
|
||
| return typeTranslationKeysStrategy[reportFieldType]; | ||
|
|
@@ -29,6 +30,7 @@ function getReportFieldAlternativeTextTranslationKey(reportFieldType: PolicyRepo | |
| [CONST.REPORT_FIELD_TYPES.TEXT]: 'workspace.reportFields.textAlternateText', | ||
| [CONST.REPORT_FIELD_TYPES.DATE]: 'workspace.reportFields.dateAlternateText', | ||
| [CONST.REPORT_FIELD_TYPES.LIST]: 'workspace.reportFields.dropdownAlternateText', | ||
| [CONST.REPORT_FIELD_TYPES.FORMULA]: 'workspace.reportFields.formulaAlternateText', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Consistent alternative text mappingGood addition that maintains consistency with the existing pattern. The alternative text will help users understand what the FORMULA field type does. |
||
| }; | ||
|
|
||
| return typeTranslationKeysStrategy[reportFieldType]; | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Consistent constant naming
Good addition of the FORMULA constant that follows the existing naming convention and uses lowercase 'formula' as the value, which is consistent with the other report field types.