Localization timing issues

6 views
Skip to first unread message

Andrew Scholer

unread,
Aug 25, 2025, 2:01:29 PM (13 days ago) Aug 25
to prete...@googlegroups.com
Mostly for Rob...

I was digging into allowing localizations in "representations" so that runestone-to-static can write localized strings. As I did so, I realized that mode="type-name" depends on the "language" pass in assembly. So freeing it from $docinfo still leaves a dependency on a pass that comes after "representations".

Let me know if you have any ideas for a fix to that issue. My hacky idea is to let representations drop a <localize>TEXT</localize> that gets cleaned up by the "language" pass.

Or, we can postpone trying to localize in representations and I can just fixup the QR code PR without the broader fix.

Andrew Scholer (he/him/his)
Computer Science Instructor
Chemeketa Community College

Rob Beezer

unread,
Aug 25, 2025, 4:30:39 PM (13 days ago) Aug 25
to prete...@googlegroups.com
> depends on the "language" pass

Aaargh. Why can't we do everything first?

How about a #pi:localize element? I'd think it could be resolved in -common?

And maybe not TEXT, but @string-id that maps 1-1 into the named template that
will grab the right translation?

And as a precursor PR with a final commit that has a throw-away non-sensical use
within some representation (like current #sidebyside) to experiment with?

Rob
> computerscience.chemeketa.edu/people/andrew-scholer/ <http://
> computerscience.chemeketa.edu/people/andrew-scholer/>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CACm44N8HMPSBkhAa-os%3Dy_JUAuzKAunTVwVPXrhXPRXSnU6dNg%40mail.gmail.com <https://
> groups.google.com/d/msgid/pretext-dev/CACm44N8HMPSBkhAa-
> os%3Dy_JUAuzKAunTVwVPXrhXPRXSnU6dNg%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Andrew Scholer

unread,
Aug 26, 2025, 5:15:48 PM (12 days ago) Aug 26
to prete...@googlegroups.com
Implemented a version here:
https://github.com/PreTeXtBook/pretext/pull/2682

I was not able to use a modeless template in common to handle <pi:localize>. There were too many spots where ancestors ended up making assumptions about their contents and not calling apply-templates on things they were not expecting.

So instead, the pi:localize are processed as part of the "lanugage" pass in assembly. It could be made into its own pass, but logically it fits in there and there aren't many templates to worry about in that mode.

Andrew Scholer (he/him/his)
Computer Science Instructor
Chemeketa Community College

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMC5iZWV6ZXI.1756153836%40pnsh.
Reply all
Reply to author
Forward
0 new messages