Skip to content

Commit

Permalink
add translations for DELETE_TAG & UPDATE_TAG_ENABLED.
Browse files Browse the repository at this point in the history
Signed-off-by: krishna2323 <[email protected]>
  • Loading branch information
Krishna2323 committed Jan 12, 2025
1 parent dffaadd commit fce003e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4609,6 +4609,8 @@ const translations = {
updateCategory: ({oldValue, categoryName}: UpdatedPolicyCategoryParams) => `${oldValue ? 'disabled' : 'enabled'} the category "${categoryName}"`,
setCategoryName: ({oldName, newName}: UpdatedPolicyCategoryNameParams) => `renamed the category "${oldName}" to "${newName}"`,
addTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `added the tag "${tagName}" to the list "${tagListName}"`,
deleteTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `removed the tag "${tagName}" from the list "${tagListName}"`,
updateTagEnabled: ({tagListName, tagName, enabled}: UpdatedPolicyTagParams) => `${enabled ? 'enabled' : 'disabled'} the tag "${tagName}" on the list "${tagListName}"`,
addCustomUnitRate: ({customUnitName, rateName}: AddedPolicyCustomUnitRateParams) => `added a new "${customUnitName}" rate "${rateName}"`,
addedReportField: ({fieldType, fieldName}: AddedPolicyReportFieldParams) => `added ${fieldType} Report Field "${fieldName}"`,
preventSelfApproval: ({oldValue, newValue}: UpdatedPolicyPreventSelfApprovalParams) =>
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4657,6 +4657,8 @@ const translations = {
updateCategory: ({oldValue, categoryName}: UpdatedPolicyCategoryParams) => `${oldValue ? 'deshabilitó' : 'habilitó'} la categoría "${categoryName}"`,
setCategoryName: ({oldName, newName}: UpdatedPolicyCategoryNameParams) => `Renombró la categoría "${oldName}" a "${newName}".`,
addTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `agregó la etiqueta "${tagName}" a la lista "${tagListName}"`,
deleteTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `eliminó la etiqueta "${tagName}" de la lista "${tagListName}"`,
updateTagEnabled: ({tagListName, tagName, enabled}: UpdatedPolicyTagParams) => `${enabled ? 'habilitó' : 'deshabilitó'} la etiqueta "${tagName}" en la lista "${tagListName}"`,
addedReportField: ({fieldType, fieldName}: AddedPolicyReportFieldParams) => `agregó el Campo de Informe ${fieldType} "${fieldName}"`,
addCustomUnitRate: ({customUnitName, rateName}: AddedPolicyCustomUnitRateParams) => `agregó una nueva tasa de "${rateName}" para "${customUnitName}"`,
preventSelfApproval: ({oldValue, newValue}: UpdatedPolicyPreventSelfApprovalParams) =>
Expand Down
2 changes: 1 addition & 1 deletion src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ type UpdatedPolicyCurrencyParams = {oldCurrency: string; newCurrency: string};

type UpdatedPolicyCategoryParams = {categoryName: string; oldValue?: boolean};

type UpdatedPolicyTagParams = {tagListName: string; tagName: string};
type UpdatedPolicyTagParams = {tagListName: string; tagName: string; enabled?: boolean};

type UpdatedPolicyCategoryNameParams = {oldName: string; newName?: string};

Expand Down
16 changes: 15 additions & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ function getWorkspaceCategoryUpdateMessage(action: ReportAction): string {
}

function getWorkspaceTagUpdateMessage(action: ReportAction): string {
const {tagListName, tagName} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_CATEGORY>) ?? {};
const {tagListName, tagName, enabled} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_CATEGORY>) ?? {};

Check failure on line 1847 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'enabled' is assigned a value but never used

if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAG && tagListName && tagName) {
return Localize.translateLocal('workspaceActions.addTag', {
Expand All @@ -1853,6 +1853,20 @@ function getWorkspaceTagUpdateMessage(action: ReportAction): string {
});
}

if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_TAG && tagListName && tagName) {
return Localize.translateLocal('workspaceActions.deleteTag', {
tagListName,
tagName,
});
}

if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_ENABLED && tagListName && tagName) {
return Localize.translateLocal('workspaceActions.updateTagEnabled', {
tagListName,
tagName,
});
}

return getReportActionText(action);
}

Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ type OriginalMessagePolicyChangeLog = {

/** Updated tag list name */
tagListName?: string;

/** Updated tag enabled/disabled value */
enabled?: boolean;
};

/** Model of `join policy changelog` report action */
Expand Down

0 comments on commit fce003e

Please sign in to comment.