fabricatio_locale.capabilities.localize

Implements localization functionality by leveraging the translation mechanism.

Classes

Localize

A class that extends Translate to provide localization capabilities.

Module Contents

class fabricatio_locale.capabilities.localize.Localize

Bases: fabricatio_translate.capabilities.translate.Translate

A class that extends Translate to provide localization capabilities.

This class handles the localization process by translating message texts while preserving message identifiers.

async localize(msgs: List[fabricatio_locale.rust.Msg], **kwargs: Unpack[fabricatio_translate.models.kwargs_types.TranslateKwargs]) List[fabricatio_locale.rust.Msg]

Localizes a list of messages by translating their text content.

Parameters:
  • msgs – A list of Message objects to be localized

  • **kwargs – Additional keyword arguments for translation

Returns:

A list of localized Message objects with translated texts, but retaining original message IDs