Feat(GenerativeUI): Added translation method by G4PLS · Pull Request #354 · StreamController/StreamController · GitHub
Skip to content

Feat(GenerativeUI): Added translation method#354

Merged
Core447 merged 1 commit into
StreamController:mainfrom
G4PLS:generative-ui-auto-translation
Mar 11, 2025
Merged

Feat(GenerativeUI): Added translation method#354
Core447 merged 1 commit into
StreamController:mainfrom
G4PLS:generative-ui-auto-translation

Conversation

@G4PLS

@G4PLS G4PLS commented Mar 11, 2025

Copy link
Copy Markdown
Member

This Implements a simple method that returns the translated text given a string.

To auto translate titles or subtitles a simple get_translation call can be made

In here we pass the title as the key and as the fallback, meaning it tries to auto translates the title and uses the title as a fallback if nothing was found.

self.widget: Adw.SwitchRow = Adw.SwitchRow(
    title=self.get_translation(title, title),
    subtitle=self.get_translation(subtitle, subtitle),
    active=default_value
)

@G4PLS G4PLS requested a review from Core447 March 11, 2025 17:07
@Core447

Core447 commented Mar 11, 2025

Copy link
Copy Markdown
Member

@G4PLS

G4PLS commented Mar 11, 2025

Copy link
Copy Markdown
Member Author

@Core447 Core447 merged commit 79efabe into StreamController:main Mar 11, 2025
@G4PLS G4PLS deleted the generative-ui-auto-translation branch March 11, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants