[Bug 44108] New: Ensure no new incorrect format calls will be pushed
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 Bug ID: 44108 Summary: Ensure no new incorrect format calls will be pushed Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: I18N/L10N Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org CC: caroline.cyr-la-rose@inlibro.com, f.demians@tamil.fr, jonathan.druart@gmail.com, julian.maurice@biblibre.com Depends on: 44097, 44105, 44107 Target Milestone: --- We need a test to prevent incorrect format() calls like bug 44097, bug 44105 and bug 44107. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44097 [Bug 44097] Patron search "starting with" and "containing" untranslatable https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44105 [Bug 44105] "Surname begins with" not translatable https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44107 [Bug 44107] "Add last %s items to a train" not translatable -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 211610 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211610&action=edit Bug 44108: Add xt test for strings formatted before translation Prevent new occurrences like bug 44097, bug 44105 and bug 44107. This test catches calls to a method on a string literal inside a translation function, e.g. _("%s starting with '%s'".format(field, pattern)) instead of _("%s starting with '%s'").format(field, pattern) It checks .tt, .inc, .js, .ts and .vue files (vendored lib/ excluded) and handles multi-line calls. Test plan: prove xt/find-misplaced-translation-format.t => Pass Revert the previous patches (from 44097 44105 44107) => The test fails with xt/find-misplaced-translation-format.t .. 1/3 # Failed test 'No method called on a string literal inside a translation function (see bug 44097)' # at xt/find-misplaced-translation-format.t line 64. # got: '4' # expected: '0' # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:504: _("%s starting with '%s'".format( # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:506: _("%s containing '%s'".format( # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:532: _("Surname begins with '%s'".format( # koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingListResource.vue:138: $__( # "Add last %s items to a train".format( # Looks like you failed 1 test of 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211610|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 211626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211626&action=edit Bug 44108: Add xt test for strings formatted before translation Prevent new occurrences like bug 44097, bug 44105 and bug 44107. This test catches calls to a method on a string literal inside a translation function, e.g. _("%s starting with '%s'".format(field, pattern)) instead of _("%s starting with '%s'").format(field, pattern) It checks .tt, .inc, .js, .ts and .vue files (vendored lib/ excluded) and handles multi-line calls. Test plan: prove xt/i18n/find-misplaced-translation-format.t => Pass Revert the previous patches (from 44097 44105 44107) => The test fails with xt/find-misplaced-translation-format.t .. 1/3 # Failed test 'No method called on a string literal inside a translation function (see bug 44097)' # at xt/find-misplaced-translation-format.t line 64. # got: '4' # expected: '0' # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:504: _("%s starting with '%s'".format( # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:506: _("%s containing '%s'".format( # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:532: _("Surname begins with '%s'".format( # koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingListResource.vue:138: $__( # "Add last %s items to a train".format( # Looks like you failed 1 test of 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Moved the test to xt/i18n as I am going to add more tests under this new dir. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211626|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 212045 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212045&action=edit Bug 44108: Add xt test for strings formatted before translation Prevent new occurrences like bug 44097, bug 44105 and bug 44107. This test catches calls to a method on a string literal inside a translation function, e.g. _("%s starting with '%s'".format(field, pattern)) instead of _("%s starting with '%s'").format(field, pattern) It checks .tt, .inc, .js, .ts and .vue files (vendored lib/ excluded) and handles multi-line calls. Test plan: prove xt/i18n/find-misplaced-translation-format.t => Pass Revert the previous patches (from 44097 44105 44107) => The test fails with xt/find-misplaced-translation-format.t .. 1/3 # Failed test 'No method called on a string literal inside a translation function (see bug 44097)' # at xt/find-misplaced-translation-format.t line 64. # got: '4' # expected: '0' # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:504: _("%s starting with '%s'".format( # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:506: _("%s containing '%s'".format( # koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:532: _("Surname begins with '%s'".format( # koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingListResource.vue:138: $__( # "Add last %s items to a train".format( # Looks like you failed 1 test of 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44108 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org