style: dim translation explanations
This commit is contained in:
@@ -380,7 +380,15 @@ final class TranslationController: NSViewController {
|
||||
? myMemoryTranslate(text, source, target)
|
||||
: openAITranslate(text, source, target, key, context)
|
||||
guard !Task.isCancelled, let self else { return }
|
||||
self.output.string = translation
|
||||
let rendered = NSMutableAttributedString(string: translation, attributes: [
|
||||
.font: NSFont.systemFont(ofSize: 20),
|
||||
.foregroundColor: SunsetPalette.text,
|
||||
])
|
||||
if !myMemory, let separator = translation.range(of: "\n\n") {
|
||||
rendered.addAttribute(.foregroundColor, value: SunsetPalette.secondaryText,
|
||||
range: NSRange(separator.upperBound..<translation.endIndex, in: translation))
|
||||
}
|
||||
self.output.textStorage?.setAttributedString(rendered)
|
||||
self.setStatus("")
|
||||
self.translateButton.title = "Copy"
|
||||
self.translateButton.toolTip = "Copy the translation and close Conjure (Return)."
|
||||
|
||||
Reference in New Issue
Block a user