mirror of
https://ghfast.top/https://github.com/discourse/discourse-translator.git
synced 2026-07-17 11:56:50 +08:00
This commit 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. 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)
19 lines
510 B
Text
19 lines
510 B
Text
import Component from "@glimmer/component";
|
|
import { i18n } from "discourse-i18n";
|
|
import DTooltip from "float-kit/components/d-tooltip";
|
|
|
|
export default class TranslatedPostIndicator extends Component {
|
|
get tooltip() {
|
|
return i18n("translator.originally_written_in", {
|
|
language: this.args.data.detectedLanguage,
|
|
});
|
|
}
|
|
|
|
<template>
|
|
<DTooltip
|
|
@identifier="discourse-translator_translated-post-indicator"
|
|
@icon="language"
|
|
@content={{this.tooltip}}
|
|
/>
|
|
</template>
|
|
}
|