Skip to content

Implement accessibility.pluralize for Finnish - #105

Open
SeSodesa wants to merge 5 commits into
Mc-Zen:mainfrom
SeSodesa:accessibility.pluralize.finnish
Open

Implement accessibility.pluralize for Finnish#105
SeSodesa wants to merge 5 commits into
Mc-Zen:mainfrom
SeSodesa:accessibility.pluralize.finnish

Conversation

@SeSodesa

@SeSodesa SeSodesa commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This is a continuation of #88. The first commit implements pluralize but is there something else that needs to get done?

@SeSodesa
SeSodesa marked this pull request as draft August 4, 2026 13:58
…f the function

This might avoid unnecessary allocations. Not sure how Typst handles this internally.
@SeSodesa

SeSodesa commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

The second commit moves dictionary definitions out of the pluralize function, just in case Typst allocates them during every function call.

@SeSodesa

SeSodesa commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@Mc-Zen This might be in a usable state now. Let me know if there is something missing, although I cannot promise I can work on this after the next 30--40 minutes is gone.

@SeSodesa
SeSodesa marked this pull request as ready for review August 4, 2026 14:09
Comment thread src/accessibility.typ Outdated
Comment thread src/accessibility.typ Outdated

@hpcfzl hpcfzl 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.

These entries sure add to the overall length, just as a suggestion have you thought about combining str.slice and the ssa/ssä suffixes as needed?

@Mc-Zen

Mc-Zen commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Yes, deriving the denominator unit versions from the plural versions could be done with a simple rule. However, I have a different problem with the denominator versions: As I understand, they also replace the per phrase. Currently, the output for m/s would be metriä jaettuna sekunnissa which I gather is wrong. Either we go with the simpler way (although not quite idiomatic to the language) or I could add some logic to remove the per phrase.

I can deal with this implementation but I have one question for @SeSodesa : what happens if multiple units are in the denominator? Like V/(m s), would that be voltti metrissä sekunnissa or does it get more complicated? If it gets more complicated, I would vote for the more generic version withthe per phrase.

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