Skip to content

Prototype language proximity UI - #709

Open
preetsojitra2712 wants to merge 1 commit into
masterfrom
preet/language-proximity-ui-prototype
Open

Prototype language proximity UI#709
preetsojitra2712 wants to merge 1 commit into
masterfrom
preet/language-proximity-ui-prototype

Conversation

@preetsojitra2712

@preetsojitra2712 preetsojitra2712 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR starts the Language Proximity / Related Languages workstream by adding an initial UI/documentation foundation for representing macrolanguages, contained languages, dialects, and related-language relationships in LangNav.

Context

This follows a sync with Conrad about reviving the language proximity workstream with Jun/Wonjoon and Jingyi. The goal is to make LangNav better at explaining complex language relationships such as Chinese as a macrolanguage containing Mandarin, Cantonese, Wu, and other constituent languages.

Changes

  • Added initial documentation for the Language Proximity workstream.
  • Drafted GitHub issue breakdown for future work.
  • Added/prototyped a macrolanguage context note/banner if implemented.
  • Added/prototyped a related/contained languages widget if implemented.
  • Investigated current TSV/data ingestion flow if documented.

Notes

This is intentionally incremental. The goal is to create a small reviewable starting point before deeper ingestion/data-model work.

Future Work

  • Review Jingyi's Language Proximity worksheet.
  • Align with Wonjoon on language scope modeling.
  • Load proximity data into LangNav.
  • Add language comparison view.
  • Improve family tree/map visualizations.
  • Consider whether radar charts or simpler tables are more effective.

@preetsojitra2712
preetsojitra2712 requested a review from a team as a code owner July 8, 2026 06:45
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Cloudflare Pages preview

@preetsojitra2712

Copy link
Copy Markdown
Contributor Author

Hi @conradarcturus - I opened this PR as an initial prototype for the Language Proximity / Related Languages workstream.

This first PR does not import the new Language Proximity spreadsheet yet. I kept it intentionally incremental and used existing LangNav data only.

What this PR adds:

  • A macrolanguage / language-group context banner on language detail pages.

  • A new related languages section using existing data:

    • contained languages
    • dialects / varieties
    • CLDR related languages
    • clickable language cards when objects resolve
    • speaker counts where available
  • Documentation for the workstream and proposed next GitHub issues.

I also documented the current spreadsheet → TSV → parser → objects → website flow and drafted possible next steps for loading Jingyi’s Language Proximity dataset.

Build passed locally. Lint completed with exit code 0, though the repo still emits existing CRLF/Prettier warnings. Tests did not run successfully on my machine because my local Node version is v20.15.0, while some installed dependencies require >=20.19.0; I’ll rerun tests after upgrading Node.

I’d love your feedback on:

  1. Whether the banner wording feels right.
  2. Whether the related languages section should appear near the top or bottom.
  3. Whether this is the right first UI direction before we start importing the proximity dataset.

@conradarcturus conradarcturus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool! Thanks for moving so quickly to get it started. Let's break it down into smaller tasks but I really like where this is going.

@@ -0,0 +1,105 @@
# Language Proximity / Related Languages Workstream

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should document methodology not meeting notes.

Can you please put this in the workstream notes instead? https://docs.google.com/document/d/1bpnGq8aPss4RHeNU5huoyuKplQwx2UTZyx2sx-Rc6w8/edit?tab=t.7gb18zf57xm9#heading=h.1qdz19z1266w

@@ -0,0 +1,60 @@
# Draft GitHub Issues: Language Proximity

## Issue 1: Add macrolanguage context banner to language detail pages

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's keep this information in the github issues https://github.com/Translation-Commons/lang-nav/issues not in repo commits.

{hasChildren && (
<>
{' '}
<a href={`#${LANGUAGE_RELATIONS_SECTION_ID}`}>See contained languages.</a>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add a small ArrowDownToLineIcon to clarify. We should adapt InternalLink to allow for page scrolling params.

}}
>
<strong>{isMacrolanguage ? 'Macrolanguage context' : 'Language group context'}</strong>
<div style={{ marginTop: '0.35em' }}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here and everywhere else, please avoid random lengths. Use multiples of 0.25em (0.125, 0.25, .5, .75, 1, 1.5)

Comment on lines +68 to +69
<div id={LANGUAGE_RELATIONS_SECTION_ID}>
<DetailsSection title="Related Languages">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just add id as a prop you can pass into DetailsSection

Comment on lines +133 to +135
<div style={{ fontWeight: 'bold' }}>
<HoverableObjectName object={language} labelSource="name and code" />
</div>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can style HoverableObjectNames

Suggested change
<div style={{ fontWeight: 'bold' }}>
<HoverableObjectName object={language} labelSource="name and code" />
</div>
<HoverableObjectName object={language} labelSource="name and code"
style={{ display: 'block', fontWeight: 'bold' }} />

);
};

const RelationCard: React.FC<React.PropsWithChildren> = ({ children }) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for thinking about making a general RelationCard

Since you always include the HoverableObjectName maybe you should pass in an entity prop and have 1 standard HoverableObjectName here instead.

};

const RelationGroup: React.FC<RelationGroupProps> = ({ title, children }) => {
return (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you move this component to src\shared\ui and call it SmallCardGrid?

Not necessary in this PR but we'll want to add a component to clamp how many items are shown like CommaSeparated does (but the button "4 more" will be a grid card).

);
};

const CLDRRelationCard: React.FC<{ language: LanguageData; distance: number }> = ({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not commenting on this because there are so other things to comment on first :p

</div>
<RelationMeta label="Type" value={getLanguageScopeLabel(language.scope) ?? 'Language'} />
<RelationMeta
label="Speakers"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks funny when the language is not a spoken language, so I added a method to distinguish standard users when they are speakers or writers.

#715

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.

2 participants