Skip to content

feat(docs): Support simplified string syntax for translations in docs.yml#15488

Merged
dsinghvi merged 6 commits into
mainfrom
cursor/simplify-translations-syntax-a103
Apr 28, 2026
Merged

feat(docs): Support simplified string syntax for translations in docs.yml#15488
dsinghvi merged 6 commits into
mainfrom
cursor/simplify-translations-syntax-a103

Conversation

@dsinghvi
Copy link
Copy Markdown
Member

Summary

Implements syntactic sugar for the translations field in docs.yml to allow cleaner configuration.

Changes

Before

translations:
  - lang: en
    default: true
  - lang: ja
  - lang: fr

After (new syntax)

translations:
  - en
  - ja
  - fr

Or mixed:

translations:
  - lang: en
    default: true
  - ja
  - fr

Implementation Details

  • Updated TranslationConfig schema to accept Language | TranslationConfigObject union
  • Added normalizeTranslationConfig helper function to convert strings to objects
  • Updated all code paths that access translation configs to use normalization
  • Maintained full backward compatibility - existing object syntax still works
  • Added comprehensive test coverage for both syntaxes

Testing

  • All existing tests pass
  • Added new test cases for string syntax and mixed syntax
  • Validated schema JSON generation works correctly

Related

Addresses feedback from Slack thread about making the translations syntax less verbose.

Slack Thread

Open in Web Open in Cursor 

@dsinghvi dsinghvi marked this pull request as ready for review April 28, 2026 14:45
@dsinghvi dsinghvi requested a review from amckinney as a code owner April 28, 2026 14:45
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@dsinghvi
Copy link
Copy Markdown
Member Author

@claude review

@github-actions
Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-04-23T04:59:11Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 56s (n=5) 86s (n=5) 51s -5s (-8.9%)
go-sdk square 115s (n=5) 132s (n=5) 126s +11s (+9.6%)
java-sdk square 179s (n=5) 207s (n=5) 218s +39s (+21.8%)
php-sdk square 43s (n=5) 66s (n=5) 41s -2s (-4.7%)
python-sdk square 115s (n=5) 223s (n=5) 119s +4s (+3.5%)
ruby-sdk-v2 square 130s (n=5) 159s (n=5) 129s -1s (-0.8%)
rust-sdk square 166s (n=5) 163s (n=5) 165s -1s (-0.6%)
swift-sdk square 41s (n=5) 290s (n=5) 39s -2s (-4.9%)
ts-sdk square 74s (n=5) 86s (n=5) 74s +0s (+0.0%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-04-23T04:59:11Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-04-28 15:04 UTC

@github-actions
Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-04-23T04:59:11Z).

Fixture main PR Delta
docs 301.0s (n=5) 294.2s (35 versions) -6.8s (-2.3%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-04-23T04:59:11Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-04-28 15:05 UTC

@dsinghvi dsinghvi merged commit 1b02c3d into main Apr 28, 2026
241 checks passed
@dsinghvi dsinghvi deleted the cursor/simplify-translations-syntax-a103 branch April 28, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants