Module Expr Str Import alias Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd CompareIn Str AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareIn Str NameLoad CompareIn Str NameLoad body For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num Num Assign NameStore NameLoad If BoolOpAnd CompareIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str CompareIn NameLoad SubscriptLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Index AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Index AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Return NameLoad decorator_list decorator_list
N/A N/A Contains the parent class for MPF's Language module. N/A logging N/A re mpf.system.utility_functions Util Language N/A object N/A N/A MPF module which handles text, audio, and video replacement of objects
    for multi-language environments.

    Args:
        machine: The main machine object

     __init__ N/A N/A self machine N/A N/A N/A N/A self log N/A N/A logging getLogger Language N/A N/A self machine machine N/A N/A self config None N/A N/A N/A self machine language None N/A N/A self current_language None N/A N/A N/A languages N/A N/A self machine config N/A N/A N/A self machine config N/A languages N/A N/A N/A N/A self _configure N/A _configure N/A N/A self N/A N/A N/A N/A self config N/A N/A N/A self machine config N/A languages N/A N/A N/A self machine language self N/A N/A self languages N/A N/A Util string_to_lowercase_list N/A N/A N/A self machine config N/A languages N/A N/A N/A self set_language N/A N/A self languages N/A 0 N/A N/A self default_language N/A N/A self languages N/A 0 N/A N/A self find_text N/A N/A re compile (\(.*?\)) N/A set_language N/A N/A self language_string N/A N/A N/A Sets the current language based on the string passed.

        Args:
            language_string: The string name of the language you want to set the
                machine to.

        Language strings can be whatever you want, based on how you define them
        in your config file. It can be an actual language, like English or
        French, or it can simply be alternate assets, like "Kid-Friendly" versus
        "Mature."

        This language change is instant, and you can safely call it often.
        Change languages for each player in the same game, or even in the middle
        of a ball!

         N/A N/A N/A N/A self log debug Setting language to: %s language_string N/A N/A self current_language language_string N/A get_language N/A N/A self N/A N/A N/A Returns the string name of the current language. N/A N/A self current_language N/A text N/A N/A self text N/A N/A N/A Translates a text string (or part of a text string) based on the
        current language setting.

        Args:
            text: The string of text you want to translate.

        Returns: A translated string.

        The incoming text string is searched for text within parentheses, and
        each of those segments is looked up for replacement. You can wrap the
        entire string in parentheses, or just part of it, or multiple parts.

        A new, translated string is returned with the parentheses removed. If
        a translation is not found in the current language's translation
        strings, the original text is returned.

        The string lookup is case-sensitive since different languages have
        different rules around casing.

        It is not possible to display text with parentheses in it since this
        method will remove them. If this is something you need, contact us and
        we can add that feature.

         N/A N/A N/A N/A self log debug Getting language for text: %s text N/A N/A N/A self config N/A ( text N/A ) text N/A N/A match N/A N/A N/A self find_text findall text N/A N/A replacement_string match N/A text_string N/A replacement_string N/A 1 -1 N/A modified_string text_string N/A N/A N/A N/A self current_language N/A N/A N/A self machine config N/A language_strings N/A text_string N/A N/A N/A N/A self machine config N/A language_strings N/A N/A self current_language N/A N/A modified_string N/A N/A N/A N/A N/A self machine config N/A language_strings N/A N/A self current_language N/A text_string N/A text N/A N/A text replace replacement_string modified_string N/A text N/A get_text N/A N/A self text language N/A N/A N/A Returns a translated text string for a specific language string.

        Args:
            text: The text string you'd like to get the replacement for.
            language: The language you'd like to lookup for the replacement.

        If the specific text string and language combination doesn't exist in
        the translation file, the original string is returned.

        The string lookup is case-sensitive.

        This method is similar to text(), except this method doesn't strip out
        the parentheses. (i.e. it's just used to look up what's "inside" the
        parentheses.)

         N/A N/A text N/A self text_dict N/A N/A N/A N/A self text_dict N/A text N/A N/A text N/A N/A