Bug 38523

Summary: Simple quote in ILL standard form JS can break translations
Product: Koha Reporter: Victor Grousset/tuxayo <victor>
Component: I18N/L10NAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: f.demians, jonathan.druart, pedro.amorim
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:
Bug Depends on: 36221, 38340    
Bug Blocks:    

Description Victor Grousset/tuxayo 2024-11-23 03:28:08 UTC
Follow-up of Bug 36221.

In Koha/ILL/Backend/shared-includes/shared.js

'" name="custom_key" placeholder="'+__('key')+'">' +
' ' +
'<input type="text" id="custom-value" name="custom_value" class="' +
( opac ? 'form-control input-fluid custom-field-input' : '') +'" placeholder="'+__('value')+'"> ' +
'<button type="button" class="btn btn-danger btn-sm ' +
'delete-new-field">' +
'<span class="fa fa-trash-can"></span> ' +
__('Delete') +
[...]
$('#custom-warning').text(__("The name '%s' is not permitted").format(val)).show();

-------

This will need to be tested once bug 38340 has patches.
For now stuff is not translatable but once it is, it's expected the JS can break if the translated string contains a simple quote.

-------

xt/single_quotes.t doesn't catch it because the test only searches in
koha-tmpl/opac-tmpl/bootstrap/en/
koha-tmpl/intranet-tmpl/prog/en/