Skip to content

Conversation

@snprajwal
Copy link
Contributor

@snprajwal snprajwal commented Nov 5, 2025

Bug/issue #, if applicable: rdar://163926698

Summary

When the render node translator visits articles, it emits variants for each language that the article is supported in. This step is skipped if an article-only catalog is being built, since it would otherwise lead to a redundant "Swift" language marker being rendered in the page. However, if a catalog contains more than one module, i.e. an article-only module and a different module's symbol graph in the same catalog, then the variants are not emitted despite the possibility of the page being available in more than one language. This commit changes the boolean check to skip emitting variants only if all roots modules are article-only. It does not affect the behaviour when building a correctly configured catalog that contains a sole root module.

Dependencies

N/A

Testing

A new test has been added to verify this behaviour. A nested helper function that was duplicated multiple times has been extracted into a standalone function that can be reused across tests. The tests have been refactored accordingly to use this function instead.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@snprajwal
Copy link
Contributor Author

@swift-ci please test

One of the test methods in `RenderNodeTranslatorTests` was duplicated
multiple times. It has been extracted out of the tests and deduplicated.
When the render node translator visits articles, it emits variants for
each language that the article is supported in. This step is skipped if
an article-only catalog is being built, since it would otherwise lead to
a redundant "Swift" language marker being rendered in the page. However,
if a catalog contains more than one module, i.e. an article-only
collection and a different module's symbol graph in the same catalog,
then the variants are not emitted despite the possibility of the page
being available in more than one language. This commit changes the
boolean check to skip emitting variants only if all root modules are
article-only. It does not affect the behaviour when building a correctly
configured catalog that contains a sole root module.

rdar://163926698
@snprajwal snprajwal force-pushed the pnadig/source-langs branch from e49e5c2 to 7f1ab5f Compare November 6, 2025 11:27
@snprajwal
Copy link
Contributor Author

@swift-ci please test

@snprajwal snprajwal changed the title Emit variants if multiple root modules are present Emit variants if any root module is a symbol Nov 6, 2025
@snprajwal snprajwal changed the title Emit variants if any root module is a symbol Emit variants if any root module is a symbol kind Nov 6, 2025
@d-ronnqvist d-ronnqvist merged commit 45aa567 into swiftlang:main Nov 6, 2025
2 checks passed
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