Summary: | Move debit and credit types to YAML files and fix other related translation issues | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | I18N/L10N | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, f.demians, jonathan.druart, magnus, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20307 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
With this patch the descriptions of system internal credit and debit types will be translated into the selected language at installation time. This will only affect new installations and SQL reporting. If you are building your own SQL reports, you'll be able to pull the descriptions from the tables.
It also makes sure, that all system internal debit and credit types appear translated in the GUI. This now also includes the administration pages for managing credit and debit types. Some descriptions for discount, payout, purchase, and void were missing. These have now also been added.
|
Version(s) released in: |
23.05.00,22.11.06
|
Circulation function: | |||
Bug Depends on: | 26418 | ||
Bug Blocks: | 14825, 33935 | ||
Attachments: |
Account summary showing English descriptions
YAML file for credit types Bug 26403: "Issue refund" is not fully translatable Bug 26403: (follow-up) Deleted old SQL files Bug 26403: "Issue refund" is not fully translatable Bug 26403: (follow-up) Deleted old SQL files Bug 26403: Move credit and debit types into translatable YAML files Bug 26403: (follow-up) Deleted old SQL files Bug 26403: Use accounts include in account management pages Bug 26403: Use accounts include in account management pages Bug 26403: Move credit and debit types into translatable YAML files Bug 26403: (follow-up) Deleted old SQL files Bug 26403: Use accounts include in account management pages Bug 26403: (QA follow-up) Add missing debit and credit types to includes Bug 26403: (QA follow-up) Add missing debit and credit types to includes |
Description
Katrin Fischer
2020-09-07 21:41:18 UTC
(In reply to Katrin Fischer from comment #0) > The new "issue refund" that is available for payments is not fully > translatable. This is a big issue. > > To test: > - Make sure a language with a complete translation is installed > - Switch to the language > - Go to any user account > - Add a manual invoice > - Pay it off fully or partially > - Click on "issue refund" > - Verify the list of "Transaction types" is not translated > - Check the information in the patron account. It will show: > > Payment from library to patron > A refund applied to a patrons fine > > - Check in the OPAC - same issue there. > > There is no option to edit the hardcoded credit and debit type descriptions? The reason one cannot edit the descriptions for these hardcoded types is precisely for translation reasons. If it's a system code it should appear in the translation template and thus the description in the DB will never get called. These are not credit types, but rather the 'payment_type' authorized values... as such to be translatable we need translatable AV's first.... or to merge payment_types into credit_types.. but I'm still not entirely sure about that one. (In reply to Martin Renvoize from comment #2) > These are not credit types, but rather the 'payment_type' authorized > values... as such to be translatable we need translatable AV's first.... or > to merge payment_types into credit_types.. but I'm still not entirely sure > about that one. Hm, it was labelled credit types - so maybe the label is wrong then? But what you are saying is good for the descriptions in the "history" - we "just" need to add them to the templates. I am not sure why this is BLOCKED? We can at least fix a part of this now and we should - translations for authorised values doesn't apply to all points here and it's not around the corner. Created attachment 109816 [details]
Account summary showing English descriptions
I've split this bug in two.. one for the description which is fixable and leaving this one here for the transaction type which is blocked by AV translations. Is this the bug for account_credit_types and account_debit_types being installed in English only? I have to go into every one of my installations and manually change the database descriptions... My problem is specifically when installing in another language, not switching between languages. My hypothesis is that those values are in installer/data/mysql/mandatory rather than installer/data/mysql/en/mandatory If they were in /en/, they would show up in the translation files. Does that make sense? Could we consider moving them? Created attachment 148940 [details]
YAML file for credit types
I tried to transfer the credit types into a yaml file to put into the /en/ directory. Didn't have time to do the rest (CASH payment type, which is also untranslated, and account debit types, and remove the sql files).
Let me know if this is OK and I'll be able to continue another day
Created attachment 149104 [details] [review] Bug 26403: "Issue refund" is not fully translatable This patch moves account debit and credit types, as well as the CASH payment type, into YAML files under installer/data/en/mandatory. This should make the debit and credit types translatable (for new installations only). To test: 1. Apply patch 2. Update po files ./misc/translator/translate update xx-XX 3. View the xx-XX-installer.po file -->The default account debit and credit types (and cash payment type) should be available to be translated 4. Translate the strings 5. Apply the translations ./misc/translator/translate install xx-XX 6. Load the new translated YAML files (with a fresh install, or by deleting the values in the db and using ./misc/load_yaml.pl to load the files) 7. In the staff interface, go to Administration > Credit types --> They should be translated 8. Go to Administration > Debit types --> They should be translated Created attachment 149105 [details] [review] Bug 26403: (follow-up) Deleted old SQL files Trying to apply the patches, I get this: $ git bz apply 26403 Bug 26403 Depends on bug 20307 (BLOCKED) As far as I can tell "Bug 20307 - Language overlay for authorized values" is for getting translateable authorised values in the interface, which would be another solution to this problem? Or is there a connection between these two bugs that I am not seeing? Created attachment 150744 [details] [review] Bug 26403: "Issue refund" is not fully translatable This patch moves account debit and credit types, as well as the CASH payment type, into YAML files under installer/data/en/mandatory. This should make the debit and credit types translatable (for new installations only). To test: 1. Apply patch 2. Update po files ./misc/translator/translate update xx-XX 3. View the xx-XX-installer.po file -->The default account debit and credit types (and cash payment type) should be available to be translated 4. Translate the strings 5. Apply the translations ./misc/translator/translate install xx-XX 6. Load the new translated YAML files (with a fresh install, or by deleting the values in the db and using ./misc/load_yaml.pl to load the files) 7. In the staff interface, go to Administration > Credit types --> They should be translated 8. Go to Administration > Debit types --> They should be translated Signed-off-by: Magnus Enger <magnus@libriotech.no> Created attachment 150745 [details] [review] Bug 26403: (follow-up) Deleted old SQL files Signed-off-by: Magnus Enger <magnus@libriotech.no> Followed the test plan. Works as advertised. Worked nicely without 20307 for me, so I am taking the liberty of changing that to a "see also". The templates use .inc files to make the system internal debit and credit types multi-lingual. So this will only affect reports or places where the description is pulled from the database directly (which we shouldn't do... but...) My initial bug was about things missing from the include files, this might be still something to investigate, but repurposing this one now. Created attachment 150912 [details] [review] Bug 26403: Move credit and debit types into translatable YAML files This patch moves account debit and credit types, as well as the CASH payment type, into YAML files under installer/data/en/mandatory. This should make the debit and credit types translatable (for new installations only). To test: 1. Apply patch 2. Update po files ./misc/translator/translate update xx-XX 3. View the xx-XX-installer.po file -->The default account debit and credit types (and cash payment type) should be available to be translated 4. Translate the strings 5. Apply the translations ./misc/translator/translate install xx-XX 6. Load the new translated YAML files (with a fresh install, or by deleting the values in the db and using ./misc/load_yaml.pl to load the files) 7. In the staff interface, go to Administration > Credit types --> They should be translated 8. Go to Administration > Debit types --> They should be translated Signed-off-by: Magnus Enger <magnus@libriotech.no> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> 150744 - Bug 26403: "Issue refund" is not fully translatable Created attachment 150913 [details] [review] Bug 26403: (follow-up) Deleted old SQL files Signed-off-by: Magnus Enger <magnus@libriotech.no> Followed the test plan. Works as advertised. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> The first two patches look like duplicates to me and I don't understand how the first one fixes the issue refund issue initially reported. Also, this encourages bad practice in so much as the DB level descriptions are not meant it be used. Has someone broken the use of the include somewhere to make this work.. the DB fields should ONLY be getting used for reports.. nowhere else Your just introducing double translation here. The "correct" patch would change the .description calls in the two tables to use the include as intended. I have a feeling that got undone during QA of the original patchsets that added these management pages. Created attachment 150925 [details] [review] Bug 26403: Use accounts include in account management pages This patch updates the credit and debit types management pages to use the proper includes for handling system type translations. This is how it should have been done in the first place on the original bugs that introduced the management of these types but for some reason I think it got dropped during the QA process leading to confusion around these system types with their fixed descriptions. Please try the final patch as an alternative. With this version you do not need to translate the strings again, they should already all be in appearance in the po files so we're no longer doubling up. You can also keep the original patches if you want.. but the test plan should be altered to: To test: 1. Apply patch 2. Update po files ./misc/translator/translate update xx-XX 3. View the xx-XX-installer.po file -->The default account debit and credit types (and cash payment type) should be available to be translated 4. Translate the strings 5. Apply the translations ./misc/translator/translate install xx-XX 6. Load the new translated YAML files (with a fresh install, or by deleting the values in the db and using ./misc/load_yaml.pl to load the files) 7. In the staff interface, go to Reports 8. Create a report that includes credit_type.description and debit_type.description 9. Run the report and note the translated values For ALL other occurrences of credit type or debit type in the UI and notices, you should find translations are already applied using the template based translations. Created attachment 150932 [details] [review] Bug 26403: Use accounts include in account management pages This patch updates the credit and debit types management pages to use the proper includes for handling system type translations. This is how it should have been done in the first place on the original bugs that introduced the management of these types but for some reason I think it got dropped during the QA process leading to confusion around these system types with their fixed descriptions. To test: 1. Apply patch 2. Apply the translations ./misc/translator/translate install xx-XX 3. In the staff interface, go to Administration > Credit types --> They should be translated 4. Go to Administration > Debit types --> They should be translated I think we should do both. 1) Web installer: It will help with SQL reporting where you can't use the includes. I have translated ours in the database for this reason and it has no bad side effects. 2) Template fixes: These are great, because they fix what I initially had reported. Actually, I think we might need some more template fixes, but are on a good road here. Looking at my original test plan: To test: - Make sure a language with a complete translation is installed - Switch to the language - Go to any user account - Add a manual invoice - Pay it off fully or partially - Click on "issue refund" - Verify the list of "Transaction types" is not translated - Check the information in the patron account. It will show: I'll try to test this now. (In reply to Katrin Fischer from comment #25) > Actually, I think we might need some more template fixes, but are on a good > road here. > > Looking at my original test plan: > > To test: > - Make sure a language with a complete translation is installed > - Switch to the language > - Go to any user account > - Add a manual invoice > - Pay it off fully or partially > - Click on "issue refund" > - Verify the list of "Transaction types" is not translated Only Cash stands out there, the other entries are translated now. This will be fixed by Caroline's adding Cash to the web installer files, because this list is part hard coded and part coming from AV: [% FOREACH pt IN payment_types %] <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> [% END %] > - Check the information in the patron account. It will show: Some debit and credit types are missing from the includes. I'll provide a follow-up. Created attachment 150941 [details] [review] Bug 26403: Move credit and debit types into translatable YAML files This patch moves account debit and credit types, as well as the CASH payment type, into YAML files under installer/data/en/mandatory. This should make the debit and credit types translatable (for new installations only). To test: 1. Apply patch 2. Update po files ./misc/translator/translate update xx-XX 3. View the xx-XX-installer.po file -->The default account debit and credit types (and cash payment type) should be available to be translated 4. Translate the strings 5. Apply the translations ./misc/translator/translate install xx-XX 6. Load the new translated YAML files (with a fresh install, or by deleting the values in the db and using ./misc/load_yaml.pl to load the files) 7. In the staff interface, go to Administration > Credit types --> They should be translated 8. Go to Administration > Debit types --> They should be translated Signed-off-by: Magnus Enger <magnus@libriotech.no> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 150942 [details] [review] Bug 26403: (follow-up) Deleted old SQL files Signed-off-by: Magnus Enger <magnus@libriotech.no> Followed the test plan. Works as advertised. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 150943 [details] [review] Bug 26403: Use accounts include in account management pages This patch updates the credit and debit types management pages to use the proper includes for handling system type translations. This is how it should have been done in the first place on the original bugs that introduced the management of these types but for some reason I think it got dropped during the QA process leading to confusion around these system types with their fixed descriptions. To test: 1. Apply patch 2. Apply the translations ./misc/translator/translate install xx-XX 3. In the staff interface, go to Administration > Credit types --> They should be translated 4. Go to Administration > Debit types --> They should be translated Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 150944 [details] [review] Bug 26403: (QA follow-up) Add missing debit and credit types to includes This adds the missing debit and credit types to the includes, namely: DISCOUNT, PURCHASE, PAYOUT, and VOID. I sorted them as they appear in the GUI (alphabetically) so it's a little easier to spot missing ones. Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 150946 [details] [review] Bug 26403: (QA follow-up) Add missing debit and credit types to includes This adds the missing debit and credit types to the includes, namely: DISCOUNT, PURCHASE, PAYOUT, and VOID. I sorted them as they appear in the GUI (alphabetically) so it's a little easier to spot missing ones. Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Pushed to master for 23.05. Nice work everyone, thanks! Nice one everyone, thanks for the further follow-up Katrin :) Nice work everyone! Pushed to stable for 22.11.x Nobody tried the installer process? There are issues reported on the mailing list. There are still occurrences of the sql files! % git grep account_credit_types.sql (In reply to Jonathan Druart from comment #35) > Nobody tried the installer process? There are issues reported on the mailing > list. > > There are still occurrences of the sql files! > % git grep account_credit_types.sql See 33935. |