[PR #5212] [MERGED] add some basic linting rules for translation consistency #5825

Closed
opened 2026-02-28 21:19:19 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5212
Author: @matt-fidd
Created: 6/21/2025
Status: Merged
Merged: 7/4/2025
Merged by: @matt-fidd

Base: masterHead: translate/lint


📝 Commits (10+)

📊 Changes

65 files changed (+490 additions, -190 deletions)

View changed files

📝 bin/release-note-generator.ts (+1 -1)
📝 eslint.config.mjs (+11 -22)
📝 package.json (+0 -1)
📝 packages/component-library/src/Toggle.tsx (+1 -1)
📝 packages/component-library/src/styles.ts (+1 -1)
📝 packages/desktop-client/e2e/fixtures.ts (+1 -1)
📝 packages/desktop-client/src/auth/ProtectedRoute.tsx (+4 -1)
📝 packages/desktop-client/src/components/CommandBar.tsx (+1 -1)
📝 packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx (+6 -2)
📝 packages/desktop-client/src/components/forms.tsx (+3 -3)
📝 packages/desktop-client/src/components/mobile/MobileBackButton.tsx (+2 -3)
📝 packages/desktop-client/src/components/modals/AccountMenuModal.tsx (+2 -2)
📝 packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx (+2 -2)
📝 packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx (+3 -4)
📝 packages/desktop-client/src/components/modals/CategoryMenuModal.tsx (+2 -2)
📝 packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx (+51 -17)
📝 packages/desktop-client/src/components/modals/ConfirmTransactionDeleteModal.tsx (+3 -3)
📝 packages/desktop-client/src/components/modals/ConfirmUnlinkAccountModal.tsx (+2 -2)
📝 packages/desktop-client/src/components/modals/CreateAccountModal.tsx (+1 -1)
📝 packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx (+1 -1)

...and 45 more files

📄 Description

Here's my stab at getting some linting rules in for translation. These aren't perfect but should lighten the load on reviews.

There are two rules here:

  • One to prevent completely untranslated strings
  • One to prevent patterns like the below:
-        {t('Back')}
+        <Trans>Back</Trans>

The latter will even autofix!

The rest of this change is cleanup of the custom lint rules while I was there, fixing the remaining translation issues these rules found, and tidying up a TODO in the lint config.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5212 **Author:** [@matt-fidd](https://github.com/matt-fidd) **Created:** 6/21/2025 **Status:** ✅ Merged **Merged:** 7/4/2025 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `translate/lint` --- ### 📝 Commits (10+) - [`7bf5bd0`](https://github.com/actualbudget/actual/commit/7bf5bd087588b8acea403dbcdd4c4d8fd955475e) lint rules - [`6ec0c82`](https://github.com/actualbudget/actual/commit/6ec0c829806ed715dc01f564e7a726ed5f5cd502) trans rule - [`fda5b92`](https://github.com/actualbudget/actual/commit/fda5b923f6807e0cb7150c35612af7df6f0ff822) migrate away from rulesDir config - [`bf0d5bc`](https://github.com/actualbudget/actual/commit/bf0d5bc0cb23dc642b1ff9faf934ac4e5c6066d9) fixes - [`e237b42`](https://github.com/actualbudget/actual/commit/e237b426f0e07183431daa3436e1e9a8403ece70) prefer Trans to t() - [`0e1f53e`](https://github.com/actualbudget/actual/commit/0e1f53e990d6998c050016cf219c64c1d4402666) typechecker - [`94bd8b3`](https://github.com/actualbudget/actual/commit/94bd8b3741cf6f63e0a4914e7c3fd462ca651344) cleanup - [`290d72e`](https://github.com/actualbudget/actual/commit/290d72e4e7e10574b42d2ef27a958c1307e112cd) note - [`f954c06`](https://github.com/actualbudget/actual/commit/f954c0663f72c21575561576763d8afb7f0b6660) typo - [`399e778`](https://github.com/actualbudget/actual/commit/399e7780f4ebf3728f0f65c498bedb67df1c83b8) extend regex to include punctuation ### 📊 Changes **65 files changed** (+490 additions, -190 deletions) <details> <summary>View changed files</summary> 📝 `bin/release-note-generator.ts` (+1 -1) 📝 `eslint.config.mjs` (+11 -22) 📝 `package.json` (+0 -1) 📝 `packages/component-library/src/Toggle.tsx` (+1 -1) 📝 `packages/component-library/src/styles.ts` (+1 -1) 📝 `packages/desktop-client/e2e/fixtures.ts` (+1 -1) 📝 `packages/desktop-client/src/auth/ProtectedRoute.tsx` (+4 -1) 📝 `packages/desktop-client/src/components/CommandBar.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx` (+6 -2) 📝 `packages/desktop-client/src/components/forms.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/mobile/MobileBackButton.tsx` (+2 -3) 📝 `packages/desktop-client/src/components/modals/AccountMenuModal.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx` (+3 -4) 📝 `packages/desktop-client/src/components/modals/CategoryMenuModal.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx` (+51 -17) 📝 `packages/desktop-client/src/components/modals/ConfirmTransactionDeleteModal.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/modals/ConfirmUnlinkAccountModal.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/modals/CreateAccountModal.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx` (+1 -1) _...and 45 more files_ </details> ### 📄 Description Here's my stab at getting some linting rules in for translation. These aren't perfect but should lighten the load on reviews. There are two rules here: - One to prevent completely untranslated strings - One to prevent patterns like the below: ```diff - {t('Back')} + <Trans>Back</Trans> ``` The latter will even autofix! The rest of this change is cleanup of the custom lint rules while I was there, fixing the remaining translation issues these rules found, and tidying up a TODO in the lint config. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:19:19 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5825