Bug 28240

Summary: Some classes in register.tt are translatable
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: I18N/L10NAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: f.demians, martin.renvoize, oleonard
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Screenshot of register.pl in French

Description Caroline Cyr La Rose 2021-04-27 20:40:29 UTC
Hiya!

I usually whine because things are not translatable, but today I will whine because something is translatable. Hehe! 

I don't know if this is something that is meant to be this way or not, but the classes for "debit" and "credit" in register.tt are translatable, which means that, if translated, it prevents the colours from appearing. It's not the end of the world, but I was surprised when I switched to English and saw the red and green for debits and credits. 

To test:
1) Set up your system to use cash registers
(mine was already set up, so I'm doing this from memory)
  - In system preferences, enable UseCashRegisters
  - In Administration > Cash registers, set up a cash register
  - In Administration > Authorized values > PAYMENT_TYPE, add some payment types
2) Make some transactions
  - In a patron's file add some manual fees
  - Pay some fees, write off some others
3) Go to Tools > Cashup registers 
4) Click on the register name <-- Notice debits are red and credits are green
5) Install a new language
(again, mine was already installed, so doing this from memory)
  - In the terminal, go to misc/translator
  - gulp po:update
  - ./translate install xx-XX
6) Translate the line that looks like
"{ \"type\": \"credit\", \"identifier\": \"%s\", \"description\": \"%s "
"(%s)\", \"amount\": \"%s\" }"
Remove the "fuzzy" line if needed
7) Update your translation
  - ./translate install xx-XX
8) Go back to Koha, change the language
9) Go to Tools > Cashup registers 
10) Click on the register name <-- Notice credits are black

Again, it's not the end of the world, we'll just have to tell translators not to translate those lines.
Comment 1 Caroline Cyr La Rose 2021-04-27 21:19:51 UTC
I noticed it also prevents the sum to be displayed... (see attached screenshot)
So it's VERY important to NOT translate that line. It's not just a question of colours, but actual data...
Comment 2 Caroline Cyr La Rose 2021-04-27 21:20:47 UTC
Created attachment 120246 [details]
Screenshot of register.pl in French

See the "undefined" where the amount should be