Created attachment 189316 [details] [review] Bug 41216: Restore tt_valid.t HTML1 is gone. Almost... The previous rule said that we could not have TT tags within HTML tags because it caused problems with the translation. It was incorrect. Bug 38720 removed that rule, and stated that the only problematic use was a IF with ">". It was also incorrect. This one bug states that we cannot have TT tags to construct HTML tags IF one of the attribute contains a translatable string. The list of translatable attributes are listed in tmpl_process3.pl. This patch restores xt/tt_valid.t (and move it to xt/author) and adjust slightly the test to take into account this last statement. Test plan: 0. Apply only this first patch 1. Run xt/author/tt_valid.t => It fails on mana-subscription-search-result.inc 2. Update po for your prefered language => The string "This resource has been reported more than" is not in the po files 3. Apply the second patch, repeat 1 and 2 => It still fails: adding a space between the TT tag and the attribute is not enough here => The string is picked now! but... install the template and open the translated version => 4. Apply the third patch, repeat 1 and 2 => The tests pass! => The string is still picked, install => The template looks good! Now if you are familiar with Mana you can try to see the translated string on the UI
Created attachment 189317 [details] [review] Bug 41216: Try to fix by adding a space between TT tag and attribute
Created attachment 189318 [details] [review] Bug 41216: Correctly fix the translation using I18N
You added a singular version of the text but I don't think it makes sense here, as the warning is displayed only if tr_warning is > 5 (lowWarned) Other than that, I followed the test plan and it works well.
(In reply to Julian Maurice from comment #4) > You added a singular version of the text but I don't think it makes sense > here, as the warning is displayed only if tr_warning is > 5 (lowWarned) > > Other than that, I followed the test plan and it works well. Yes but I don't know what else we can do. We still want to support languages with multiple plurals.
(In reply to Jonathan Druart from comment #5) > Yes but I don't know what else we can do. We still want to support languages > with multiple plurals. I forgot about that. So it does make sense, even if the singular version is not used
Created attachment 189328 [details] [review] Bug 41216: Restore tt_valid.t HTML1 is gone. Almost... The previous rule said that we could not have TT tags within HTML tags because it caused problems with the translation. It was incorrect. Bug 38720 removed that rule, and stated that the only problematic use was a IF with ">". It was also incorrect. This one bug states that we cannot have TT tags to construct HTML tags IF one of the attribute contains a translatable string. The list of translatable attributes are listed in tmpl_process3.pl. This patch restores xt/tt_valid.t (and move it to xt/author) and adjust slightly the test to take into account this last statement. Test plan: 0. Apply only this first patch 1. Run xt/author/tt_valid.t => It fails on mana-subscription-search-result.inc 2. Update po for your prefered language => The string "This resource has been reported more than" is not in the po files 3. Apply the second patch, repeat 1 and 2 => It still fails: adding a space between the TT tag and the attribute is not enough here => The string is picked now! but... install the template and open the translated version => 4. Apply the third patch, repeat 1 and 2 => The tests pass! => The string is still picked, install => The template looks good! Now if you are familiar with Mana you can try to see the translated string on the UI Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 189329 [details] [review] Bug 41216: Try to fix by adding a space between TT tag and attribute Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 189330 [details] [review] Bug 41216: Correctly fix the translation using I18N Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Some are false positives (french words treated like english typos), but I think we need to address them. [FAIL] koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc FAIL valid_template parse error - /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc line 43: unexpected end of directive [% SET tr_title = I18N.tnx('This resource has already been reported', 'This resource has been reported more than {count} times, take care!', tr_warning, { count = tr_warning } %] [WARN] t/db_dependent/misc/translator/xgettext.pl.t WARN spelling attribut ==> attribute attribut ==> attribute [FAIL] xt/author/tt_valid.t FAIL file_permissions File must have the exec flag FAIL forbidden_patterns forbidden pattern: Use https:// instead of http:// for URLs (line 16) WARN spelling attibutes ==> attributes
Created attachment 190046 [details] [review] Bug 41216: Correctly fix the translation using I18N Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Amended-by: Add missing closing parenthesis
Created attachment 190047 [details] [review] Bug 41216: Fix QA failures Patch from commit 523c425
(In reply to Tomás Cohen Arazi (tcohen) from comment #10) > Some are false positives (french words treated like english typos), but I > think we need to address them. Oops, sorry about that!