Skip to content
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

Fix error messages in display names #186

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

1ec5
Copy link
Member

@1ec5 1ec5 commented Dec 12, 2023

Temporarily replaced the localizable format string for a dated display name with a hard-coded format string. Replaced the format string for a data range with more robust usage of Intl.DateTimeFormatter.

Fixes OpenHistoricalMap/issues#652.

@1ec5 1ec5 added the bug label Dec 12, 2023
@1ec5 1ec5 self-assigned this Dec 12, 2023
expect(iD.utilDisplayName({tags: {name: 'ජය ශ්‍රී මහා බෝධිය', 'name:en': 'Jaya Sri Maha Bodhi', start_date: '-287'}})).to.eql('Jaya Sri Maha Bodhi [288 BC–]');
expect(iD.utilDisplayName({tags: {name: 'Son of the Tree That Owns Itself', start_date: '1946-12-04'}})).to.eql('Son of the Tree That Owns Itself [1946–]');
expect(iD.utilDisplayName({tags: {name: 'Great Elm', end_date: '1876-02-15'}})).to.eql('Great Elm [–1876]');
expect(iD.utilDisplayName({tags: {name: 'Arbre du Ténéré', 'name:en': 'Tree of Ténéré', start_date: '1673', end_date: '1973'}})).to.eql('Tree of Ténéré [1673 – 1973]');
Copy link
Member Author

@1ec5 1ec5 Dec 12, 2023

Choose a reason for hiding this comment

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

The en dash is surrounded by thin spaces, which barely show up in the browser when a variable-width font is applied. It does make the punctuation look a bit nicer when you squint at it though.

Temporarily replaced the localizable format string for a dated display name with a hard-coded format string. Replaced the format string for a data range with more robust usage of Intl.DateTimeFormatter.
@1ec5 1ec5 force-pushed the 1ec5-display-name-missing-translation-652 branch from 4c7bccc to 6f3d1e6 Compare December 12, 2023 21:26
@danrademacher
Copy link
Member

Testing locally with Chinese as my locale, I see this is working like this
image

@danrademacher danrademacher merged commit 663430b into staging Dec 13, 2023
2 checks passed
@1ec5 1ec5 deleted the 1ec5-display-name-missing-translation-652 branch December 13, 2023 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All labels replaced by error messages in non-English iD locale
2 participants