Details
Components
Priority
majorFix versions
Assignee
Thomas BishopThomas BishopReviewer
Steven R. LoomisSteven R. LoomisReporter
Thomas BishopThomas BishopTime Needed
HoursMerged
Details
Details
Components
Priority
Fix versions
Assignee
Thomas Bishop
Thomas BishopReviewer
Steven R. Loomis
Steven R. LoomisReporter
Thomas Bishop
Thomas BishopTime Needed
Hours
Merged
Created March 4, 2025 at 6:32 PM
Updated 4 days ago
This is cloned from https://unicode-org.atlassian.net/browse/CLDR-11950 . The original design was that the back end should supply the front end with any URL(s) for linking to the locale(s) and path(s) from which a value is inherited and/or constructed. The design should be reconsidered in light of changes since the old ticket was created. In particular, the “Inheritance Explainer” feature duplicates some of the desired functionality, and the “Jump to original” description/link should be brought into better harmony with the Inheritance Explainer in both content and UI.
What is clear is that this code on the front end (cldrInfo.mjs) still has defects:
/** * Add a link in the Info Panel for "Jump to Original" (cldrText.get('followAlias')), * if theRow.inheritedLocale or theRow.inheritedXpid is defined. * * Normally at least one of theRow.inheritedLocale and theRow.inheritedXpid should be * defined whenever we have an INHERITANCE_MARKER item. Otherwise an error is reported * by checkRowConsistency. * * An alternative would be for the server to send the link, instead of inheritedLocale * and inheritedXpid, to the client, avoiding the need for the client to know so much, * including the need to replace 'code-fallback' with 'root' or when to use cldrStatus.getCurrentLocale() * in place of inheritedLocale or use xpstrid in place of inheritedXpid. * * @param {Object} theRow the row * @param {Object} item the candidate item */ function getLinkUrlAndText(theRow, item) { let linkUrl = null; let linkText = null; if ( item?.value === cldrSurvey.INHERITANCE_MARKER && (theRow?.inheritedLocale || theRow?.inheritedXpid) ) { let loc = theRow.inheritedLocale; let xpstrid = theRow.inheritedXpid || theRow.xpstrid; if (!loc) { loc = cldrStatus.getCurrentLocale(); } else if (loc === "code-fallback") { /* * Never use 'code-fallback' in the link, use 'root' instead. * On the server, 'code-fallback' sometimes goes by the name XMLSource.CODE_FALLBACK_ID. */ loc = "root"; } if (xpstrid === theRow.xpstrid && loc === cldrStatus.getCurrentLocale()) { // following the alias would come back to the current item; no link // and no link text either } else { linkText = cldrText.get("followAlias"); linkUrl = "#/" + loc + "//" + xpstrid; } } return { linkUrl, linkText }; }
The substitution of "code-fallback" with “root” is something that should be determined on the back end, not the front end. The interpretation that
theRow.inheritedXpid
being null/undefined (resulting inxpstrid === theRow.xpstrid
) implies “This item is constructed from other values” (noFollowAlias
) likewise is too much guesswork on the front end. The back end should make the actual situation unambiguous for constructed values.Old description (from https://unicode-org.atlassian.net/browse/CLDR-11950 before it was repurposed): the JavaScript function
getLinkUrlAndText
is the only place inheritedXpid is used on the client. The plan is for the server to send the link URL instead of inheritedXpid, to the client, avoiding the need for the client to know so much, including the need to replace 'code-fallback' with 'root' or when to use surveyCurrentLocale in place of inheritedLocale or use xpstrid in place of inheritedXpid.It’s not clear yet whether inheritedLocale will still be needed on the front end.