Skip to content

localize dates according to document lang in NL, DE and EN (default)#150

Open
gronke wants to merge 5 commits into
radicallyopensecurity:mainfrom
gronke:feat/localized-dates
Open

localize dates according to document lang in NL, DE and EN (default)#150
gronke wants to merge 5 commits into
radicallyopensecurity:mainfrom
gronke:feat/localized-dates

Conversation

@gronke

@gronke gronke commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

Localizes dates in Dutch, German and English (default) with custom functions.

Hardcoding the month names helps to avoid fiddling with Saxon and Java.

@gronke gronke requested a review from PeterMosmans June 3, 2025 19:24
syrosh
syrosh previously approved these changes Jun 5, 2025

@syrosh syrosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

I think it's fine to go ahead with hard coded values. Maybe adding the Java way if we need to support more localization.

@PeterMosmans PeterMosmans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Currently, as it stands, this errors out if there's no date (yet) set:

Error at char 36 in xsl:value-of/@select on line 321 column 106 of meta.xslt:
  XPST0008  Variable date has not been declared (or its declaration is not in scope)

I'm thinking of whether we can support a default (?) language as fallback, in order to ensure backwards compatibility?

gronke and others added 5 commits March 20, 2026 13:22
Use @Date attribute instead of undeclared $date variable in version
history, and use the -tbd variant to handle missing dates gracefully.
Default lang parameter to 'en' when xml:lang is not set.
@gronke gronke force-pushed the feat/localized-dates branch from d0b6d9d to 683be03 Compare March 20, 2026 13:26
@gronke

gronke commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Currently, as it stands, this errors out if there's no date (yet) set:

Error at char 36 in xsl:value-of/@select on line 321 column 106 of meta.xslt:
  XPST0008  Variable date has not been declared (or its declaration is not in scope)

I'm thinking of whether we can support a default (?) language as fallback, in order to ensure backwards compatibility?

@PeterMosmans does 683be03 solve this? Could you test again?

@PeterMosmans

Copy link
Copy Markdown
Contributor

Thanks for the changes, will re-check

@PeterMosmans

Copy link
Copy Markdown
Contributor

It looks like something goes wrong with parsing version info in the document properties - the dates are now full timestamps:

May 21, 201500:00:00

Tested with different lang= settings

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.

3 participants