Skip to content

Add support for locales to cols_merge_range() #1423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 30, 2023

Conversation

rich-iannone
Copy link
Member

Range patterns across locales are different (e.g., can involve use of a single hyphen, en dash, em dash, tilde, etc.) and it does make sense to follow the convention of a locale. This can be specified in the initial gt() call, within a function (overriding the previous method, if it was used), and the effect of a locale setting can also be overridden by providing the separator text (we avoid the use of a "{1}<sep>{2}" pattern construction for sake of simplicity here.

This PR adds locale to cols_merge_range() and sets sep to NULL. If both are not used then the separator of the "en" locale or whichever locale set in gt() determines the separator. This doesn't break backwards compatibility. All existing code should work the same with no warnings given whatsoever.

Fixes: #158

@rich-iannone rich-iannone marked this pull request as ready for review August 29, 2023 17:57
@rich-iannone rich-iannone merged commit 4865657 into master Aug 30, 2023
@rich-iannone rich-iannone deleted the cols-merge-range-i18n branch August 30, 2023 03:19
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.

The cols_merge_range() function requires a locale argument
1 participant