Skip to content

🌐(frontend) add Crowdin translator context - #2785

Merged
AntoLC merged 1 commit into
mainfrom
chore/2438-crowdin-open-context
Oct 16, 2026
Merged

AntoLC merged 1 commit into
mainfrom
chore/2438-crowdin-open-context

Conversation

@AntoLC

@AntoLC AntoLC commented Oct 6, 2026

Copy link
Copy Markdown
Member

Purpose

Translators on Crowdin only see the source string, so short or ambiguous strings ("Open", "Share", "Last update:"...) get translated wrongly. Giving each string a short description tells them where it appears.

Proposal

  • add a short description to every t() call of apps/impress that had none (565 calls, 125 files)
  • same key, same description everywhere, reusing the descriptions that already existed
  • type the t parameter of two helpers as TFunction so it accepts the options

Fixes #2438

@AntoLC AntoLC self-assigned this Oct 6, 2026
@AntoLC AntoLC mentioned this pull request Oct 6, 2026
3 tasks done
@AntoLC
AntoLC requested a review from Ovgodd October 6, 2026 07:50
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: +5.09 kB (+0.12%)

Total Size: 4.08 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/20e78aa9/_buildManifest.js 741 B +741 B (new file) 🆕
apps/impress/out/_next/static/be642fc9/_buildManifest.js 0 B -741 B (removed) 🏆
apps/impress/out/_next/static/chunks/1404.js 26.9 kB +1.22 kB (+4.74%) 🔍
apps/impress/out/_next/static/chunks/1519.js 64.1 kB +3.18 kB (+5.22%) 🔍
apps/impress/out/_next/static/chunks/pages/_app.js 508 kB +689 B (+0.14%)

compressed-size-action

@Ovgodd Ovgodd 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.

just some suggestions

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.

Suggested change
? t(''Open document', {

Open is used both as the comments filter ("open threads") and as the duplicate toast button ("open the document"). A single string has only one translation, so French shows "Ouverts" on the button. Could the toast use Open document instead, so it can be translated "Ouvrir" on its own?

Comment on lines 60 to 63
@@ -62,6 +62,8 @@ export const useImport = ({ onDragOver, onImportSuccess }: UseImportProps) => {
? `The document "{{documentName}}" import has failed (only {{allowedExtensions}} files are allowed)`
: `The document "{{documentName}}" import has failed`,

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.

Suggested change
: `The document "{{documentName}}" import has failed`,
toast(
allowedExtensions
? t(
'The document "{{documentName}}" import has failed (only {{allowedExtensions}} files are allowed)',
{
description:
'Toast shown when a file to import has an unsupported type',
documentName: fileName,
allowedExtensions,
},
)
: t('The document "{{documentName}}" import has failed', {
description: 'Toast shown when importing a file as a document failed',
documentName: fileName,
}),
VariantType.ERROR,
);

spotted this

@AntoLC
AntoLC force-pushed the chore/2438-crowdin-open-context branch from bd16e24 to c72b0b1 Compare October 6, 2026 13:09
@AntoLC
AntoLC requested a review from Ovgodd October 6, 2026 13:09

@Ovgodd Ovgodd 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.

💯

@AntoLC
AntoLC force-pushed the chore/2438-crowdin-open-context branch from c72b0b1 to facd44a Compare October 16, 2026 12:51
We add context for the translator Crowdin,
to do so, we added a context description on
the t function.

Closes #2438
@AntoLC
AntoLC force-pushed the chore/2438-crowdin-open-context branch from facd44a to 7123186 Compare October 16, 2026 12:57
@AntoLC
AntoLC merged commit 7123186 into main Oct 16, 2026
60 of 61 checks passed
@AntoLC
AntoLC deleted the chore/2438-crowdin-open-context branch October 16, 2026 13:51
lunika added a commit that referenced this pull request Oct 21, 2026
Added

- ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552
- 🌐(frontend) add Crowdin translator context #2785
- ✨(frontend) open the emoji picker when adding a document emoji #2777

Changed

- 💄(frontend) limit heading choices to levels 1–3

- ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775
- 💄(frontend) update upload loader and error ui #2778
- ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853
- ♿️(frontend) allow opening the home button in a new tab #2839
- 💄(frontend) use 12px for error page home links #2809

Fixed

- 🐛(frontend) don't add a reader's duplicate to the doc tree #2860
- 🐛(frontend) fix confirmation modal for duplicating sub-docs #2860
- 🐛(frontend) wrap long unbroken document titles #2852
- 🐛(frontend) wrap long text in the print export #2813
- 🔒️(backend) bind comment thread to the path document on creation #2838
- 🐛(frontend) fix search highlight hidden inside code blocks #2681
- 🔒️(backend) require present document access for thread and comment
  writes #2840
- 🐛(backend) enforce resource server action restrictions on the external
  API #2745
- 🐛(backend) mark only the top duplicate as a copy, after its title #2855
- 🐛(yhub) measure migration durations with a monotonic clock #2814
- 🐛(backend) send the mention email when the cache is unreachable #2803
- 🐛(backend) give media-auth its own throttle scope
- 💄(frontend) remove the vertical line next to nested blocks #2825
lunika added a commit that referenced this pull request Oct 21, 2026
Added

- ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552
- 🌐(frontend) add Crowdin translator context #2785
- ✨(frontend) open the emoji picker when adding a document emoji #2777

Changed

- 💄(frontend) limit heading choices to levels 1–3

- ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775
- 💄(frontend) update upload loader and error ui #2778
- ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853
- ♿️(frontend) allow opening the home button in a new tab #2839
- 💄(frontend) use 12px for error page home links #2809

Fixed

- 🐛(frontend) don't add a reader's duplicate to the doc tree #2860
- 🐛(frontend) fix confirmation modal for duplicating sub-docs #2860
- 🐛(frontend) wrap long unbroken document titles #2852
- 🐛(frontend) wrap long text in the print export #2813
- 🔒️(backend) bind comment thread to the path document on creation #2838
- 🐛(frontend) fix search highlight hidden inside code blocks #2681
- 🔒️(backend) require present document access for thread and comment
  writes #2840
- 🐛(backend) enforce resource server action restrictions on the external
  API #2745
- 🐛(backend) mark only the top duplicate as a copy, after its title #2855
- 🐛(yhub) measure migration durations with a monotonic clock #2814
- 🐛(backend) send the mention email when the cache is unreachable #2803
- 🐛(backend) give media-auth its own throttle scope
- 💄(frontend) remove the vertical line next to nested blocks #2825
lunika added a commit that referenced this pull request Oct 21, 2026
Added

- ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552
- 🌐(frontend) add Crowdin translator context #2785
- ✨(frontend) open the emoji picker when adding a document emoji #2777

Changed

- 💄(frontend) limit heading choices to levels 1–3

- ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775
- 💄(frontend) update upload loader and error ui #2778
- ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853
- ♿️(frontend) allow opening the home button in a new tab #2839
- 💄(frontend) use 12px for error page home links #2809

Fixed

- 🐛(frontend) don't add a reader's duplicate to the doc tree #2860
- 🐛(frontend) fix confirmation modal for duplicating sub-docs #2860
- 🐛(frontend) wrap long unbroken document titles #2852
- 🐛(frontend) wrap long text in the print export #2813
- 🔒️(backend) bind comment thread to the path document on creation #2838
- 🐛(frontend) fix search highlight hidden inside code blocks #2681
- 🔒️(backend) require present document access for thread and comment
  writes #2840
- 🐛(backend) enforce resource server action restrictions on the external
  API #2745
- 🐛(backend) mark only the top duplicate as a copy, after its title #2855
- 🐛(yhub) measure migration durations with a monotonic clock #2814
- 🐛(backend) send the mention email when the cache is unreachable #2803
- 🐛(backend) give media-auth its own throttle scope
- 💄(frontend) remove the vertical line next to nested blocks #2825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding Context for Translations on Crowdin

2 participants