Skip to content

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

@winstonallo

Description

@winstonallo

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!

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