Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/tornado/__pycache__/locale.cpython-39.pyc
Ðазад
a _�h6S � @ s d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZ ddl mZmZmZmZ dai aetg�adad Zed d�dd �Zedd�dd�Zdeedd�dd�Zeedd�dd�Zee d�dd�ZG dd � d e�ZG dd� de�Z G dd� de�Z!dS ) a� Translation methods for generating localized strings. To load a locale and generate a translated string:: user_locale = tornado.locale.get("es_LA") print(user_locale.translate("Sign out")) `tornado.locale.get()` returns the closest matching locale, not necessarily the specific locale you requested. You can support pluralization with additional arguments to `~Locale.translate()`, e.g.:: people = [...] message = user_locale.translate( "%(list)s is online", "%(list)s are online", len(people)) print(message % {"list": user_locale.list(people)}) The first string is chosen if ``len(people) == 1``, otherwise the second string is chosen. Applications should call one of `load_translations` (which uses a simple CSV format) or `load_gettext_translations` (which uses the ``.mo`` format supported by `gettext` and related tools). If neither method is called, the `Locale.translate` method will simply return the original string. � N)�escape)�gen_log)�LOCALE_NAMES)�Iterable�Any�Union�Dict�en_USF��Locale��locale_codes�returnc G s t j| � S )a� Returns the closest match for the given locale codes. We iterate over all given locale codes in order. If we have a tight or a loose match for the code (e.g., "en" for "en_US"), we return the locale. Otherwise we move to the next code in the list. By default we return ``en_US`` if no translations are found for any of the specified locales. You can change the default locale with `set_default_locale()`. )r �get_closest)r � r �~/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/tornado/locale.py�get? s r ��coder c C s | a ttt�� �t g �adS )a7 Sets the default locale. The default locale is assumed to be the language used for all strings in the system. The translations loaded from disk are mappings from the default locale to the destination locale. Consequently, you don't need to create a translation file for the default locale. N)�_default_locale� frozenset�list� _translations�keys�_supported_locales)r r r r �set_default_localeM s r )� directory�encodingr c C s� i a t�| �D �]�}|�d�s q|�d�\}}t�d|�sTt�d|tj � | |�� qtj � | |�}|du r�t|d�� }|�t tj��}W d � n1 s�0 Y |tjtjfv r�d}nd}t||d ���}i t |<