Skip to content

Conversation

@nattsw
Copy link
Contributor

@nattsw nattsw commented Apr 14, 2025

This PR adds a little indicator in each post that shares the original post language. It only shows up when experimental_inline_translation is enabled, and if the post's language is not matching the user's locale.

Reviewer note: We're currently using the LocaleSiteSetting values to determine the name of the language, so we will get values like "Español" instead of "Spanish". In the future we will consider localized language names (internal /151409)

Screenshot 2025-04-14 at 8 54 42 PM

Comment on lines +13 to +17
<DTooltip
@identifier="discourse-translator_translated-post-indicator"
@icon="language"
@content={{this.tooltip}}
/>
Copy link
Contributor Author

@nattsw nattsw Apr 14, 2025

Choose a reason for hiding this comment

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

I had considered just using {{icon "language" title="something"}} but it looks like the title will always be i18n-ified.

Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

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

Looks great!

@nattsw nattsw merged commit 43e2803 into main Apr 15, 2025
6 checks passed
@nattsw nattsw deleted the post-language-indicator branch April 15, 2025 02:20
nattsw added a commit to discourse/discourse that referenced this pull request May 15, 2025
Related:
- discourse/discourse-translator#205
- discourse/discourse-translator#274
- discourse/discourse-translator#294

With this PR, we will start showing localized posts (if available) based
on the user's locale.

This work had been done in discourse-translator, but is now moving to
core.
martin-brennan pushed a commit to discourse/discourse that referenced this pull request Jun 10, 2025
Related:
- discourse/discourse-translator#205
- discourse/discourse-translator#274
- discourse/discourse-translator#294

With this PR, we will start showing localized posts (if available) based
on the user's locale.

This work had been done in discourse-translator, but is now moving to
core.
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.

3 participants