-
Notifications
You must be signed in to change notification settings - Fork 99
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
Recommendation: Avoid duplicate translation keys #191
Comments
We planed to design the translation file entirely, do you think it is not
|
If we fix this sooner, the less work we will have to do later. It is similar to building components first, then using them in the module. I say we do it sooner rather than later! |
This commit cleans up the form simple voucher form's worst hacks and replaces them with _slightly_ cleaner code. It also implements a clear() button. Closes #191.
* feat(voucher): Patient Invoice Debt Transfer This commit implements a payment of a patient's debts via the Simple Voucher module. The debts are written off towards an account - in the present use case, against an account belonging to a debtor group. * fix(vouchers): implement clear() on form This commit cleans up the form simple voucher form's worst hacks and replaces them with _slightly_ cleaner code. It also implements a clear() button. Closes IMA-WorldHealth#191. * fix(currency): improve translation/rendering This commit improves the bhCurrencyInput's translation and rendering by making sure the currency is always rendered in uppercase and using the more efficient translate directive instead of the translate filter. * refactor(vouchers): SimpleVoucher use VoucherForm This commit refactors the Simple Voucher module to use the VoucherForm. The VoucherForm brings with it numerous advantages: 1. Better error detection and handling 2. Built-in caching. 3. Cleaner separation of view/model This makes the SimpleVoucher module much easier to extend and operate in the future. * fix(vouchers): fix e2e test This commit fixes a case-sensitive issue in the simple vouchers form. * fix(voucher): fix general bugs This commit fixes the simple vouchers to have more maintainable code, closes some tags, and makes sure that the appropriate values are triggered when the scan barcode modal closes.
Our translation files always seem to be expanding. I've noticed lots of additions in PRs coming into the repository. You can also see for yourself, just run this command (linux):
You should see the following output:
That is a lot of repeated phrases that are hard to maintain, wasted space when shipped to the client, difficult to find and edit, and overall just poor programming practice.
Proposal
Someone should create form translation keys that can be used by any module to convey generic messages such as "created", "updated", "errored", etc. It would look like this:
With just this simply consolidation, we can probably eliminate > 100 lines from our translation files.
@DedrickEnc , would you review this proposal and assign it to someone if you think it is a good idea?
The text was updated successfully, but these errors were encountered: