Skip to content

Conversation

gregoriopellegrino
Copy link
Collaborator

As discussed in issue #688

As discussed in issue #688
@mattgarrish
Copy link
Member

Just on a skim this looks fine, but it's a headache to implement to test. If I switch over to placeholders, either I have to duplicate the code to continue to account for the 2.0 files or I'm back to only being able to display English.

We should try and hurry this revision along after adding, perhaps not taking up any additional issues, so we can deprecate 2.0 and get the translations updated.

@mattgarrish
Copy link
Member

mattgarrish commented Jul 8, 2025

One issue I noticed that's not directly covered here is the certifier's report. The algorithm says to replace the entire string with a hyperlink, but the examples in the guidelines show only the words "certifier's report" hyperlinked. The guidelines approach makes more sense, but is there a way to accommodate that with a placeholder since it's not possible to know what words to hyperlink in any other language.
.
It's similar to these placeholders, especially the email link, except instead of replacing with a variable value we want the marked text hyperlinked. Maybe something other than braces would work to identify the linkable text, like brackets?

(edit: changed last sentence from suggesting percent sign to bracket since we are using braces.)

@mattgarrish
Copy link
Member

I've finished implementing this now. The only other slightly tangential comment I have is that maybe we should say something about localizing the date, not just to replace the placeholder with whatever value you get from the metadata. No matter the language it may need some processing, if not to turn the date into the local language then to process out an attached time.

It could just go in the variable setup description, but it's a unique case of localizing the publisher data.

in the guidelines for more information on how to present these strings.</p>
</div>

<span><b>IF</b> <var>epub_accessibility_10</var> <b>OR</b> <var>epub_accessibility_11</var> <b>OR</b> <var>wcag_20</var> <b>OR</b> <var>wcag_21</var> <b>OR</b> <var>wcag_22</var> <b>OR</b> <var>level_aaa</var> <b>OR</b> <var>level_aa</var> <b>OR</b> <var>level_a</var>:</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clapierre made me aware that if you don't have complete metadata this section will generate some weird statements like "This publication claims to conform to EPUB Accessibility 1.1 Level AA" or even just "This publication claims to conform to Level AA" after processing the placeholders.

To avoid this, the test here might need to be modified to be more thorough in what is expected. To check that we get complete statements it could be:

IF (epub_accessibility_10 OR epub_accessibility_11) AND (wcag_20 OR wcag_21 OR wcag_22) AND (level_aaa OR levela_aa OR level_a):

If we really need to support wcag conformance statements without accompany epub accessibility conformance, then it gets harder as you'd have to test that the epub statements aren't also accompanied by partial wcag statements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have fixed this.

@gregoriopellegrino
Copy link
Collaborator Author

I've finished implementing this now. The only other slightly tangential comment I have is that maybe we should say something about localizing the date, not just to replace the placeholder with whatever value you get from the metadata. No matter the language it may need some processing, if not to turn the date into the local language then to process out an attached time.

It could just go in the variable setup description, but it's a unique case of localizing the publisher data.

I have included a dedicated instruction for formatting the date and a note explaining why, with examples.

@gautierchomel
Copy link
Collaborator

Waiting for @mickael-menu & @HadrienGardeur feedback as they originated the issue.

Copy link
Contributor

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good and addresses the issues I raised in #688. Thank you all.

@gregoriopellegrino gregoriopellegrino merged commit 2312b77 into main Sep 11, 2025
@gregoriopellegrino gregoriopellegrino deleted the placeholder-localization branch September 11, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants