Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Literal[...] type to translate_* methods for better IDE completions #137

Copy link
Copy link
@winstonallo

Description

@winstonallo
Issue body actions

Hey! I noticed that the translation functions accepting source/target languages do so with a str type hint. Would be nice to have a Literal["EN", "FR", ...] in order to get IDE completions like these:

20250721-0930-22.9073226.mp4

This could be as simple as adding something like:

from typing import Literal

type LanguageLiteral = Literal["en-gb", "en-us", "fr"] # + all other supported languages

This could then be added as a type hint to translate_text and the like for better IDE support. I would be happy to submit a PR if this is something you guys would like to have!

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.