Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- SPFsmartGATE/LIVE/TMP/babel/.github/ISSUE_TEMPLATE.md +15 -0
- SPFsmartGATE/LIVE/TMP/babel/.pytest_cache/.gitignore +2 -0
- SPFsmartGATE/LIVE/TMP/babel/.pytest_cache/CACHEDIR.TAG +4 -0
- SPFsmartGATE/LIVE/TMP/babel/.pytest_cache/README.md +8 -0
- SPFsmartGATE/LIVE/TMP/babel/__pycache__/conftest.cpython-312-pytest-9.0.2.pyc +0 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/__init__.py +37 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/core.py +1300 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/dates.py +1936 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/languages.py +72 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/lists.py +123 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/localedata.py +278 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/numbers.py +1573 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/plural.py +640 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/py.typed +1 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/support.py +726 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/units.py +343 -0
- SPFsmartGATE/LIVE/TMP/babel/babel/util.py +269 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/LICENSE +41 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/README-common.md +10 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/af.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/am.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ar.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ar_SA.xml +18 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/as.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ast.xml +39 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/az.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/be.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bew.xml +73 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bg.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bgn.xml +35 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bn.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/br.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bs.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ca.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ccp.xml +478 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ceb.xml +20 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/chr.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ckb.xml +17 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/cs.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/cv.xml +67 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/cy.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/da.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/de.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/de_CH.xml +456 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/doi.xml +31 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/dsb.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/el.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/en.xml +0 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/en_001.xml +466 -0
- SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/en_AU.xml +344 -0
SPFsmartGATE/LIVE/TMP/babel/.github/ISSUE_TEMPLATE.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Overview Description
|
| 2 |
+
|
| 3 |
+
## Steps to Reproduce
|
| 4 |
+
|
| 5 |
+
1.
|
| 6 |
+
2.
|
| 7 |
+
3.
|
| 8 |
+
|
| 9 |
+
## Actual Results
|
| 10 |
+
|
| 11 |
+
## Expected Results
|
| 12 |
+
|
| 13 |
+
## Reproducibility
|
| 14 |
+
|
| 15 |
+
## Additional Information
|
SPFsmartGATE/LIVE/TMP/babel/.pytest_cache/.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Created by pytest automatically.
|
| 2 |
+
*
|
SPFsmartGATE/LIVE/TMP/babel/.pytest_cache/CACHEDIR.TAG
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Signature: 8a477f597d28d172789f06886806bc55
|
| 2 |
+
# This file is a cache directory tag created by pytest.
|
| 3 |
+
# For information about cache directory tags, see:
|
| 4 |
+
# https://bford.info/cachedir/spec.html
|
SPFsmartGATE/LIVE/TMP/babel/.pytest_cache/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# pytest cache directory #
|
| 2 |
+
|
| 3 |
+
This directory contains data from the pytest's cache plugin,
|
| 4 |
+
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
|
| 5 |
+
|
| 6 |
+
**Do not** commit this to version control.
|
| 7 |
+
|
| 8 |
+
See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.
|
SPFsmartGATE/LIVE/TMP/babel/__pycache__/conftest.cpython-312-pytest-9.0.2.pyc
ADDED
|
Binary file (1.24 kB). View file
|
|
|
SPFsmartGATE/LIVE/TMP/babel/babel/__init__.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel
|
| 3 |
+
~~~~~
|
| 4 |
+
|
| 5 |
+
Integrated collection of utilities that assist in internationalizing and
|
| 6 |
+
localizing applications.
|
| 7 |
+
|
| 8 |
+
This package is basically composed of two major parts:
|
| 9 |
+
|
| 10 |
+
* tools to build and work with ``gettext`` message catalogs
|
| 11 |
+
* a Python interface to the CLDR (Common Locale Data Repository), providing
|
| 12 |
+
access to various locale display names, localized number and date
|
| 13 |
+
formatting, etc.
|
| 14 |
+
|
| 15 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 16 |
+
:license: BSD, see LICENSE for more details.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
from babel.core import (
|
| 20 |
+
Locale,
|
| 21 |
+
UnknownLocaleError,
|
| 22 |
+
default_locale,
|
| 23 |
+
get_locale_identifier,
|
| 24 |
+
negotiate_locale,
|
| 25 |
+
parse_locale,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
__version__ = '2.16.0'
|
| 29 |
+
|
| 30 |
+
__all__ = [
|
| 31 |
+
'Locale',
|
| 32 |
+
'UnknownLocaleError',
|
| 33 |
+
'default_locale',
|
| 34 |
+
'get_locale_identifier',
|
| 35 |
+
'negotiate_locale',
|
| 36 |
+
'parse_locale',
|
| 37 |
+
]
|
SPFsmartGATE/LIVE/TMP/babel/babel/core.py
ADDED
|
@@ -0,0 +1,1300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.core
|
| 3 |
+
~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Core locale representation and locale data access.
|
| 6 |
+
|
| 7 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 8 |
+
:license: BSD, see LICENSE for more details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import os
|
| 14 |
+
import pickle
|
| 15 |
+
from collections.abc import Iterable, Mapping
|
| 16 |
+
from typing import TYPE_CHECKING, Any
|
| 17 |
+
|
| 18 |
+
from babel import localedata
|
| 19 |
+
from babel.plural import PluralRule
|
| 20 |
+
|
| 21 |
+
__all__ = ['UnknownLocaleError', 'Locale', 'default_locale', 'negotiate_locale',
|
| 22 |
+
'parse_locale']
|
| 23 |
+
|
| 24 |
+
if TYPE_CHECKING:
|
| 25 |
+
from typing_extensions import Literal, TypeAlias
|
| 26 |
+
|
| 27 |
+
_GLOBAL_KEY: TypeAlias = Literal[
|
| 28 |
+
"all_currencies",
|
| 29 |
+
"currency_fractions",
|
| 30 |
+
"language_aliases",
|
| 31 |
+
"likely_subtags",
|
| 32 |
+
"meta_zones",
|
| 33 |
+
"parent_exceptions",
|
| 34 |
+
"script_aliases",
|
| 35 |
+
"territory_aliases",
|
| 36 |
+
"territory_currencies",
|
| 37 |
+
"territory_languages",
|
| 38 |
+
"territory_zones",
|
| 39 |
+
"variant_aliases",
|
| 40 |
+
"windows_zone_mapping",
|
| 41 |
+
"zone_aliases",
|
| 42 |
+
"zone_territories",
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
_global_data: Mapping[_GLOBAL_KEY, Mapping[str, Any]] | None
|
| 46 |
+
|
| 47 |
+
_global_data = None
|
| 48 |
+
_default_plural_rule = PluralRule({})
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def _raise_no_data_error():
|
| 52 |
+
raise RuntimeError('The babel data files are not available. '
|
| 53 |
+
'This usually happens because you are using '
|
| 54 |
+
'a source checkout from Babel and you did '
|
| 55 |
+
'not build the data files. Just make sure '
|
| 56 |
+
'to run "python setup.py import_cldr" before '
|
| 57 |
+
'installing the library.')
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def get_global(key: _GLOBAL_KEY) -> Mapping[str, Any]:
|
| 61 |
+
"""Return the dictionary for the given key in the global data.
|
| 62 |
+
|
| 63 |
+
The global data is stored in the ``babel/global.dat`` file and contains
|
| 64 |
+
information independent of individual locales.
|
| 65 |
+
|
| 66 |
+
>>> get_global('zone_aliases')['UTC']
|
| 67 |
+
u'Etc/UTC'
|
| 68 |
+
>>> get_global('zone_territories')['Europe/Berlin']
|
| 69 |
+
u'DE'
|
| 70 |
+
|
| 71 |
+
The keys available are:
|
| 72 |
+
|
| 73 |
+
- ``all_currencies``
|
| 74 |
+
- ``currency_fractions``
|
| 75 |
+
- ``language_aliases``
|
| 76 |
+
- ``likely_subtags``
|
| 77 |
+
- ``parent_exceptions``
|
| 78 |
+
- ``script_aliases``
|
| 79 |
+
- ``territory_aliases``
|
| 80 |
+
- ``territory_currencies``
|
| 81 |
+
- ``territory_languages``
|
| 82 |
+
- ``territory_zones``
|
| 83 |
+
- ``variant_aliases``
|
| 84 |
+
- ``windows_zone_mapping``
|
| 85 |
+
- ``zone_aliases``
|
| 86 |
+
- ``zone_territories``
|
| 87 |
+
|
| 88 |
+
.. note:: The internal structure of the data may change between versions.
|
| 89 |
+
|
| 90 |
+
.. versionadded:: 0.9
|
| 91 |
+
|
| 92 |
+
:param key: the data key
|
| 93 |
+
"""
|
| 94 |
+
global _global_data
|
| 95 |
+
if _global_data is None:
|
| 96 |
+
dirname = os.path.join(os.path.dirname(__file__))
|
| 97 |
+
filename = os.path.join(dirname, 'global.dat')
|
| 98 |
+
if not os.path.isfile(filename):
|
| 99 |
+
_raise_no_data_error()
|
| 100 |
+
with open(filename, 'rb') as fileobj:
|
| 101 |
+
_global_data = pickle.load(fileobj)
|
| 102 |
+
assert _global_data is not None
|
| 103 |
+
return _global_data.get(key, {})
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
LOCALE_ALIASES = {
|
| 107 |
+
'ar': 'ar_SY', 'bg': 'bg_BG', 'bs': 'bs_BA', 'ca': 'ca_ES', 'cs': 'cs_CZ',
|
| 108 |
+
'da': 'da_DK', 'de': 'de_DE', 'el': 'el_GR', 'en': 'en_US', 'es': 'es_ES',
|
| 109 |
+
'et': 'et_EE', 'fa': 'fa_IR', 'fi': 'fi_FI', 'fr': 'fr_FR', 'gl': 'gl_ES',
|
| 110 |
+
'he': 'he_IL', 'hu': 'hu_HU', 'id': 'id_ID', 'is': 'is_IS', 'it': 'it_IT',
|
| 111 |
+
'ja': 'ja_JP', 'km': 'km_KH', 'ko': 'ko_KR', 'lt': 'lt_LT', 'lv': 'lv_LV',
|
| 112 |
+
'mk': 'mk_MK', 'nl': 'nl_NL', 'nn': 'nn_NO', 'no': 'nb_NO', 'pl': 'pl_PL',
|
| 113 |
+
'pt': 'pt_PT', 'ro': 'ro_RO', 'ru': 'ru_RU', 'sk': 'sk_SK', 'sl': 'sl_SI',
|
| 114 |
+
'sv': 'sv_SE', 'th': 'th_TH', 'tr': 'tr_TR', 'uk': 'uk_UA',
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
class UnknownLocaleError(Exception):
|
| 119 |
+
"""Exception thrown when a locale is requested for which no locale data
|
| 120 |
+
is available.
|
| 121 |
+
"""
|
| 122 |
+
|
| 123 |
+
def __init__(self, identifier: str) -> None:
|
| 124 |
+
"""Create the exception.
|
| 125 |
+
|
| 126 |
+
:param identifier: the identifier string of the unsupported locale
|
| 127 |
+
"""
|
| 128 |
+
Exception.__init__(self, f"unknown locale {identifier!r}")
|
| 129 |
+
|
| 130 |
+
#: The identifier of the locale that could not be found.
|
| 131 |
+
self.identifier = identifier
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
class Locale:
|
| 135 |
+
"""Representation of a specific locale.
|
| 136 |
+
|
| 137 |
+
>>> locale = Locale('en', 'US')
|
| 138 |
+
>>> repr(locale)
|
| 139 |
+
"Locale('en', territory='US')"
|
| 140 |
+
>>> locale.display_name
|
| 141 |
+
u'English (United States)'
|
| 142 |
+
|
| 143 |
+
A `Locale` object can also be instantiated from a raw locale string:
|
| 144 |
+
|
| 145 |
+
>>> locale = Locale.parse('en-US', sep='-')
|
| 146 |
+
>>> repr(locale)
|
| 147 |
+
"Locale('en', territory='US')"
|
| 148 |
+
|
| 149 |
+
`Locale` objects provide access to a collection of locale data, such as
|
| 150 |
+
territory and language names, number and date format patterns, and more:
|
| 151 |
+
|
| 152 |
+
>>> locale.number_symbols['latn']['decimal']
|
| 153 |
+
u'.'
|
| 154 |
+
|
| 155 |
+
If a locale is requested for which no locale data is available, an
|
| 156 |
+
`UnknownLocaleError` is raised:
|
| 157 |
+
|
| 158 |
+
>>> Locale.parse('en_XX')
|
| 159 |
+
Traceback (most recent call last):
|
| 160 |
+
...
|
| 161 |
+
UnknownLocaleError: unknown locale 'en_XX'
|
| 162 |
+
|
| 163 |
+
For more information see :rfc:`3066`.
|
| 164 |
+
"""
|
| 165 |
+
|
| 166 |
+
def __init__(
|
| 167 |
+
self,
|
| 168 |
+
language: str,
|
| 169 |
+
territory: str | None = None,
|
| 170 |
+
script: str | None = None,
|
| 171 |
+
variant: str | None = None,
|
| 172 |
+
modifier: str | None = None,
|
| 173 |
+
) -> None:
|
| 174 |
+
"""Initialize the locale object from the given identifier components.
|
| 175 |
+
|
| 176 |
+
>>> locale = Locale('en', 'US')
|
| 177 |
+
>>> locale.language
|
| 178 |
+
'en'
|
| 179 |
+
>>> locale.territory
|
| 180 |
+
'US'
|
| 181 |
+
|
| 182 |
+
:param language: the language code
|
| 183 |
+
:param territory: the territory (country or region) code
|
| 184 |
+
:param script: the script code
|
| 185 |
+
:param variant: the variant code
|
| 186 |
+
:param modifier: a modifier (following the '@' symbol, sometimes called '@variant')
|
| 187 |
+
:raise `UnknownLocaleError`: if no locale data is available for the
|
| 188 |
+
requested locale
|
| 189 |
+
"""
|
| 190 |
+
#: the language code
|
| 191 |
+
self.language = language
|
| 192 |
+
#: the territory (country or region) code
|
| 193 |
+
self.territory = territory
|
| 194 |
+
#: the script code
|
| 195 |
+
self.script = script
|
| 196 |
+
#: the variant code
|
| 197 |
+
self.variant = variant
|
| 198 |
+
#: the modifier
|
| 199 |
+
self.modifier = modifier
|
| 200 |
+
self.__data: localedata.LocaleDataDict | None = None
|
| 201 |
+
|
| 202 |
+
identifier = str(self)
|
| 203 |
+
identifier_without_modifier = identifier.partition('@')[0]
|
| 204 |
+
if localedata.exists(identifier):
|
| 205 |
+
self.__data_identifier = identifier
|
| 206 |
+
elif localedata.exists(identifier_without_modifier):
|
| 207 |
+
self.__data_identifier = identifier_without_modifier
|
| 208 |
+
else:
|
| 209 |
+
raise UnknownLocaleError(identifier)
|
| 210 |
+
|
| 211 |
+
@classmethod
|
| 212 |
+
def default(cls, category: str | None = None, aliases: Mapping[str, str] = LOCALE_ALIASES) -> Locale:
|
| 213 |
+
"""Return the system default locale for the specified category.
|
| 214 |
+
|
| 215 |
+
>>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LC_MESSAGES']:
|
| 216 |
+
... os.environ[name] = ''
|
| 217 |
+
>>> os.environ['LANG'] = 'fr_FR.UTF-8'
|
| 218 |
+
>>> Locale.default('LC_MESSAGES')
|
| 219 |
+
Locale('fr', territory='FR')
|
| 220 |
+
|
| 221 |
+
The following fallbacks to the variable are always considered:
|
| 222 |
+
|
| 223 |
+
- ``LANGUAGE``
|
| 224 |
+
- ``LC_ALL``
|
| 225 |
+
- ``LC_CTYPE``
|
| 226 |
+
- ``LANG``
|
| 227 |
+
|
| 228 |
+
:param category: one of the ``LC_XXX`` environment variable names
|
| 229 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 230 |
+
"""
|
| 231 |
+
# XXX: use likely subtag expansion here instead of the
|
| 232 |
+
# aliases dictionary.
|
| 233 |
+
locale_string = default_locale(category, aliases=aliases)
|
| 234 |
+
return cls.parse(locale_string)
|
| 235 |
+
|
| 236 |
+
@classmethod
|
| 237 |
+
def negotiate(
|
| 238 |
+
cls,
|
| 239 |
+
preferred: Iterable[str],
|
| 240 |
+
available: Iterable[str],
|
| 241 |
+
sep: str = '_',
|
| 242 |
+
aliases: Mapping[str, str] = LOCALE_ALIASES,
|
| 243 |
+
) -> Locale | None:
|
| 244 |
+
"""Find the best match between available and requested locale strings.
|
| 245 |
+
|
| 246 |
+
>>> Locale.negotiate(['de_DE', 'en_US'], ['de_DE', 'de_AT'])
|
| 247 |
+
Locale('de', territory='DE')
|
| 248 |
+
>>> Locale.negotiate(['de_DE', 'en_US'], ['en', 'de'])
|
| 249 |
+
Locale('de')
|
| 250 |
+
>>> Locale.negotiate(['de_DE', 'de'], ['en_US'])
|
| 251 |
+
|
| 252 |
+
You can specify the character used in the locale identifiers to separate
|
| 253 |
+
the different components. This separator is applied to both lists. Also,
|
| 254 |
+
case is ignored in the comparison:
|
| 255 |
+
|
| 256 |
+
>>> Locale.negotiate(['de-DE', 'de'], ['en-us', 'de-de'], sep='-')
|
| 257 |
+
Locale('de', territory='DE')
|
| 258 |
+
|
| 259 |
+
:param preferred: the list of locale identifiers preferred by the user
|
| 260 |
+
:param available: the list of locale identifiers available
|
| 261 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 262 |
+
"""
|
| 263 |
+
identifier = negotiate_locale(preferred, available, sep=sep,
|
| 264 |
+
aliases=aliases)
|
| 265 |
+
if identifier:
|
| 266 |
+
return Locale.parse(identifier, sep=sep)
|
| 267 |
+
return None
|
| 268 |
+
|
| 269 |
+
@classmethod
|
| 270 |
+
def parse(
|
| 271 |
+
cls,
|
| 272 |
+
identifier: str | Locale | None,
|
| 273 |
+
sep: str = '_',
|
| 274 |
+
resolve_likely_subtags: bool = True,
|
| 275 |
+
) -> Locale:
|
| 276 |
+
"""Create a `Locale` instance for the given locale identifier.
|
| 277 |
+
|
| 278 |
+
>>> l = Locale.parse('de-DE', sep='-')
|
| 279 |
+
>>> l.display_name
|
| 280 |
+
u'Deutsch (Deutschland)'
|
| 281 |
+
|
| 282 |
+
If the `identifier` parameter is not a string, but actually a `Locale`
|
| 283 |
+
object, that object is returned:
|
| 284 |
+
|
| 285 |
+
>>> Locale.parse(l)
|
| 286 |
+
Locale('de', territory='DE')
|
| 287 |
+
|
| 288 |
+
If the `identifier` parameter is neither of these, such as `None`
|
| 289 |
+
e.g. because a default locale identifier could not be determined,
|
| 290 |
+
a `TypeError` is raised:
|
| 291 |
+
|
| 292 |
+
>>> Locale.parse(None)
|
| 293 |
+
Traceback (most recent call last):
|
| 294 |
+
...
|
| 295 |
+
TypeError: ...
|
| 296 |
+
|
| 297 |
+
This also can perform resolving of likely subtags which it does
|
| 298 |
+
by default. This is for instance useful to figure out the most
|
| 299 |
+
likely locale for a territory you can use ``'und'`` as the
|
| 300 |
+
language tag:
|
| 301 |
+
|
| 302 |
+
>>> Locale.parse('und_AT')
|
| 303 |
+
Locale('de', territory='AT')
|
| 304 |
+
|
| 305 |
+
Modifiers are optional, and always at the end, separated by "@":
|
| 306 |
+
|
| 307 |
+
>>> Locale.parse('de_AT@euro')
|
| 308 |
+
Locale('de', territory='AT', modifier='euro')
|
| 309 |
+
|
| 310 |
+
:param identifier: the locale identifier string
|
| 311 |
+
:param sep: optional component separator
|
| 312 |
+
:param resolve_likely_subtags: if this is specified then a locale will
|
| 313 |
+
have its likely subtag resolved if the
|
| 314 |
+
locale otherwise does not exist. For
|
| 315 |
+
instance ``zh_TW`` by itself is not a
|
| 316 |
+
locale that exists but Babel can
|
| 317 |
+
automatically expand it to the full
|
| 318 |
+
form of ``zh_hant_TW``. Note that this
|
| 319 |
+
expansion is only taking place if no
|
| 320 |
+
locale exists otherwise. For instance
|
| 321 |
+
there is a locale ``en`` that can exist
|
| 322 |
+
by itself.
|
| 323 |
+
:raise `ValueError`: if the string does not appear to be a valid locale
|
| 324 |
+
identifier
|
| 325 |
+
:raise `UnknownLocaleError`: if no locale data is available for the
|
| 326 |
+
requested locale
|
| 327 |
+
:raise `TypeError`: if the identifier is not a string or a `Locale`
|
| 328 |
+
"""
|
| 329 |
+
if isinstance(identifier, Locale):
|
| 330 |
+
return identifier
|
| 331 |
+
elif not isinstance(identifier, str):
|
| 332 |
+
raise TypeError(f"Unexpected value for identifier: {identifier!r}")
|
| 333 |
+
|
| 334 |
+
parts = parse_locale(identifier, sep=sep)
|
| 335 |
+
input_id = get_locale_identifier(parts)
|
| 336 |
+
|
| 337 |
+
def _try_load(parts):
|
| 338 |
+
try:
|
| 339 |
+
return cls(*parts)
|
| 340 |
+
except UnknownLocaleError:
|
| 341 |
+
return None
|
| 342 |
+
|
| 343 |
+
def _try_load_reducing(parts):
|
| 344 |
+
# Success on first hit, return it.
|
| 345 |
+
locale = _try_load(parts)
|
| 346 |
+
if locale is not None:
|
| 347 |
+
return locale
|
| 348 |
+
|
| 349 |
+
# Now try without script and variant
|
| 350 |
+
locale = _try_load(parts[:2])
|
| 351 |
+
if locale is not None:
|
| 352 |
+
return locale
|
| 353 |
+
|
| 354 |
+
locale = _try_load(parts)
|
| 355 |
+
if locale is not None:
|
| 356 |
+
return locale
|
| 357 |
+
if not resolve_likely_subtags:
|
| 358 |
+
raise UnknownLocaleError(input_id)
|
| 359 |
+
|
| 360 |
+
# From here onwards is some very bad likely subtag resolving. This
|
| 361 |
+
# whole logic is not entirely correct but good enough (tm) for the
|
| 362 |
+
# time being. This has been added so that zh_TW does not cause
|
| 363 |
+
# errors for people when they upgrade. Later we should properly
|
| 364 |
+
# implement ICU like fuzzy locale objects and provide a way to
|
| 365 |
+
# maximize and minimize locale tags.
|
| 366 |
+
|
| 367 |
+
if len(parts) == 5:
|
| 368 |
+
language, territory, script, variant, modifier = parts
|
| 369 |
+
else:
|
| 370 |
+
language, territory, script, variant = parts
|
| 371 |
+
modifier = None
|
| 372 |
+
language = get_global('language_aliases').get(language, language)
|
| 373 |
+
territory = get_global('territory_aliases').get(territory or '', (territory,))[0]
|
| 374 |
+
script = get_global('script_aliases').get(script or '', script)
|
| 375 |
+
variant = get_global('variant_aliases').get(variant or '', variant)
|
| 376 |
+
|
| 377 |
+
if territory == 'ZZ':
|
| 378 |
+
territory = None
|
| 379 |
+
if script == 'Zzzz':
|
| 380 |
+
script = None
|
| 381 |
+
|
| 382 |
+
parts = language, territory, script, variant, modifier
|
| 383 |
+
|
| 384 |
+
# First match: try the whole identifier
|
| 385 |
+
new_id = get_locale_identifier(parts)
|
| 386 |
+
likely_subtag = get_global('likely_subtags').get(new_id)
|
| 387 |
+
if likely_subtag is not None:
|
| 388 |
+
locale = _try_load_reducing(parse_locale(likely_subtag))
|
| 389 |
+
if locale is not None:
|
| 390 |
+
return locale
|
| 391 |
+
|
| 392 |
+
# If we did not find anything so far, try again with a
|
| 393 |
+
# simplified identifier that is just the language
|
| 394 |
+
likely_subtag = get_global('likely_subtags').get(language)
|
| 395 |
+
if likely_subtag is not None:
|
| 396 |
+
parts2 = parse_locale(likely_subtag)
|
| 397 |
+
if len(parts2) == 5:
|
| 398 |
+
language2, _, script2, variant2, modifier2 = parts2
|
| 399 |
+
else:
|
| 400 |
+
language2, _, script2, variant2 = parts2
|
| 401 |
+
modifier2 = None
|
| 402 |
+
locale = _try_load_reducing((language2, territory, script2, variant2, modifier2))
|
| 403 |
+
if locale is not None:
|
| 404 |
+
return locale
|
| 405 |
+
|
| 406 |
+
raise UnknownLocaleError(input_id)
|
| 407 |
+
|
| 408 |
+
def __eq__(self, other: object) -> bool:
|
| 409 |
+
for key in ('language', 'territory', 'script', 'variant', 'modifier'):
|
| 410 |
+
if not hasattr(other, key):
|
| 411 |
+
return False
|
| 412 |
+
return (
|
| 413 |
+
self.language == getattr(other, 'language') and # noqa: B009
|
| 414 |
+
self.territory == getattr(other, 'territory') and # noqa: B009
|
| 415 |
+
self.script == getattr(other, 'script') and # noqa: B009
|
| 416 |
+
self.variant == getattr(other, 'variant') and # noqa: B009
|
| 417 |
+
self.modifier == getattr(other, 'modifier') # noqa: B009
|
| 418 |
+
)
|
| 419 |
+
|
| 420 |
+
def __ne__(self, other: object) -> bool:
|
| 421 |
+
return not self.__eq__(other)
|
| 422 |
+
|
| 423 |
+
def __hash__(self) -> int:
|
| 424 |
+
return hash((self.language, self.territory, self.script,
|
| 425 |
+
self.variant, self.modifier))
|
| 426 |
+
|
| 427 |
+
def __repr__(self) -> str:
|
| 428 |
+
parameters = ['']
|
| 429 |
+
for key in ('territory', 'script', 'variant', 'modifier'):
|
| 430 |
+
value = getattr(self, key)
|
| 431 |
+
if value is not None:
|
| 432 |
+
parameters.append(f"{key}={value!r}")
|
| 433 |
+
return f"Locale({self.language!r}{', '.join(parameters)})"
|
| 434 |
+
|
| 435 |
+
def __str__(self) -> str:
|
| 436 |
+
return get_locale_identifier((self.language, self.territory,
|
| 437 |
+
self.script, self.variant,
|
| 438 |
+
self.modifier))
|
| 439 |
+
|
| 440 |
+
@property
|
| 441 |
+
def _data(self) -> localedata.LocaleDataDict:
|
| 442 |
+
if self.__data is None:
|
| 443 |
+
self.__data = localedata.LocaleDataDict(localedata.load(self.__data_identifier))
|
| 444 |
+
return self.__data
|
| 445 |
+
|
| 446 |
+
def get_display_name(self, locale: Locale | str | None = None) -> str | None:
|
| 447 |
+
"""Return the display name of the locale using the given locale.
|
| 448 |
+
|
| 449 |
+
The display name will include the language, territory, script, and
|
| 450 |
+
variant, if those are specified.
|
| 451 |
+
|
| 452 |
+
>>> Locale('zh', 'CN', script='Hans').get_display_name('en')
|
| 453 |
+
u'Chinese (Simplified, China)'
|
| 454 |
+
|
| 455 |
+
Modifiers are currently passed through verbatim:
|
| 456 |
+
|
| 457 |
+
>>> Locale('it', 'IT', modifier='euro').get_display_name('en')
|
| 458 |
+
u'Italian (Italy, euro)'
|
| 459 |
+
|
| 460 |
+
:param locale: the locale to use
|
| 461 |
+
"""
|
| 462 |
+
if locale is None:
|
| 463 |
+
locale = self
|
| 464 |
+
locale = Locale.parse(locale)
|
| 465 |
+
retval = locale.languages.get(self.language)
|
| 466 |
+
if retval and (self.territory or self.script or self.variant):
|
| 467 |
+
details = []
|
| 468 |
+
if self.script:
|
| 469 |
+
details.append(locale.scripts.get(self.script))
|
| 470 |
+
if self.territory:
|
| 471 |
+
details.append(locale.territories.get(self.territory))
|
| 472 |
+
if self.variant:
|
| 473 |
+
details.append(locale.variants.get(self.variant))
|
| 474 |
+
if self.modifier:
|
| 475 |
+
details.append(self.modifier)
|
| 476 |
+
detail_string = ', '.join(atom for atom in details if atom)
|
| 477 |
+
if detail_string:
|
| 478 |
+
retval += f" ({detail_string})"
|
| 479 |
+
return retval
|
| 480 |
+
|
| 481 |
+
display_name = property(get_display_name, doc="""\
|
| 482 |
+
The localized display name of the locale.
|
| 483 |
+
|
| 484 |
+
>>> Locale('en').display_name
|
| 485 |
+
u'English'
|
| 486 |
+
>>> Locale('en', 'US').display_name
|
| 487 |
+
u'English (United States)'
|
| 488 |
+
>>> Locale('sv').display_name
|
| 489 |
+
u'svenska'
|
| 490 |
+
|
| 491 |
+
:type: `unicode`
|
| 492 |
+
""")
|
| 493 |
+
|
| 494 |
+
def get_language_name(self, locale: Locale | str | None = None) -> str | None:
|
| 495 |
+
"""Return the language of this locale in the given locale.
|
| 496 |
+
|
| 497 |
+
>>> Locale('zh', 'CN', script='Hans').get_language_name('de')
|
| 498 |
+
u'Chinesisch'
|
| 499 |
+
|
| 500 |
+
.. versionadded:: 1.0
|
| 501 |
+
|
| 502 |
+
:param locale: the locale to use
|
| 503 |
+
"""
|
| 504 |
+
if locale is None:
|
| 505 |
+
locale = self
|
| 506 |
+
locale = Locale.parse(locale)
|
| 507 |
+
return locale.languages.get(self.language)
|
| 508 |
+
|
| 509 |
+
language_name = property(get_language_name, doc="""\
|
| 510 |
+
The localized language name of the locale.
|
| 511 |
+
|
| 512 |
+
>>> Locale('en', 'US').language_name
|
| 513 |
+
u'English'
|
| 514 |
+
""")
|
| 515 |
+
|
| 516 |
+
def get_territory_name(self, locale: Locale | str | None = None) -> str | None:
|
| 517 |
+
"""Return the territory name in the given locale."""
|
| 518 |
+
if locale is None:
|
| 519 |
+
locale = self
|
| 520 |
+
locale = Locale.parse(locale)
|
| 521 |
+
return locale.territories.get(self.territory or '')
|
| 522 |
+
|
| 523 |
+
territory_name = property(get_territory_name, doc="""\
|
| 524 |
+
The localized territory name of the locale if available.
|
| 525 |
+
|
| 526 |
+
>>> Locale('de', 'DE').territory_name
|
| 527 |
+
u'Deutschland'
|
| 528 |
+
""")
|
| 529 |
+
|
| 530 |
+
def get_script_name(self, locale: Locale | str | None = None) -> str | None:
|
| 531 |
+
"""Return the script name in the given locale."""
|
| 532 |
+
if locale is None:
|
| 533 |
+
locale = self
|
| 534 |
+
locale = Locale.parse(locale)
|
| 535 |
+
return locale.scripts.get(self.script or '')
|
| 536 |
+
|
| 537 |
+
script_name = property(get_script_name, doc="""\
|
| 538 |
+
The localized script name of the locale if available.
|
| 539 |
+
|
| 540 |
+
>>> Locale('sr', 'ME', script='Latn').script_name
|
| 541 |
+
u'latinica'
|
| 542 |
+
""")
|
| 543 |
+
|
| 544 |
+
@property
|
| 545 |
+
def english_name(self) -> str | None:
|
| 546 |
+
"""The english display name of the locale.
|
| 547 |
+
|
| 548 |
+
>>> Locale('de').english_name
|
| 549 |
+
u'German'
|
| 550 |
+
>>> Locale('de', 'DE').english_name
|
| 551 |
+
u'German (Germany)'
|
| 552 |
+
|
| 553 |
+
:type: `unicode`"""
|
| 554 |
+
return self.get_display_name(Locale('en'))
|
| 555 |
+
|
| 556 |
+
# { General Locale Display Names
|
| 557 |
+
|
| 558 |
+
@property
|
| 559 |
+
def languages(self) -> localedata.LocaleDataDict:
|
| 560 |
+
"""Mapping of language codes to translated language names.
|
| 561 |
+
|
| 562 |
+
>>> Locale('de', 'DE').languages['ja']
|
| 563 |
+
u'Japanisch'
|
| 564 |
+
|
| 565 |
+
See `ISO 639 <http://www.loc.gov/standards/iso639-2/>`_ for
|
| 566 |
+
more information.
|
| 567 |
+
"""
|
| 568 |
+
return self._data['languages']
|
| 569 |
+
|
| 570 |
+
@property
|
| 571 |
+
def scripts(self) -> localedata.LocaleDataDict:
|
| 572 |
+
"""Mapping of script codes to translated script names.
|
| 573 |
+
|
| 574 |
+
>>> Locale('en', 'US').scripts['Hira']
|
| 575 |
+
u'Hiragana'
|
| 576 |
+
|
| 577 |
+
See `ISO 15924 <http://www.evertype.com/standards/iso15924/>`_
|
| 578 |
+
for more information.
|
| 579 |
+
"""
|
| 580 |
+
return self._data['scripts']
|
| 581 |
+
|
| 582 |
+
@property
|
| 583 |
+
def territories(self) -> localedata.LocaleDataDict:
|
| 584 |
+
"""Mapping of script codes to translated script names.
|
| 585 |
+
|
| 586 |
+
>>> Locale('es', 'CO').territories['DE']
|
| 587 |
+
u'Alemania'
|
| 588 |
+
|
| 589 |
+
See `ISO 3166 <http://www.iso.org/iso/en/prods-services/iso3166ma/>`_
|
| 590 |
+
for more information.
|
| 591 |
+
"""
|
| 592 |
+
return self._data['territories']
|
| 593 |
+
|
| 594 |
+
@property
|
| 595 |
+
def variants(self) -> localedata.LocaleDataDict:
|
| 596 |
+
"""Mapping of script codes to translated script names.
|
| 597 |
+
|
| 598 |
+
>>> Locale('de', 'DE').variants['1901']
|
| 599 |
+
u'Alte deutsche Rechtschreibung'
|
| 600 |
+
"""
|
| 601 |
+
return self._data['variants']
|
| 602 |
+
|
| 603 |
+
# { Number Formatting
|
| 604 |
+
|
| 605 |
+
@property
|
| 606 |
+
def currencies(self) -> localedata.LocaleDataDict:
|
| 607 |
+
"""Mapping of currency codes to translated currency names. This
|
| 608 |
+
only returns the generic form of the currency name, not the count
|
| 609 |
+
specific one. If an actual number is requested use the
|
| 610 |
+
:func:`babel.numbers.get_currency_name` function.
|
| 611 |
+
|
| 612 |
+
>>> Locale('en').currencies['COP']
|
| 613 |
+
u'Colombian Peso'
|
| 614 |
+
>>> Locale('de', 'DE').currencies['COP']
|
| 615 |
+
u'Kolumbianischer Peso'
|
| 616 |
+
"""
|
| 617 |
+
return self._data['currency_names']
|
| 618 |
+
|
| 619 |
+
@property
|
| 620 |
+
def currency_symbols(self) -> localedata.LocaleDataDict:
|
| 621 |
+
"""Mapping of currency codes to symbols.
|
| 622 |
+
|
| 623 |
+
>>> Locale('en', 'US').currency_symbols['USD']
|
| 624 |
+
u'$'
|
| 625 |
+
>>> Locale('es', 'CO').currency_symbols['USD']
|
| 626 |
+
u'US$'
|
| 627 |
+
"""
|
| 628 |
+
return self._data['currency_symbols']
|
| 629 |
+
|
| 630 |
+
@property
|
| 631 |
+
def number_symbols(self) -> localedata.LocaleDataDict:
|
| 632 |
+
"""Symbols used in number formatting by number system.
|
| 633 |
+
|
| 634 |
+
.. note:: The format of the value returned may change between
|
| 635 |
+
Babel versions.
|
| 636 |
+
|
| 637 |
+
>>> Locale('fr', 'FR').number_symbols["latn"]['decimal']
|
| 638 |
+
u','
|
| 639 |
+
>>> Locale('fa', 'IR').number_symbols["arabext"]['decimal']
|
| 640 |
+
u'٫'
|
| 641 |
+
>>> Locale('fa', 'IR').number_symbols["latn"]['decimal']
|
| 642 |
+
u'.'
|
| 643 |
+
"""
|
| 644 |
+
return self._data['number_symbols']
|
| 645 |
+
|
| 646 |
+
@property
|
| 647 |
+
def other_numbering_systems(self) -> localedata.LocaleDataDict:
|
| 648 |
+
"""
|
| 649 |
+
Mapping of other numbering systems available for the locale.
|
| 650 |
+
See: https://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems
|
| 651 |
+
|
| 652 |
+
>>> Locale('el', 'GR').other_numbering_systems['traditional']
|
| 653 |
+
u'grek'
|
| 654 |
+
|
| 655 |
+
.. note:: The format of the value returned may change between
|
| 656 |
+
Babel versions.
|
| 657 |
+
"""
|
| 658 |
+
return self._data['numbering_systems']
|
| 659 |
+
|
| 660 |
+
@property
|
| 661 |
+
def default_numbering_system(self) -> str:
|
| 662 |
+
"""The default numbering system used by the locale.
|
| 663 |
+
>>> Locale('el', 'GR').default_numbering_system
|
| 664 |
+
u'latn'
|
| 665 |
+
"""
|
| 666 |
+
return self._data['default_numbering_system']
|
| 667 |
+
|
| 668 |
+
@property
|
| 669 |
+
def decimal_formats(self) -> localedata.LocaleDataDict:
|
| 670 |
+
"""Locale patterns for decimal number formatting.
|
| 671 |
+
|
| 672 |
+
.. note:: The format of the value returned may change between
|
| 673 |
+
Babel versions.
|
| 674 |
+
|
| 675 |
+
>>> Locale('en', 'US').decimal_formats[None]
|
| 676 |
+
<NumberPattern u'#,##0.###'>
|
| 677 |
+
"""
|
| 678 |
+
return self._data['decimal_formats']
|
| 679 |
+
|
| 680 |
+
@property
|
| 681 |
+
def compact_decimal_formats(self) -> localedata.LocaleDataDict:
|
| 682 |
+
"""Locale patterns for compact decimal number formatting.
|
| 683 |
+
|
| 684 |
+
.. note:: The format of the value returned may change between
|
| 685 |
+
Babel versions.
|
| 686 |
+
|
| 687 |
+
>>> Locale('en', 'US').compact_decimal_formats["short"]["one"]["1000"]
|
| 688 |
+
<NumberPattern u'0K'>
|
| 689 |
+
"""
|
| 690 |
+
return self._data['compact_decimal_formats']
|
| 691 |
+
|
| 692 |
+
@property
|
| 693 |
+
def currency_formats(self) -> localedata.LocaleDataDict:
|
| 694 |
+
"""Locale patterns for currency number formatting.
|
| 695 |
+
|
| 696 |
+
.. note:: The format of the value returned may change between
|
| 697 |
+
Babel versions.
|
| 698 |
+
|
| 699 |
+
>>> Locale('en', 'US').currency_formats['standard']
|
| 700 |
+
<NumberPattern u'\\xa4#,##0.00'>
|
| 701 |
+
>>> Locale('en', 'US').currency_formats['accounting']
|
| 702 |
+
<NumberPattern u'\\xa4#,##0.00;(\\xa4#,##0.00)'>
|
| 703 |
+
"""
|
| 704 |
+
return self._data['currency_formats']
|
| 705 |
+
|
| 706 |
+
@property
|
| 707 |
+
def compact_currency_formats(self) -> localedata.LocaleDataDict:
|
| 708 |
+
"""Locale patterns for compact currency number formatting.
|
| 709 |
+
|
| 710 |
+
.. note:: The format of the value returned may change between
|
| 711 |
+
Babel versions.
|
| 712 |
+
|
| 713 |
+
>>> Locale('en', 'US').compact_currency_formats["short"]["one"]["1000"]
|
| 714 |
+
<NumberPattern u'¤0K'>
|
| 715 |
+
"""
|
| 716 |
+
return self._data['compact_currency_formats']
|
| 717 |
+
|
| 718 |
+
@property
|
| 719 |
+
def percent_formats(self) -> localedata.LocaleDataDict:
|
| 720 |
+
"""Locale patterns for percent number formatting.
|
| 721 |
+
|
| 722 |
+
.. note:: The format of the value returned may change between
|
| 723 |
+
Babel versions.
|
| 724 |
+
|
| 725 |
+
>>> Locale('en', 'US').percent_formats[None]
|
| 726 |
+
<NumberPattern u'#,##0%'>
|
| 727 |
+
"""
|
| 728 |
+
return self._data['percent_formats']
|
| 729 |
+
|
| 730 |
+
@property
|
| 731 |
+
def scientific_formats(self) -> localedata.LocaleDataDict:
|
| 732 |
+
"""Locale patterns for scientific number formatting.
|
| 733 |
+
|
| 734 |
+
.. note:: The format of the value returned may change between
|
| 735 |
+
Babel versions.
|
| 736 |
+
|
| 737 |
+
>>> Locale('en', 'US').scientific_formats[None]
|
| 738 |
+
<NumberPattern u'#E0'>
|
| 739 |
+
"""
|
| 740 |
+
return self._data['scientific_formats']
|
| 741 |
+
|
| 742 |
+
# { Calendar Information and Date Formatting
|
| 743 |
+
|
| 744 |
+
@property
|
| 745 |
+
def periods(self) -> localedata.LocaleDataDict:
|
| 746 |
+
"""Locale display names for day periods (AM/PM).
|
| 747 |
+
|
| 748 |
+
>>> Locale('en', 'US').periods['am']
|
| 749 |
+
u'AM'
|
| 750 |
+
"""
|
| 751 |
+
try:
|
| 752 |
+
return self._data['day_periods']['stand-alone']['wide']
|
| 753 |
+
except KeyError:
|
| 754 |
+
return localedata.LocaleDataDict({}) # pragma: no cover
|
| 755 |
+
|
| 756 |
+
@property
|
| 757 |
+
def day_periods(self) -> localedata.LocaleDataDict:
|
| 758 |
+
"""Locale display names for various day periods (not necessarily only AM/PM).
|
| 759 |
+
|
| 760 |
+
These are not meant to be used without the relevant `day_period_rules`.
|
| 761 |
+
"""
|
| 762 |
+
return self._data['day_periods']
|
| 763 |
+
|
| 764 |
+
@property
|
| 765 |
+
def day_period_rules(self) -> localedata.LocaleDataDict:
|
| 766 |
+
"""Day period rules for the locale. Used by `get_period_id`.
|
| 767 |
+
"""
|
| 768 |
+
return self._data.get('day_period_rules', localedata.LocaleDataDict({}))
|
| 769 |
+
|
| 770 |
+
@property
|
| 771 |
+
def days(self) -> localedata.LocaleDataDict:
|
| 772 |
+
"""Locale display names for weekdays.
|
| 773 |
+
|
| 774 |
+
>>> Locale('de', 'DE').days['format']['wide'][3]
|
| 775 |
+
u'Donnerstag'
|
| 776 |
+
"""
|
| 777 |
+
return self._data['days']
|
| 778 |
+
|
| 779 |
+
@property
|
| 780 |
+
def months(self) -> localedata.LocaleDataDict:
|
| 781 |
+
"""Locale display names for months.
|
| 782 |
+
|
| 783 |
+
>>> Locale('de', 'DE').months['format']['wide'][10]
|
| 784 |
+
u'Oktober'
|
| 785 |
+
"""
|
| 786 |
+
return self._data['months']
|
| 787 |
+
|
| 788 |
+
@property
|
| 789 |
+
def quarters(self) -> localedata.LocaleDataDict:
|
| 790 |
+
"""Locale display names for quarters.
|
| 791 |
+
|
| 792 |
+
>>> Locale('de', 'DE').quarters['format']['wide'][1]
|
| 793 |
+
u'1. Quartal'
|
| 794 |
+
"""
|
| 795 |
+
return self._data['quarters']
|
| 796 |
+
|
| 797 |
+
@property
|
| 798 |
+
def eras(self) -> localedata.LocaleDataDict:
|
| 799 |
+
"""Locale display names for eras.
|
| 800 |
+
|
| 801 |
+
.. note:: The format of the value returned may change between
|
| 802 |
+
Babel versions.
|
| 803 |
+
|
| 804 |
+
>>> Locale('en', 'US').eras['wide'][1]
|
| 805 |
+
u'Anno Domini'
|
| 806 |
+
>>> Locale('en', 'US').eras['abbreviated'][0]
|
| 807 |
+
u'BC'
|
| 808 |
+
"""
|
| 809 |
+
return self._data['eras']
|
| 810 |
+
|
| 811 |
+
@property
|
| 812 |
+
def time_zones(self) -> localedata.LocaleDataDict:
|
| 813 |
+
"""Locale display names for time zones.
|
| 814 |
+
|
| 815 |
+
.. note:: The format of the value returned may change between
|
| 816 |
+
Babel versions.
|
| 817 |
+
|
| 818 |
+
>>> Locale('en', 'US').time_zones['Europe/London']['long']['daylight']
|
| 819 |
+
u'British Summer Time'
|
| 820 |
+
>>> Locale('en', 'US').time_zones['America/St_Johns']['city']
|
| 821 |
+
u'St. John\u2019s'
|
| 822 |
+
"""
|
| 823 |
+
return self._data['time_zones']
|
| 824 |
+
|
| 825 |
+
@property
|
| 826 |
+
def meta_zones(self) -> localedata.LocaleDataDict:
|
| 827 |
+
"""Locale display names for meta time zones.
|
| 828 |
+
|
| 829 |
+
Meta time zones are basically groups of different Olson time zones that
|
| 830 |
+
have the same GMT offset and daylight savings time.
|
| 831 |
+
|
| 832 |
+
.. note:: The format of the value returned may change between
|
| 833 |
+
Babel versions.
|
| 834 |
+
|
| 835 |
+
>>> Locale('en', 'US').meta_zones['Europe_Central']['long']['daylight']
|
| 836 |
+
u'Central European Summer Time'
|
| 837 |
+
|
| 838 |
+
.. versionadded:: 0.9
|
| 839 |
+
"""
|
| 840 |
+
return self._data['meta_zones']
|
| 841 |
+
|
| 842 |
+
@property
|
| 843 |
+
def zone_formats(self) -> localedata.LocaleDataDict:
|
| 844 |
+
"""Patterns related to the formatting of time zones.
|
| 845 |
+
|
| 846 |
+
.. note:: The format of the value returned may change between
|
| 847 |
+
Babel versions.
|
| 848 |
+
|
| 849 |
+
>>> Locale('en', 'US').zone_formats['fallback']
|
| 850 |
+
u'%(1)s (%(0)s)'
|
| 851 |
+
>>> Locale('pt', 'BR').zone_formats['region']
|
| 852 |
+
u'Hor\\xe1rio %s'
|
| 853 |
+
|
| 854 |
+
.. versionadded:: 0.9
|
| 855 |
+
"""
|
| 856 |
+
return self._data['zone_formats']
|
| 857 |
+
|
| 858 |
+
@property
|
| 859 |
+
def first_week_day(self) -> int:
|
| 860 |
+
"""The first day of a week, with 0 being Monday.
|
| 861 |
+
|
| 862 |
+
>>> Locale('de', 'DE').first_week_day
|
| 863 |
+
0
|
| 864 |
+
>>> Locale('en', 'US').first_week_day
|
| 865 |
+
6
|
| 866 |
+
"""
|
| 867 |
+
return self._data['week_data']['first_day']
|
| 868 |
+
|
| 869 |
+
@property
|
| 870 |
+
def weekend_start(self) -> int:
|
| 871 |
+
"""The day the weekend starts, with 0 being Monday.
|
| 872 |
+
|
| 873 |
+
>>> Locale('de', 'DE').weekend_start
|
| 874 |
+
5
|
| 875 |
+
"""
|
| 876 |
+
return self._data['week_data']['weekend_start']
|
| 877 |
+
|
| 878 |
+
@property
|
| 879 |
+
def weekend_end(self) -> int:
|
| 880 |
+
"""The day the weekend ends, with 0 being Monday.
|
| 881 |
+
|
| 882 |
+
>>> Locale('de', 'DE').weekend_end
|
| 883 |
+
6
|
| 884 |
+
"""
|
| 885 |
+
return self._data['week_data']['weekend_end']
|
| 886 |
+
|
| 887 |
+
@property
|
| 888 |
+
def min_week_days(self) -> int:
|
| 889 |
+
"""The minimum number of days in a week so that the week is counted as
|
| 890 |
+
the first week of a year or month.
|
| 891 |
+
|
| 892 |
+
>>> Locale('de', 'DE').min_week_days
|
| 893 |
+
4
|
| 894 |
+
"""
|
| 895 |
+
return self._data['week_data']['min_days']
|
| 896 |
+
|
| 897 |
+
@property
|
| 898 |
+
def date_formats(self) -> localedata.LocaleDataDict:
|
| 899 |
+
"""Locale patterns for date formatting.
|
| 900 |
+
|
| 901 |
+
.. note:: The format of the value returned may change between
|
| 902 |
+
Babel versions.
|
| 903 |
+
|
| 904 |
+
>>> Locale('en', 'US').date_formats['short']
|
| 905 |
+
<DateTimePattern u'M/d/yy'>
|
| 906 |
+
>>> Locale('fr', 'FR').date_formats['long']
|
| 907 |
+
<DateTimePattern u'd MMMM y'>
|
| 908 |
+
"""
|
| 909 |
+
return self._data['date_formats']
|
| 910 |
+
|
| 911 |
+
@property
|
| 912 |
+
def time_formats(self) -> localedata.LocaleDataDict:
|
| 913 |
+
"""Locale patterns for time formatting.
|
| 914 |
+
|
| 915 |
+
.. note:: The format of the value returned may change between
|
| 916 |
+
Babel versions.
|
| 917 |
+
|
| 918 |
+
>>> Locale('en', 'US').time_formats['short']
|
| 919 |
+
<DateTimePattern u'h:mm\u202fa'>
|
| 920 |
+
>>> Locale('fr', 'FR').time_formats['long']
|
| 921 |
+
<DateTimePattern u'HH:mm:ss z'>
|
| 922 |
+
"""
|
| 923 |
+
return self._data['time_formats']
|
| 924 |
+
|
| 925 |
+
@property
|
| 926 |
+
def datetime_formats(self) -> localedata.LocaleDataDict:
|
| 927 |
+
"""Locale patterns for datetime formatting.
|
| 928 |
+
|
| 929 |
+
.. note:: The format of the value returned may change between
|
| 930 |
+
Babel versions.
|
| 931 |
+
|
| 932 |
+
>>> Locale('en').datetime_formats['full']
|
| 933 |
+
u'{1}, {0}'
|
| 934 |
+
>>> Locale('th').datetime_formats['medium']
|
| 935 |
+
u'{1} {0}'
|
| 936 |
+
"""
|
| 937 |
+
return self._data['datetime_formats']
|
| 938 |
+
|
| 939 |
+
@property
|
| 940 |
+
def datetime_skeletons(self) -> localedata.LocaleDataDict:
|
| 941 |
+
"""Locale patterns for formatting parts of a datetime.
|
| 942 |
+
|
| 943 |
+
>>> Locale('en').datetime_skeletons['MEd']
|
| 944 |
+
<DateTimePattern u'E, M/d'>
|
| 945 |
+
>>> Locale('fr').datetime_skeletons['MEd']
|
| 946 |
+
<DateTimePattern u'E dd/MM'>
|
| 947 |
+
>>> Locale('fr').datetime_skeletons['H']
|
| 948 |
+
<DateTimePattern u"HH 'h'">
|
| 949 |
+
"""
|
| 950 |
+
return self._data['datetime_skeletons']
|
| 951 |
+
|
| 952 |
+
@property
|
| 953 |
+
def interval_formats(self) -> localedata.LocaleDataDict:
|
| 954 |
+
"""Locale patterns for interval formatting.
|
| 955 |
+
|
| 956 |
+
.. note:: The format of the value returned may change between
|
| 957 |
+
Babel versions.
|
| 958 |
+
|
| 959 |
+
How to format date intervals in Finnish when the day is the
|
| 960 |
+
smallest changing component:
|
| 961 |
+
|
| 962 |
+
>>> Locale('fi_FI').interval_formats['MEd']['d']
|
| 963 |
+
[u'E d.\u2009\u2013\u2009', u'E d.M.']
|
| 964 |
+
|
| 965 |
+
.. seealso::
|
| 966 |
+
|
| 967 |
+
The primary API to use this data is :py:func:`babel.dates.format_interval`.
|
| 968 |
+
|
| 969 |
+
|
| 970 |
+
:rtype: dict[str, dict[str, list[str]]]
|
| 971 |
+
"""
|
| 972 |
+
return self._data['interval_formats']
|
| 973 |
+
|
| 974 |
+
@property
|
| 975 |
+
def plural_form(self) -> PluralRule:
|
| 976 |
+
"""Plural rules for the locale.
|
| 977 |
+
|
| 978 |
+
>>> Locale('en').plural_form(1)
|
| 979 |
+
'one'
|
| 980 |
+
>>> Locale('en').plural_form(0)
|
| 981 |
+
'other'
|
| 982 |
+
>>> Locale('fr').plural_form(0)
|
| 983 |
+
'one'
|
| 984 |
+
>>> Locale('ru').plural_form(100)
|
| 985 |
+
'many'
|
| 986 |
+
"""
|
| 987 |
+
return self._data.get('plural_form', _default_plural_rule)
|
| 988 |
+
|
| 989 |
+
@property
|
| 990 |
+
def list_patterns(self) -> localedata.LocaleDataDict:
|
| 991 |
+
"""Patterns for generating lists
|
| 992 |
+
|
| 993 |
+
.. note:: The format of the value returned may change between
|
| 994 |
+
Babel versions.
|
| 995 |
+
|
| 996 |
+
>>> Locale('en').list_patterns['standard']['start']
|
| 997 |
+
u'{0}, {1}'
|
| 998 |
+
>>> Locale('en').list_patterns['standard']['end']
|
| 999 |
+
u'{0}, and {1}'
|
| 1000 |
+
>>> Locale('en_GB').list_patterns['standard']['end']
|
| 1001 |
+
u'{0} and {1}'
|
| 1002 |
+
"""
|
| 1003 |
+
return self._data['list_patterns']
|
| 1004 |
+
|
| 1005 |
+
@property
|
| 1006 |
+
def ordinal_form(self) -> PluralRule:
|
| 1007 |
+
"""Plural rules for the locale.
|
| 1008 |
+
|
| 1009 |
+
>>> Locale('en').ordinal_form(1)
|
| 1010 |
+
'one'
|
| 1011 |
+
>>> Locale('en').ordinal_form(2)
|
| 1012 |
+
'two'
|
| 1013 |
+
>>> Locale('en').ordinal_form(3)
|
| 1014 |
+
'few'
|
| 1015 |
+
>>> Locale('fr').ordinal_form(2)
|
| 1016 |
+
'other'
|
| 1017 |
+
>>> Locale('ru').ordinal_form(100)
|
| 1018 |
+
'other'
|
| 1019 |
+
"""
|
| 1020 |
+
return self._data.get('ordinal_form', _default_plural_rule)
|
| 1021 |
+
|
| 1022 |
+
@property
|
| 1023 |
+
def measurement_systems(self) -> localedata.LocaleDataDict:
|
| 1024 |
+
"""Localized names for various measurement systems.
|
| 1025 |
+
|
| 1026 |
+
>>> Locale('fr', 'FR').measurement_systems['US']
|
| 1027 |
+
u'am\\xe9ricain'
|
| 1028 |
+
>>> Locale('en', 'US').measurement_systems['US']
|
| 1029 |
+
u'US'
|
| 1030 |
+
|
| 1031 |
+
"""
|
| 1032 |
+
return self._data['measurement_systems']
|
| 1033 |
+
|
| 1034 |
+
@property
|
| 1035 |
+
def character_order(self) -> str:
|
| 1036 |
+
"""The text direction for the language.
|
| 1037 |
+
|
| 1038 |
+
>>> Locale('de', 'DE').character_order
|
| 1039 |
+
'left-to-right'
|
| 1040 |
+
>>> Locale('ar', 'SA').character_order
|
| 1041 |
+
'right-to-left'
|
| 1042 |
+
"""
|
| 1043 |
+
return self._data['character_order']
|
| 1044 |
+
|
| 1045 |
+
@property
|
| 1046 |
+
def text_direction(self) -> str:
|
| 1047 |
+
"""The text direction for the language in CSS short-hand form.
|
| 1048 |
+
|
| 1049 |
+
>>> Locale('de', 'DE').text_direction
|
| 1050 |
+
'ltr'
|
| 1051 |
+
>>> Locale('ar', 'SA').text_direction
|
| 1052 |
+
'rtl'
|
| 1053 |
+
"""
|
| 1054 |
+
return ''.join(word[0] for word in self.character_order.split('-'))
|
| 1055 |
+
|
| 1056 |
+
@property
|
| 1057 |
+
def unit_display_names(self) -> localedata.LocaleDataDict:
|
| 1058 |
+
"""Display names for units of measurement.
|
| 1059 |
+
|
| 1060 |
+
.. seealso::
|
| 1061 |
+
|
| 1062 |
+
You may want to use :py:func:`babel.units.get_unit_name` instead.
|
| 1063 |
+
|
| 1064 |
+
.. note:: The format of the value returned may change between
|
| 1065 |
+
Babel versions.
|
| 1066 |
+
|
| 1067 |
+
"""
|
| 1068 |
+
return self._data['unit_display_names']
|
| 1069 |
+
|
| 1070 |
+
|
| 1071 |
+
def default_locale(category: str | None = None, aliases: Mapping[str, str] = LOCALE_ALIASES) -> str | None:
|
| 1072 |
+
"""Returns the system default locale for a given category, based on
|
| 1073 |
+
environment variables.
|
| 1074 |
+
|
| 1075 |
+
>>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE']:
|
| 1076 |
+
... os.environ[name] = ''
|
| 1077 |
+
>>> os.environ['LANG'] = 'fr_FR.UTF-8'
|
| 1078 |
+
>>> default_locale('LC_MESSAGES')
|
| 1079 |
+
'fr_FR'
|
| 1080 |
+
|
| 1081 |
+
The "C" or "POSIX" pseudo-locales are treated as aliases for the
|
| 1082 |
+
"en_US_POSIX" locale:
|
| 1083 |
+
|
| 1084 |
+
>>> os.environ['LC_MESSAGES'] = 'POSIX'
|
| 1085 |
+
>>> default_locale('LC_MESSAGES')
|
| 1086 |
+
'en_US_POSIX'
|
| 1087 |
+
|
| 1088 |
+
The following fallbacks to the variable are always considered:
|
| 1089 |
+
|
| 1090 |
+
- ``LANGUAGE``
|
| 1091 |
+
- ``LC_ALL``
|
| 1092 |
+
- ``LC_CTYPE``
|
| 1093 |
+
- ``LANG``
|
| 1094 |
+
|
| 1095 |
+
:param category: one of the ``LC_XXX`` environment variable names
|
| 1096 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 1097 |
+
"""
|
| 1098 |
+
varnames = (category, 'LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')
|
| 1099 |
+
for name in filter(None, varnames):
|
| 1100 |
+
locale = os.getenv(name)
|
| 1101 |
+
if locale:
|
| 1102 |
+
if name == 'LANGUAGE' and ':' in locale:
|
| 1103 |
+
# the LANGUAGE variable may contain a colon-separated list of
|
| 1104 |
+
# language codes; we just pick the language on the list
|
| 1105 |
+
locale = locale.split(':')[0]
|
| 1106 |
+
if locale.split('.')[0] in ('C', 'POSIX'):
|
| 1107 |
+
locale = 'en_US_POSIX'
|
| 1108 |
+
elif aliases and locale in aliases:
|
| 1109 |
+
locale = aliases[locale]
|
| 1110 |
+
try:
|
| 1111 |
+
return get_locale_identifier(parse_locale(locale))
|
| 1112 |
+
except ValueError:
|
| 1113 |
+
pass
|
| 1114 |
+
return None
|
| 1115 |
+
|
| 1116 |
+
|
| 1117 |
+
def negotiate_locale(preferred: Iterable[str], available: Iterable[str], sep: str = '_', aliases: Mapping[str, str] = LOCALE_ALIASES) -> str | None:
|
| 1118 |
+
"""Find the best match between available and requested locale strings.
|
| 1119 |
+
|
| 1120 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['de_DE', 'de_AT'])
|
| 1121 |
+
'de_DE'
|
| 1122 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['en', 'de'])
|
| 1123 |
+
'de'
|
| 1124 |
+
|
| 1125 |
+
Case is ignored by the algorithm, the result uses the case of the preferred
|
| 1126 |
+
locale identifier:
|
| 1127 |
+
|
| 1128 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['de_de', 'de_at'])
|
| 1129 |
+
'de_DE'
|
| 1130 |
+
|
| 1131 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['de_de', 'de_at'])
|
| 1132 |
+
'de_DE'
|
| 1133 |
+
|
| 1134 |
+
By default, some web browsers unfortunately do not include the territory
|
| 1135 |
+
in the locale identifier for many locales, and some don't even allow the
|
| 1136 |
+
user to easily add the territory. So while you may prefer using qualified
|
| 1137 |
+
locale identifiers in your web-application, they would not normally match
|
| 1138 |
+
the language-only locale sent by such browsers. To workaround that, this
|
| 1139 |
+
function uses a default mapping of commonly used language-only locale
|
| 1140 |
+
identifiers to identifiers including the territory:
|
| 1141 |
+
|
| 1142 |
+
>>> negotiate_locale(['ja', 'en_US'], ['ja_JP', 'en_US'])
|
| 1143 |
+
'ja_JP'
|
| 1144 |
+
|
| 1145 |
+
Some browsers even use an incorrect or outdated language code, such as "no"
|
| 1146 |
+
for Norwegian, where the correct locale identifier would actually be "nb_NO"
|
| 1147 |
+
(Bokmål) or "nn_NO" (Nynorsk). The aliases are intended to take care of
|
| 1148 |
+
such cases, too:
|
| 1149 |
+
|
| 1150 |
+
>>> negotiate_locale(['no', 'sv'], ['nb_NO', 'sv_SE'])
|
| 1151 |
+
'nb_NO'
|
| 1152 |
+
|
| 1153 |
+
You can override this default mapping by passing a different `aliases`
|
| 1154 |
+
dictionary to this function, or you can bypass the behavior althogher by
|
| 1155 |
+
setting the `aliases` parameter to `None`.
|
| 1156 |
+
|
| 1157 |
+
:param preferred: the list of locale strings preferred by the user
|
| 1158 |
+
:param available: the list of locale strings available
|
| 1159 |
+
:param sep: character that separates the different parts of the locale
|
| 1160 |
+
strings
|
| 1161 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 1162 |
+
"""
|
| 1163 |
+
available = [a.lower() for a in available if a]
|
| 1164 |
+
for locale in preferred:
|
| 1165 |
+
ll = locale.lower()
|
| 1166 |
+
if ll in available:
|
| 1167 |
+
return locale
|
| 1168 |
+
if aliases:
|
| 1169 |
+
alias = aliases.get(ll)
|
| 1170 |
+
if alias:
|
| 1171 |
+
alias = alias.replace('_', sep)
|
| 1172 |
+
if alias.lower() in available:
|
| 1173 |
+
return alias
|
| 1174 |
+
parts = locale.split(sep)
|
| 1175 |
+
if len(parts) > 1 and parts[0].lower() in available:
|
| 1176 |
+
return parts[0]
|
| 1177 |
+
return None
|
| 1178 |
+
|
| 1179 |
+
|
| 1180 |
+
def parse_locale(
|
| 1181 |
+
identifier: str,
|
| 1182 |
+
sep: str = '_',
|
| 1183 |
+
) -> tuple[str, str | None, str | None, str | None] | tuple[str, str | None, str | None, str | None, str | None]:
|
| 1184 |
+
"""Parse a locale identifier into a tuple of the form ``(language,
|
| 1185 |
+
territory, script, variant, modifier)``.
|
| 1186 |
+
|
| 1187 |
+
>>> parse_locale('zh_CN')
|
| 1188 |
+
('zh', 'CN', None, None)
|
| 1189 |
+
>>> parse_locale('zh_Hans_CN')
|
| 1190 |
+
('zh', 'CN', 'Hans', None)
|
| 1191 |
+
>>> parse_locale('ca_es_valencia')
|
| 1192 |
+
('ca', 'ES', None, 'VALENCIA')
|
| 1193 |
+
>>> parse_locale('en_150')
|
| 1194 |
+
('en', '150', None, None)
|
| 1195 |
+
>>> parse_locale('en_us_posix')
|
| 1196 |
+
('en', 'US', None, 'POSIX')
|
| 1197 |
+
>>> parse_locale('it_IT@euro')
|
| 1198 |
+
('it', 'IT', None, None, 'euro')
|
| 1199 |
+
>>> parse_locale('it_IT@custom')
|
| 1200 |
+
('it', 'IT', None, None, 'custom')
|
| 1201 |
+
>>> parse_locale('it_IT@')
|
| 1202 |
+
('it', 'IT', None, None)
|
| 1203 |
+
|
| 1204 |
+
The default component separator is "_", but a different separator can be
|
| 1205 |
+
specified using the `sep` parameter.
|
| 1206 |
+
|
| 1207 |
+
The optional modifier is always separated with "@" and at the end:
|
| 1208 |
+
|
| 1209 |
+
>>> parse_locale('zh-CN', sep='-')
|
| 1210 |
+
('zh', 'CN', None, None)
|
| 1211 |
+
>>> parse_locale('zh-CN@custom', sep='-')
|
| 1212 |
+
('zh', 'CN', None, None, 'custom')
|
| 1213 |
+
|
| 1214 |
+
If the identifier cannot be parsed into a locale, a `ValueError` exception
|
| 1215 |
+
is raised:
|
| 1216 |
+
|
| 1217 |
+
>>> parse_locale('not_a_LOCALE_String')
|
| 1218 |
+
Traceback (most recent call last):
|
| 1219 |
+
...
|
| 1220 |
+
ValueError: 'not_a_LOCALE_String' is not a valid locale identifier
|
| 1221 |
+
|
| 1222 |
+
Encoding information is removed from the identifier, while modifiers are
|
| 1223 |
+
kept:
|
| 1224 |
+
|
| 1225 |
+
>>> parse_locale('en_US.UTF-8')
|
| 1226 |
+
('en', 'US', None, None)
|
| 1227 |
+
>>> parse_locale('de_DE.iso885915@euro')
|
| 1228 |
+
('de', 'DE', None, None, 'euro')
|
| 1229 |
+
|
| 1230 |
+
See :rfc:`4646` for more information.
|
| 1231 |
+
|
| 1232 |
+
:param identifier: the locale identifier string
|
| 1233 |
+
:param sep: character that separates the different components of the locale
|
| 1234 |
+
identifier
|
| 1235 |
+
:raise `ValueError`: if the string does not appear to be a valid locale
|
| 1236 |
+
identifier
|
| 1237 |
+
"""
|
| 1238 |
+
identifier, _, modifier = identifier.partition('@')
|
| 1239 |
+
if '.' in identifier:
|
| 1240 |
+
# this is probably the charset/encoding, which we don't care about
|
| 1241 |
+
identifier = identifier.split('.', 1)[0]
|
| 1242 |
+
|
| 1243 |
+
parts = identifier.split(sep)
|
| 1244 |
+
lang = parts.pop(0).lower()
|
| 1245 |
+
if not lang.isalpha():
|
| 1246 |
+
raise ValueError(f"expected only letters, got {lang!r}")
|
| 1247 |
+
|
| 1248 |
+
script = territory = variant = None
|
| 1249 |
+
if parts and len(parts[0]) == 4 and parts[0].isalpha():
|
| 1250 |
+
script = parts.pop(0).title()
|
| 1251 |
+
|
| 1252 |
+
if parts:
|
| 1253 |
+
if len(parts[0]) == 2 and parts[0].isalpha():
|
| 1254 |
+
territory = parts.pop(0).upper()
|
| 1255 |
+
elif len(parts[0]) == 3 and parts[0].isdigit():
|
| 1256 |
+
territory = parts.pop(0)
|
| 1257 |
+
|
| 1258 |
+
if parts and (
|
| 1259 |
+
len(parts[0]) == 4 and parts[0][0].isdigit() or
|
| 1260 |
+
len(parts[0]) >= 5 and parts[0][0].isalpha()
|
| 1261 |
+
):
|
| 1262 |
+
variant = parts.pop().upper()
|
| 1263 |
+
|
| 1264 |
+
if parts:
|
| 1265 |
+
raise ValueError(f"{identifier!r} is not a valid locale identifier")
|
| 1266 |
+
|
| 1267 |
+
# TODO(3.0): always return a 5-tuple
|
| 1268 |
+
if modifier:
|
| 1269 |
+
return lang, territory, script, variant, modifier
|
| 1270 |
+
else:
|
| 1271 |
+
return lang, territory, script, variant
|
| 1272 |
+
|
| 1273 |
+
|
| 1274 |
+
def get_locale_identifier(
|
| 1275 |
+
tup: tuple[str]
|
| 1276 |
+
| tuple[str, str | None]
|
| 1277 |
+
| tuple[str, str | None, str | None]
|
| 1278 |
+
| tuple[str, str | None, str | None, str | None]
|
| 1279 |
+
| tuple[str, str | None, str | None, str | None, str | None],
|
| 1280 |
+
sep: str = "_",
|
| 1281 |
+
) -> str:
|
| 1282 |
+
"""The reverse of :func:`parse_locale`. It creates a locale identifier out
|
| 1283 |
+
of a ``(language, territory, script, variant, modifier)`` tuple. Items can be set to
|
| 1284 |
+
``None`` and trailing ``None``\\s can also be left out of the tuple.
|
| 1285 |
+
|
| 1286 |
+
>>> get_locale_identifier(('de', 'DE', None, '1999', 'custom'))
|
| 1287 |
+
'de_DE_1999@custom'
|
| 1288 |
+
>>> get_locale_identifier(('fi', None, None, None, 'custom'))
|
| 1289 |
+
'fi@custom'
|
| 1290 |
+
|
| 1291 |
+
|
| 1292 |
+
.. versionadded:: 1.0
|
| 1293 |
+
|
| 1294 |
+
:param tup: the tuple as returned by :func:`parse_locale`.
|
| 1295 |
+
:param sep: the separator for the identifier.
|
| 1296 |
+
"""
|
| 1297 |
+
tup = tuple(tup[:5]) # type: ignore # length should be no more than 5
|
| 1298 |
+
lang, territory, script, variant, modifier = tup + (None,) * (5 - len(tup))
|
| 1299 |
+
ret = sep.join(filter(None, (lang, script, territory, variant)))
|
| 1300 |
+
return f'{ret}@{modifier}' if modifier else ret
|
SPFsmartGATE/LIVE/TMP/babel/babel/dates.py
ADDED
|
@@ -0,0 +1,1936 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.dates
|
| 3 |
+
~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Locale dependent formatting and parsing of dates and times.
|
| 6 |
+
|
| 7 |
+
The default locale for the functions in this module is determined by the
|
| 8 |
+
following environment variables, in that order:
|
| 9 |
+
|
| 10 |
+
* ``LC_TIME``,
|
| 11 |
+
* ``LC_ALL``, and
|
| 12 |
+
* ``LANG``
|
| 13 |
+
|
| 14 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 15 |
+
:license: BSD, see LICENSE for more details.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
from __future__ import annotations
|
| 19 |
+
|
| 20 |
+
import math
|
| 21 |
+
import re
|
| 22 |
+
import warnings
|
| 23 |
+
from functools import lru_cache
|
| 24 |
+
from typing import TYPE_CHECKING, SupportsInt
|
| 25 |
+
|
| 26 |
+
try:
|
| 27 |
+
import pytz
|
| 28 |
+
except ModuleNotFoundError:
|
| 29 |
+
pytz = None
|
| 30 |
+
import zoneinfo
|
| 31 |
+
|
| 32 |
+
import datetime
|
| 33 |
+
from collections.abc import Iterable
|
| 34 |
+
|
| 35 |
+
from babel import localtime
|
| 36 |
+
from babel.core import Locale, default_locale, get_global
|
| 37 |
+
from babel.localedata import LocaleDataDict
|
| 38 |
+
|
| 39 |
+
if TYPE_CHECKING:
|
| 40 |
+
from typing_extensions import Literal, TypeAlias
|
| 41 |
+
_Instant: TypeAlias = datetime.date | datetime.time | float | None
|
| 42 |
+
_PredefinedTimeFormat: TypeAlias = Literal['full', 'long', 'medium', 'short']
|
| 43 |
+
_Context: TypeAlias = Literal['format', 'stand-alone']
|
| 44 |
+
_DtOrTzinfo: TypeAlias = datetime.datetime | datetime.tzinfo | str | int | datetime.time | None
|
| 45 |
+
|
| 46 |
+
# "If a given short metazone form is known NOT to be understood in a given
|
| 47 |
+
# locale and the parent locale has this value such that it would normally
|
| 48 |
+
# be inherited, the inheritance of this value can be explicitly disabled by
|
| 49 |
+
# use of the 'no inheritance marker' as the value, which is 3 simultaneous [sic]
|
| 50 |
+
# empty set characters ( U+2205 )."
|
| 51 |
+
# - https://www.unicode.org/reports/tr35/tr35-dates.html#Metazone_Names
|
| 52 |
+
|
| 53 |
+
NO_INHERITANCE_MARKER = '\u2205\u2205\u2205'
|
| 54 |
+
|
| 55 |
+
UTC = datetime.timezone.utc
|
| 56 |
+
LOCALTZ = localtime.LOCALTZ
|
| 57 |
+
|
| 58 |
+
LC_TIME = default_locale('LC_TIME')
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def _localize(tz: datetime.tzinfo, dt: datetime.datetime) -> datetime.datetime:
|
| 62 |
+
# Support localizing with both pytz and zoneinfo tzinfos
|
| 63 |
+
# nothing to do
|
| 64 |
+
if dt.tzinfo is tz:
|
| 65 |
+
return dt
|
| 66 |
+
|
| 67 |
+
if hasattr(tz, 'localize'): # pytz
|
| 68 |
+
return tz.localize(dt)
|
| 69 |
+
|
| 70 |
+
if dt.tzinfo is None:
|
| 71 |
+
# convert naive to localized
|
| 72 |
+
return dt.replace(tzinfo=tz)
|
| 73 |
+
|
| 74 |
+
# convert timezones
|
| 75 |
+
return dt.astimezone(tz)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def _get_dt_and_tzinfo(dt_or_tzinfo: _DtOrTzinfo) -> tuple[datetime.datetime | None, datetime.tzinfo]:
|
| 79 |
+
"""
|
| 80 |
+
Parse a `dt_or_tzinfo` value into a datetime and a tzinfo.
|
| 81 |
+
|
| 82 |
+
See the docs for this function's callers for semantics.
|
| 83 |
+
|
| 84 |
+
:rtype: tuple[datetime, tzinfo]
|
| 85 |
+
"""
|
| 86 |
+
if dt_or_tzinfo is None:
|
| 87 |
+
dt = datetime.datetime.now()
|
| 88 |
+
tzinfo = LOCALTZ
|
| 89 |
+
elif isinstance(dt_or_tzinfo, str):
|
| 90 |
+
dt = None
|
| 91 |
+
tzinfo = get_timezone(dt_or_tzinfo)
|
| 92 |
+
elif isinstance(dt_or_tzinfo, int):
|
| 93 |
+
dt = None
|
| 94 |
+
tzinfo = UTC
|
| 95 |
+
elif isinstance(dt_or_tzinfo, (datetime.datetime, datetime.time)):
|
| 96 |
+
dt = _get_datetime(dt_or_tzinfo)
|
| 97 |
+
tzinfo = dt.tzinfo if dt.tzinfo is not None else UTC
|
| 98 |
+
else:
|
| 99 |
+
dt = None
|
| 100 |
+
tzinfo = dt_or_tzinfo
|
| 101 |
+
return dt, tzinfo
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _get_tz_name(dt_or_tzinfo: _DtOrTzinfo) -> str:
|
| 105 |
+
"""
|
| 106 |
+
Get the timezone name out of a time, datetime, or tzinfo object.
|
| 107 |
+
|
| 108 |
+
:rtype: str
|
| 109 |
+
"""
|
| 110 |
+
dt, tzinfo = _get_dt_and_tzinfo(dt_or_tzinfo)
|
| 111 |
+
if hasattr(tzinfo, 'zone'): # pytz object
|
| 112 |
+
return tzinfo.zone
|
| 113 |
+
elif hasattr(tzinfo, 'key') and tzinfo.key is not None: # ZoneInfo object
|
| 114 |
+
return tzinfo.key
|
| 115 |
+
else:
|
| 116 |
+
return tzinfo.tzname(dt or datetime.datetime.now(UTC))
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def _get_datetime(instant: _Instant) -> datetime.datetime:
|
| 120 |
+
"""
|
| 121 |
+
Get a datetime out of an "instant" (date, time, datetime, number).
|
| 122 |
+
|
| 123 |
+
.. warning:: The return values of this function may depend on the system clock.
|
| 124 |
+
|
| 125 |
+
If the instant is None, the current moment is used.
|
| 126 |
+
If the instant is a time, it's augmented with today's date.
|
| 127 |
+
|
| 128 |
+
Dates are converted to naive datetimes with midnight as the time component.
|
| 129 |
+
|
| 130 |
+
>>> from datetime import date, datetime
|
| 131 |
+
>>> _get_datetime(date(2015, 1, 1))
|
| 132 |
+
datetime.datetime(2015, 1, 1, 0, 0)
|
| 133 |
+
|
| 134 |
+
UNIX timestamps are converted to datetimes.
|
| 135 |
+
|
| 136 |
+
>>> _get_datetime(1400000000)
|
| 137 |
+
datetime.datetime(2014, 5, 13, 16, 53, 20)
|
| 138 |
+
|
| 139 |
+
Other values are passed through as-is.
|
| 140 |
+
|
| 141 |
+
>>> x = datetime(2015, 1, 1)
|
| 142 |
+
>>> _get_datetime(x) is x
|
| 143 |
+
True
|
| 144 |
+
|
| 145 |
+
:param instant: date, time, datetime, integer, float or None
|
| 146 |
+
:type instant: date|time|datetime|int|float|None
|
| 147 |
+
:return: a datetime
|
| 148 |
+
:rtype: datetime
|
| 149 |
+
"""
|
| 150 |
+
if instant is None:
|
| 151 |
+
return datetime.datetime.now(UTC).replace(tzinfo=None)
|
| 152 |
+
elif isinstance(instant, (int, float)):
|
| 153 |
+
return datetime.datetime.fromtimestamp(instant, UTC).replace(tzinfo=None)
|
| 154 |
+
elif isinstance(instant, datetime.time):
|
| 155 |
+
return datetime.datetime.combine(datetime.date.today(), instant)
|
| 156 |
+
elif isinstance(instant, datetime.date) and not isinstance(instant, datetime.datetime):
|
| 157 |
+
return datetime.datetime.combine(instant, datetime.time())
|
| 158 |
+
# TODO (3.x): Add an assertion/type check for this fallthrough branch:
|
| 159 |
+
return instant
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
def _ensure_datetime_tzinfo(dt: datetime.datetime, tzinfo: datetime.tzinfo | None = None) -> datetime.datetime:
|
| 163 |
+
"""
|
| 164 |
+
Ensure the datetime passed has an attached tzinfo.
|
| 165 |
+
|
| 166 |
+
If the datetime is tz-naive to begin with, UTC is attached.
|
| 167 |
+
|
| 168 |
+
If a tzinfo is passed in, the datetime is normalized to that timezone.
|
| 169 |
+
|
| 170 |
+
>>> from datetime import datetime
|
| 171 |
+
>>> _get_tz_name(_ensure_datetime_tzinfo(datetime(2015, 1, 1)))
|
| 172 |
+
'UTC'
|
| 173 |
+
|
| 174 |
+
>>> tz = get_timezone("Europe/Stockholm")
|
| 175 |
+
>>> _ensure_datetime_tzinfo(datetime(2015, 1, 1, 13, 15, tzinfo=UTC), tzinfo=tz).hour
|
| 176 |
+
14
|
| 177 |
+
|
| 178 |
+
:param datetime: Datetime to augment.
|
| 179 |
+
:param tzinfo: optional tzinfo
|
| 180 |
+
:return: datetime with tzinfo
|
| 181 |
+
:rtype: datetime
|
| 182 |
+
"""
|
| 183 |
+
if dt.tzinfo is None:
|
| 184 |
+
dt = dt.replace(tzinfo=UTC)
|
| 185 |
+
if tzinfo is not None:
|
| 186 |
+
dt = dt.astimezone(get_timezone(tzinfo))
|
| 187 |
+
if hasattr(tzinfo, 'normalize'): # pytz
|
| 188 |
+
dt = tzinfo.normalize(dt)
|
| 189 |
+
return dt
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
def _get_time(
|
| 193 |
+
time: datetime.time | datetime.datetime | None,
|
| 194 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 195 |
+
) -> datetime.time:
|
| 196 |
+
"""
|
| 197 |
+
Get a timezoned time from a given instant.
|
| 198 |
+
|
| 199 |
+
.. warning:: The return values of this function may depend on the system clock.
|
| 200 |
+
|
| 201 |
+
:param time: time, datetime or None
|
| 202 |
+
:rtype: time
|
| 203 |
+
"""
|
| 204 |
+
if time is None:
|
| 205 |
+
time = datetime.datetime.now(UTC)
|
| 206 |
+
elif isinstance(time, (int, float)):
|
| 207 |
+
time = datetime.datetime.fromtimestamp(time, UTC)
|
| 208 |
+
|
| 209 |
+
if time.tzinfo is None:
|
| 210 |
+
time = time.replace(tzinfo=UTC)
|
| 211 |
+
|
| 212 |
+
if isinstance(time, datetime.datetime):
|
| 213 |
+
if tzinfo is not None:
|
| 214 |
+
time = time.astimezone(tzinfo)
|
| 215 |
+
if hasattr(tzinfo, 'normalize'): # pytz
|
| 216 |
+
time = tzinfo.normalize(time)
|
| 217 |
+
time = time.timetz()
|
| 218 |
+
elif tzinfo is not None:
|
| 219 |
+
time = time.replace(tzinfo=tzinfo)
|
| 220 |
+
return time
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
def get_timezone(zone: str | datetime.tzinfo | None = None) -> datetime.tzinfo:
|
| 224 |
+
"""Looks up a timezone by name and returns it. The timezone object
|
| 225 |
+
returned comes from ``pytz`` or ``zoneinfo``, whichever is available.
|
| 226 |
+
It corresponds to the `tzinfo` interface and can be used with all of
|
| 227 |
+
the functions of Babel that operate with dates.
|
| 228 |
+
|
| 229 |
+
If a timezone is not known a :exc:`LookupError` is raised. If `zone`
|
| 230 |
+
is ``None`` a local zone object is returned.
|
| 231 |
+
|
| 232 |
+
:param zone: the name of the timezone to look up. If a timezone object
|
| 233 |
+
itself is passed in, it's returned unchanged.
|
| 234 |
+
"""
|
| 235 |
+
if zone is None:
|
| 236 |
+
return LOCALTZ
|
| 237 |
+
if not isinstance(zone, str):
|
| 238 |
+
return zone
|
| 239 |
+
|
| 240 |
+
if pytz:
|
| 241 |
+
try:
|
| 242 |
+
return pytz.timezone(zone)
|
| 243 |
+
except pytz.UnknownTimeZoneError as e:
|
| 244 |
+
exc = e
|
| 245 |
+
else:
|
| 246 |
+
assert zoneinfo
|
| 247 |
+
try:
|
| 248 |
+
return zoneinfo.ZoneInfo(zone)
|
| 249 |
+
except zoneinfo.ZoneInfoNotFoundError as e:
|
| 250 |
+
exc = e
|
| 251 |
+
|
| 252 |
+
raise LookupError(f"Unknown timezone {zone}") from exc
|
| 253 |
+
|
| 254 |
+
|
| 255 |
+
def get_period_names(width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 256 |
+
context: _Context = 'stand-alone', locale: Locale | str | None = LC_TIME) -> LocaleDataDict:
|
| 257 |
+
"""Return the names for day periods (AM/PM) used by the locale.
|
| 258 |
+
|
| 259 |
+
>>> get_period_names(locale='en_US')['am']
|
| 260 |
+
u'AM'
|
| 261 |
+
|
| 262 |
+
:param width: the width to use, one of "abbreviated", "narrow", or "wide"
|
| 263 |
+
:param context: the context, either "format" or "stand-alone"
|
| 264 |
+
:param locale: the `Locale` object, or a locale string
|
| 265 |
+
"""
|
| 266 |
+
return Locale.parse(locale).day_periods[context][width]
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
def get_day_names(width: Literal['abbreviated', 'narrow', 'short', 'wide'] = 'wide',
|
| 270 |
+
context: _Context = 'format', locale: Locale | str | None = LC_TIME) -> LocaleDataDict:
|
| 271 |
+
"""Return the day names used by the locale for the specified format.
|
| 272 |
+
|
| 273 |
+
>>> get_day_names('wide', locale='en_US')[1]
|
| 274 |
+
u'Tuesday'
|
| 275 |
+
>>> get_day_names('short', locale='en_US')[1]
|
| 276 |
+
u'Tu'
|
| 277 |
+
>>> get_day_names('abbreviated', locale='es')[1]
|
| 278 |
+
u'mar'
|
| 279 |
+
>>> get_day_names('narrow', context='stand-alone', locale='de_DE')[1]
|
| 280 |
+
u'D'
|
| 281 |
+
|
| 282 |
+
:param width: the width to use, one of "wide", "abbreviated", "short" or "narrow"
|
| 283 |
+
:param context: the context, either "format" or "stand-alone"
|
| 284 |
+
:param locale: the `Locale` object, or a locale string
|
| 285 |
+
"""
|
| 286 |
+
return Locale.parse(locale).days[context][width]
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
def get_month_names(width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 290 |
+
context: _Context = 'format', locale: Locale | str | None = LC_TIME) -> LocaleDataDict:
|
| 291 |
+
"""Return the month names used by the locale for the specified format.
|
| 292 |
+
|
| 293 |
+
>>> get_month_names('wide', locale='en_US')[1]
|
| 294 |
+
u'January'
|
| 295 |
+
>>> get_month_names('abbreviated', locale='es')[1]
|
| 296 |
+
u'ene'
|
| 297 |
+
>>> get_month_names('narrow', context='stand-alone', locale='de_DE')[1]
|
| 298 |
+
u'J'
|
| 299 |
+
|
| 300 |
+
:param width: the width to use, one of "wide", "abbreviated", or "narrow"
|
| 301 |
+
:param context: the context, either "format" or "stand-alone"
|
| 302 |
+
:param locale: the `Locale` object, or a locale string
|
| 303 |
+
"""
|
| 304 |
+
return Locale.parse(locale).months[context][width]
|
| 305 |
+
|
| 306 |
+
|
| 307 |
+
def get_quarter_names(width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 308 |
+
context: _Context = 'format', locale: Locale | str | None = LC_TIME) -> LocaleDataDict:
|
| 309 |
+
"""Return the quarter names used by the locale for the specified format.
|
| 310 |
+
|
| 311 |
+
>>> get_quarter_names('wide', locale='en_US')[1]
|
| 312 |
+
u'1st quarter'
|
| 313 |
+
>>> get_quarter_names('abbreviated', locale='de_DE')[1]
|
| 314 |
+
u'Q1'
|
| 315 |
+
>>> get_quarter_names('narrow', locale='de_DE')[1]
|
| 316 |
+
u'1'
|
| 317 |
+
|
| 318 |
+
:param width: the width to use, one of "wide", "abbreviated", or "narrow"
|
| 319 |
+
:param context: the context, either "format" or "stand-alone"
|
| 320 |
+
:param locale: the `Locale` object, or a locale string
|
| 321 |
+
"""
|
| 322 |
+
return Locale.parse(locale).quarters[context][width]
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
def get_era_names(width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 326 |
+
locale: Locale | str | None = LC_TIME) -> LocaleDataDict:
|
| 327 |
+
"""Return the era names used by the locale for the specified format.
|
| 328 |
+
|
| 329 |
+
>>> get_era_names('wide', locale='en_US')[1]
|
| 330 |
+
u'Anno Domini'
|
| 331 |
+
>>> get_era_names('abbreviated', locale='de_DE')[1]
|
| 332 |
+
u'n. Chr.'
|
| 333 |
+
|
| 334 |
+
:param width: the width to use, either "wide", "abbreviated", or "narrow"
|
| 335 |
+
:param locale: the `Locale` object, or a locale string
|
| 336 |
+
"""
|
| 337 |
+
return Locale.parse(locale).eras[width]
|
| 338 |
+
|
| 339 |
+
|
| 340 |
+
def get_date_format(format: _PredefinedTimeFormat = 'medium', locale: Locale | str | None = LC_TIME) -> DateTimePattern:
|
| 341 |
+
"""Return the date formatting patterns used by the locale for the specified
|
| 342 |
+
format.
|
| 343 |
+
|
| 344 |
+
>>> get_date_format(locale='en_US')
|
| 345 |
+
<DateTimePattern u'MMM d, y'>
|
| 346 |
+
>>> get_date_format('full', locale='de_DE')
|
| 347 |
+
<DateTimePattern u'EEEE, d. MMMM y'>
|
| 348 |
+
|
| 349 |
+
:param format: the format to use, one of "full", "long", "medium", or
|
| 350 |
+
"short"
|
| 351 |
+
:param locale: the `Locale` object, or a locale string
|
| 352 |
+
"""
|
| 353 |
+
return Locale.parse(locale).date_formats[format]
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
def get_datetime_format(format: _PredefinedTimeFormat = 'medium', locale: Locale | str | None = LC_TIME) -> DateTimePattern:
|
| 357 |
+
"""Return the datetime formatting patterns used by the locale for the
|
| 358 |
+
specified format.
|
| 359 |
+
|
| 360 |
+
>>> get_datetime_format(locale='en_US')
|
| 361 |
+
u'{1}, {0}'
|
| 362 |
+
|
| 363 |
+
:param format: the format to use, one of "full", "long", "medium", or
|
| 364 |
+
"short"
|
| 365 |
+
:param locale: the `Locale` object, or a locale string
|
| 366 |
+
"""
|
| 367 |
+
patterns = Locale.parse(locale).datetime_formats
|
| 368 |
+
if format not in patterns:
|
| 369 |
+
format = None
|
| 370 |
+
return patterns[format]
|
| 371 |
+
|
| 372 |
+
|
| 373 |
+
def get_time_format(format: _PredefinedTimeFormat = 'medium', locale: Locale | str | None = LC_TIME) -> DateTimePattern:
|
| 374 |
+
"""Return the time formatting patterns used by the locale for the specified
|
| 375 |
+
format.
|
| 376 |
+
|
| 377 |
+
>>> get_time_format(locale='en_US')
|
| 378 |
+
<DateTimePattern u'h:mm:ss\u202fa'>
|
| 379 |
+
>>> get_time_format('full', locale='de_DE')
|
| 380 |
+
<DateTimePattern u'HH:mm:ss zzzz'>
|
| 381 |
+
|
| 382 |
+
:param format: the format to use, one of "full", "long", "medium", or
|
| 383 |
+
"short"
|
| 384 |
+
:param locale: the `Locale` object, or a locale string
|
| 385 |
+
"""
|
| 386 |
+
return Locale.parse(locale).time_formats[format]
|
| 387 |
+
|
| 388 |
+
|
| 389 |
+
def get_timezone_gmt(
|
| 390 |
+
datetime: _Instant = None,
|
| 391 |
+
width: Literal['long', 'short', 'iso8601', 'iso8601_short'] = 'long',
|
| 392 |
+
locale: Locale | str | None = LC_TIME,
|
| 393 |
+
return_z: bool = False,
|
| 394 |
+
) -> str:
|
| 395 |
+
"""Return the timezone associated with the given `datetime` object formatted
|
| 396 |
+
as string indicating the offset from GMT.
|
| 397 |
+
|
| 398 |
+
>>> from datetime import datetime
|
| 399 |
+
>>> dt = datetime(2007, 4, 1, 15, 30)
|
| 400 |
+
>>> get_timezone_gmt(dt, locale='en')
|
| 401 |
+
u'GMT+00:00'
|
| 402 |
+
>>> get_timezone_gmt(dt, locale='en', return_z=True)
|
| 403 |
+
'Z'
|
| 404 |
+
>>> get_timezone_gmt(dt, locale='en', width='iso8601_short')
|
| 405 |
+
u'+00'
|
| 406 |
+
>>> tz = get_timezone('America/Los_Angeles')
|
| 407 |
+
>>> dt = _localize(tz, datetime(2007, 4, 1, 15, 30))
|
| 408 |
+
>>> get_timezone_gmt(dt, locale='en')
|
| 409 |
+
u'GMT-07:00'
|
| 410 |
+
>>> get_timezone_gmt(dt, 'short', locale='en')
|
| 411 |
+
u'-0700'
|
| 412 |
+
>>> get_timezone_gmt(dt, locale='en', width='iso8601_short')
|
| 413 |
+
u'-07'
|
| 414 |
+
|
| 415 |
+
The long format depends on the locale, for example in France the acronym
|
| 416 |
+
UTC string is used instead of GMT:
|
| 417 |
+
|
| 418 |
+
>>> get_timezone_gmt(dt, 'long', locale='fr_FR')
|
| 419 |
+
u'UTC-07:00'
|
| 420 |
+
|
| 421 |
+
.. versionadded:: 0.9
|
| 422 |
+
|
| 423 |
+
:param datetime: the ``datetime`` object; if `None`, the current date and
|
| 424 |
+
time in UTC is used
|
| 425 |
+
:param width: either "long" or "short" or "iso8601" or "iso8601_short"
|
| 426 |
+
:param locale: the `Locale` object, or a locale string
|
| 427 |
+
:param return_z: True or False; Function returns indicator "Z"
|
| 428 |
+
when local time offset is 0
|
| 429 |
+
"""
|
| 430 |
+
datetime = _ensure_datetime_tzinfo(_get_datetime(datetime))
|
| 431 |
+
locale = Locale.parse(locale)
|
| 432 |
+
|
| 433 |
+
offset = datetime.tzinfo.utcoffset(datetime)
|
| 434 |
+
seconds = offset.days * 24 * 60 * 60 + offset.seconds
|
| 435 |
+
hours, seconds = divmod(seconds, 3600)
|
| 436 |
+
if return_z and hours == 0 and seconds == 0:
|
| 437 |
+
return 'Z'
|
| 438 |
+
elif seconds == 0 and width == 'iso8601_short':
|
| 439 |
+
return '%+03d' % hours
|
| 440 |
+
elif width == 'short' or width == 'iso8601_short':
|
| 441 |
+
pattern = '%+03d%02d'
|
| 442 |
+
elif width == 'iso8601':
|
| 443 |
+
pattern = '%+03d:%02d'
|
| 444 |
+
else:
|
| 445 |
+
pattern = locale.zone_formats['gmt'] % '%+03d:%02d'
|
| 446 |
+
return pattern % (hours, seconds // 60)
|
| 447 |
+
|
| 448 |
+
|
| 449 |
+
def get_timezone_location(
|
| 450 |
+
dt_or_tzinfo: _DtOrTzinfo = None,
|
| 451 |
+
locale: Locale | str | None = LC_TIME,
|
| 452 |
+
return_city: bool = False,
|
| 453 |
+
) -> str:
|
| 454 |
+
"""Return a representation of the given timezone using "location format".
|
| 455 |
+
|
| 456 |
+
The result depends on both the local display name of the country and the
|
| 457 |
+
city associated with the time zone:
|
| 458 |
+
|
| 459 |
+
>>> tz = get_timezone('America/St_Johns')
|
| 460 |
+
>>> print(get_timezone_location(tz, locale='de_DE'))
|
| 461 |
+
Kanada (St. John’s) (Ortszeit)
|
| 462 |
+
>>> print(get_timezone_location(tz, locale='en'))
|
| 463 |
+
Canada (St. John’s) Time
|
| 464 |
+
>>> print(get_timezone_location(tz, locale='en', return_city=True))
|
| 465 |
+
St. John’s
|
| 466 |
+
>>> tz = get_timezone('America/Mexico_City')
|
| 467 |
+
>>> get_timezone_location(tz, locale='de_DE')
|
| 468 |
+
u'Mexiko (Mexiko-Stadt) (Ortszeit)'
|
| 469 |
+
|
| 470 |
+
If the timezone is associated with a country that uses only a single
|
| 471 |
+
timezone, just the localized country name is returned:
|
| 472 |
+
|
| 473 |
+
>>> tz = get_timezone('Europe/Berlin')
|
| 474 |
+
>>> get_timezone_name(tz, locale='de_DE')
|
| 475 |
+
u'Mitteleurop\\xe4ische Zeit'
|
| 476 |
+
|
| 477 |
+
.. versionadded:: 0.9
|
| 478 |
+
|
| 479 |
+
:param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
|
| 480 |
+
the timezone; if `None`, the current date and time in
|
| 481 |
+
UTC is assumed
|
| 482 |
+
:param locale: the `Locale` object, or a locale string
|
| 483 |
+
:param return_city: True or False, if True then return exemplar city (location)
|
| 484 |
+
for the time zone
|
| 485 |
+
:return: the localized timezone name using location format
|
| 486 |
+
|
| 487 |
+
"""
|
| 488 |
+
locale = Locale.parse(locale)
|
| 489 |
+
|
| 490 |
+
zone = _get_tz_name(dt_or_tzinfo)
|
| 491 |
+
|
| 492 |
+
# Get the canonical time-zone code
|
| 493 |
+
zone = get_global('zone_aliases').get(zone, zone)
|
| 494 |
+
|
| 495 |
+
info = locale.time_zones.get(zone, {})
|
| 496 |
+
|
| 497 |
+
# Otherwise, if there is only one timezone for the country, return the
|
| 498 |
+
# localized country name
|
| 499 |
+
region_format = locale.zone_formats['region']
|
| 500 |
+
territory = get_global('zone_territories').get(zone)
|
| 501 |
+
if territory not in locale.territories:
|
| 502 |
+
territory = 'ZZ' # invalid/unknown
|
| 503 |
+
territory_name = locale.territories[territory]
|
| 504 |
+
if not return_city and territory and len(get_global('territory_zones').get(territory, [])) == 1:
|
| 505 |
+
return region_format % territory_name
|
| 506 |
+
|
| 507 |
+
# Otherwise, include the city in the output
|
| 508 |
+
fallback_format = locale.zone_formats['fallback']
|
| 509 |
+
if 'city' in info:
|
| 510 |
+
city_name = info['city']
|
| 511 |
+
else:
|
| 512 |
+
metazone = get_global('meta_zones').get(zone)
|
| 513 |
+
metazone_info = locale.meta_zones.get(metazone, {})
|
| 514 |
+
if 'city' in metazone_info:
|
| 515 |
+
city_name = metazone_info['city']
|
| 516 |
+
elif '/' in zone:
|
| 517 |
+
city_name = zone.split('/', 1)[1].replace('_', ' ')
|
| 518 |
+
else:
|
| 519 |
+
city_name = zone.replace('_', ' ')
|
| 520 |
+
|
| 521 |
+
if return_city:
|
| 522 |
+
return city_name
|
| 523 |
+
return region_format % (fallback_format % {
|
| 524 |
+
'0': city_name,
|
| 525 |
+
'1': territory_name,
|
| 526 |
+
})
|
| 527 |
+
|
| 528 |
+
|
| 529 |
+
def get_timezone_name(
|
| 530 |
+
dt_or_tzinfo: _DtOrTzinfo = None,
|
| 531 |
+
width: Literal['long', 'short'] = 'long',
|
| 532 |
+
uncommon: bool = False,
|
| 533 |
+
locale: Locale | str | None = LC_TIME,
|
| 534 |
+
zone_variant: Literal['generic', 'daylight', 'standard'] | None = None,
|
| 535 |
+
return_zone: bool = False,
|
| 536 |
+
) -> str:
|
| 537 |
+
r"""Return the localized display name for the given timezone. The timezone
|
| 538 |
+
may be specified using a ``datetime`` or `tzinfo` object.
|
| 539 |
+
|
| 540 |
+
>>> from datetime import time
|
| 541 |
+
>>> dt = time(15, 30, tzinfo=get_timezone('America/Los_Angeles'))
|
| 542 |
+
>>> get_timezone_name(dt, locale='en_US') # doctest: +SKIP
|
| 543 |
+
u'Pacific Standard Time'
|
| 544 |
+
>>> get_timezone_name(dt, locale='en_US', return_zone=True)
|
| 545 |
+
'America/Los_Angeles'
|
| 546 |
+
>>> get_timezone_name(dt, width='short', locale='en_US') # doctest: +SKIP
|
| 547 |
+
u'PST'
|
| 548 |
+
|
| 549 |
+
If this function gets passed only a `tzinfo` object and no concrete
|
| 550 |
+
`datetime`, the returned display name is independent of daylight savings
|
| 551 |
+
time. This can be used for example for selecting timezones, or to set the
|
| 552 |
+
time of events that recur across DST changes:
|
| 553 |
+
|
| 554 |
+
>>> tz = get_timezone('America/Los_Angeles')
|
| 555 |
+
>>> get_timezone_name(tz, locale='en_US')
|
| 556 |
+
u'Pacific Time'
|
| 557 |
+
>>> get_timezone_name(tz, 'short', locale='en_US')
|
| 558 |
+
u'PT'
|
| 559 |
+
|
| 560 |
+
If no localized display name for the timezone is available, and the timezone
|
| 561 |
+
is associated with a country that uses only a single timezone, the name of
|
| 562 |
+
that country is returned, formatted according to the locale:
|
| 563 |
+
|
| 564 |
+
>>> tz = get_timezone('Europe/Berlin')
|
| 565 |
+
>>> get_timezone_name(tz, locale='de_DE')
|
| 566 |
+
u'Mitteleurop\xe4ische Zeit'
|
| 567 |
+
>>> get_timezone_name(tz, locale='pt_BR')
|
| 568 |
+
u'Hor\xe1rio da Europa Central'
|
| 569 |
+
|
| 570 |
+
On the other hand, if the country uses multiple timezones, the city is also
|
| 571 |
+
included in the representation:
|
| 572 |
+
|
| 573 |
+
>>> tz = get_timezone('America/St_Johns')
|
| 574 |
+
>>> get_timezone_name(tz, locale='de_DE')
|
| 575 |
+
u'Neufundland-Zeit'
|
| 576 |
+
|
| 577 |
+
Note that short format is currently not supported for all timezones and
|
| 578 |
+
all locales. This is partially because not every timezone has a short
|
| 579 |
+
code in every locale. In that case it currently falls back to the long
|
| 580 |
+
format.
|
| 581 |
+
|
| 582 |
+
For more information see `LDML Appendix J: Time Zone Display Names
|
| 583 |
+
<https://www.unicode.org/reports/tr35/#Time_Zone_Fallback>`_
|
| 584 |
+
|
| 585 |
+
.. versionadded:: 0.9
|
| 586 |
+
|
| 587 |
+
.. versionchanged:: 1.0
|
| 588 |
+
Added `zone_variant` support.
|
| 589 |
+
|
| 590 |
+
:param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
|
| 591 |
+
the timezone; if a ``tzinfo`` object is used, the
|
| 592 |
+
resulting display name will be generic, i.e.
|
| 593 |
+
independent of daylight savings time; if `None`, the
|
| 594 |
+
current date in UTC is assumed
|
| 595 |
+
:param width: either "long" or "short"
|
| 596 |
+
:param uncommon: deprecated and ignored
|
| 597 |
+
:param zone_variant: defines the zone variation to return. By default the
|
| 598 |
+
variation is defined from the datetime object
|
| 599 |
+
passed in. If no datetime object is passed in, the
|
| 600 |
+
``'generic'`` variation is assumed. The following
|
| 601 |
+
values are valid: ``'generic'``, ``'daylight'`` and
|
| 602 |
+
``'standard'``.
|
| 603 |
+
:param locale: the `Locale` object, or a locale string
|
| 604 |
+
:param return_zone: True or False. If true then function
|
| 605 |
+
returns long time zone ID
|
| 606 |
+
"""
|
| 607 |
+
dt, tzinfo = _get_dt_and_tzinfo(dt_or_tzinfo)
|
| 608 |
+
locale = Locale.parse(locale)
|
| 609 |
+
|
| 610 |
+
zone = _get_tz_name(dt_or_tzinfo)
|
| 611 |
+
|
| 612 |
+
if zone_variant is None:
|
| 613 |
+
if dt is None:
|
| 614 |
+
zone_variant = 'generic'
|
| 615 |
+
else:
|
| 616 |
+
dst = tzinfo.dst(dt)
|
| 617 |
+
zone_variant = "daylight" if dst else "standard"
|
| 618 |
+
else:
|
| 619 |
+
if zone_variant not in ('generic', 'standard', 'daylight'):
|
| 620 |
+
raise ValueError('Invalid zone variation')
|
| 621 |
+
|
| 622 |
+
# Get the canonical time-zone code
|
| 623 |
+
zone = get_global('zone_aliases').get(zone, zone)
|
| 624 |
+
if return_zone:
|
| 625 |
+
return zone
|
| 626 |
+
info = locale.time_zones.get(zone, {})
|
| 627 |
+
# Try explicitly translated zone names first
|
| 628 |
+
if width in info and zone_variant in info[width]:
|
| 629 |
+
return info[width][zone_variant]
|
| 630 |
+
|
| 631 |
+
metazone = get_global('meta_zones').get(zone)
|
| 632 |
+
if metazone:
|
| 633 |
+
metazone_info = locale.meta_zones.get(metazone, {})
|
| 634 |
+
if width in metazone_info:
|
| 635 |
+
name = metazone_info[width].get(zone_variant)
|
| 636 |
+
if width == 'short' and name == NO_INHERITANCE_MARKER:
|
| 637 |
+
# If the short form is marked no-inheritance,
|
| 638 |
+
# try to fall back to the long name instead.
|
| 639 |
+
name = metazone_info.get('long', {}).get(zone_variant)
|
| 640 |
+
if name:
|
| 641 |
+
return name
|
| 642 |
+
|
| 643 |
+
# If we have a concrete datetime, we assume that the result can't be
|
| 644 |
+
# independent of daylight savings time, so we return the GMT offset
|
| 645 |
+
if dt is not None:
|
| 646 |
+
return get_timezone_gmt(dt, width=width, locale=locale)
|
| 647 |
+
|
| 648 |
+
return get_timezone_location(dt_or_tzinfo, locale=locale)
|
| 649 |
+
|
| 650 |
+
|
| 651 |
+
def format_date(
|
| 652 |
+
date: datetime.date | None = None,
|
| 653 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 654 |
+
locale: Locale | str | None = LC_TIME,
|
| 655 |
+
) -> str:
|
| 656 |
+
"""Return a date formatted according to the given pattern.
|
| 657 |
+
|
| 658 |
+
>>> from datetime import date
|
| 659 |
+
>>> d = date(2007, 4, 1)
|
| 660 |
+
>>> format_date(d, locale='en_US')
|
| 661 |
+
u'Apr 1, 2007'
|
| 662 |
+
>>> format_date(d, format='full', locale='de_DE')
|
| 663 |
+
u'Sonntag, 1. April 2007'
|
| 664 |
+
|
| 665 |
+
If you don't want to use the locale default formats, you can specify a
|
| 666 |
+
custom date pattern:
|
| 667 |
+
|
| 668 |
+
>>> format_date(d, "EEE, MMM d, ''yy", locale='en')
|
| 669 |
+
u"Sun, Apr 1, '07"
|
| 670 |
+
|
| 671 |
+
:param date: the ``date`` or ``datetime`` object; if `None`, the current
|
| 672 |
+
date is used
|
| 673 |
+
:param format: one of "full", "long", "medium", or "short", or a custom
|
| 674 |
+
date/time pattern
|
| 675 |
+
:param locale: a `Locale` object or a locale identifier
|
| 676 |
+
"""
|
| 677 |
+
if date is None:
|
| 678 |
+
date = datetime.date.today()
|
| 679 |
+
elif isinstance(date, datetime.datetime):
|
| 680 |
+
date = date.date()
|
| 681 |
+
|
| 682 |
+
locale = Locale.parse(locale)
|
| 683 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 684 |
+
format = get_date_format(format, locale=locale)
|
| 685 |
+
pattern = parse_pattern(format)
|
| 686 |
+
return pattern.apply(date, locale)
|
| 687 |
+
|
| 688 |
+
|
| 689 |
+
def format_datetime(
|
| 690 |
+
datetime: _Instant = None,
|
| 691 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 692 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 693 |
+
locale: Locale | str | None = LC_TIME,
|
| 694 |
+
) -> str:
|
| 695 |
+
r"""Return a date formatted according to the given pattern.
|
| 696 |
+
|
| 697 |
+
>>> from datetime import datetime
|
| 698 |
+
>>> dt = datetime(2007, 4, 1, 15, 30)
|
| 699 |
+
>>> format_datetime(dt, locale='en_US')
|
| 700 |
+
u'Apr 1, 2007, 3:30:00\u202fPM'
|
| 701 |
+
|
| 702 |
+
For any pattern requiring the display of the timezone:
|
| 703 |
+
|
| 704 |
+
>>> format_datetime(dt, 'full', tzinfo=get_timezone('Europe/Paris'),
|
| 705 |
+
... locale='fr_FR')
|
| 706 |
+
'dimanche 1 avril 2007, 17:30:00 heure d’été d’Europe centrale'
|
| 707 |
+
>>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz",
|
| 708 |
+
... tzinfo=get_timezone('US/Eastern'), locale='en')
|
| 709 |
+
u'2007.04.01 AD at 11:30:00 EDT'
|
| 710 |
+
|
| 711 |
+
:param datetime: the `datetime` object; if `None`, the current date and
|
| 712 |
+
time is used
|
| 713 |
+
:param format: one of "full", "long", "medium", or "short", or a custom
|
| 714 |
+
date/time pattern
|
| 715 |
+
:param tzinfo: the timezone to apply to the time for display
|
| 716 |
+
:param locale: a `Locale` object or a locale identifier
|
| 717 |
+
"""
|
| 718 |
+
datetime = _ensure_datetime_tzinfo(_get_datetime(datetime), tzinfo)
|
| 719 |
+
|
| 720 |
+
locale = Locale.parse(locale)
|
| 721 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 722 |
+
return get_datetime_format(format, locale=locale) \
|
| 723 |
+
.replace("'", "") \
|
| 724 |
+
.replace('{0}', format_time(datetime, format, tzinfo=None,
|
| 725 |
+
locale=locale)) \
|
| 726 |
+
.replace('{1}', format_date(datetime, format, locale=locale))
|
| 727 |
+
else:
|
| 728 |
+
return parse_pattern(format).apply(datetime, locale)
|
| 729 |
+
|
| 730 |
+
|
| 731 |
+
def format_time(
|
| 732 |
+
time: datetime.time | datetime.datetime | float | None = None,
|
| 733 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 734 |
+
tzinfo: datetime.tzinfo | None = None, locale: Locale | str | None = LC_TIME,
|
| 735 |
+
) -> str:
|
| 736 |
+
r"""Return a time formatted according to the given pattern.
|
| 737 |
+
|
| 738 |
+
>>> from datetime import datetime, time
|
| 739 |
+
>>> t = time(15, 30)
|
| 740 |
+
>>> format_time(t, locale='en_US')
|
| 741 |
+
u'3:30:00\u202fPM'
|
| 742 |
+
>>> format_time(t, format='short', locale='de_DE')
|
| 743 |
+
u'15:30'
|
| 744 |
+
|
| 745 |
+
If you don't want to use the locale default formats, you can specify a
|
| 746 |
+
custom time pattern:
|
| 747 |
+
|
| 748 |
+
>>> format_time(t, "hh 'o''clock' a", locale='en')
|
| 749 |
+
u"03 o'clock PM"
|
| 750 |
+
|
| 751 |
+
For any pattern requiring the display of the time-zone a
|
| 752 |
+
timezone has to be specified explicitly:
|
| 753 |
+
|
| 754 |
+
>>> t = datetime(2007, 4, 1, 15, 30)
|
| 755 |
+
>>> tzinfo = get_timezone('Europe/Paris')
|
| 756 |
+
>>> t = _localize(tzinfo, t)
|
| 757 |
+
>>> format_time(t, format='full', tzinfo=tzinfo, locale='fr_FR')
|
| 758 |
+
'15:30:00 heure d’été d’Europe centrale'
|
| 759 |
+
>>> format_time(t, "hh 'o''clock' a, zzzz", tzinfo=get_timezone('US/Eastern'),
|
| 760 |
+
... locale='en')
|
| 761 |
+
u"09 o'clock AM, Eastern Daylight Time"
|
| 762 |
+
|
| 763 |
+
As that example shows, when this function gets passed a
|
| 764 |
+
``datetime.datetime`` value, the actual time in the formatted string is
|
| 765 |
+
adjusted to the timezone specified by the `tzinfo` parameter. If the
|
| 766 |
+
``datetime`` is "naive" (i.e. it has no associated timezone information),
|
| 767 |
+
it is assumed to be in UTC.
|
| 768 |
+
|
| 769 |
+
These timezone calculations are **not** performed if the value is of type
|
| 770 |
+
``datetime.time``, as without date information there's no way to determine
|
| 771 |
+
what a given time would translate to in a different timezone without
|
| 772 |
+
information about whether daylight savings time is in effect or not. This
|
| 773 |
+
means that time values are left as-is, and the value of the `tzinfo`
|
| 774 |
+
parameter is only used to display the timezone name if needed:
|
| 775 |
+
|
| 776 |
+
>>> t = time(15, 30)
|
| 777 |
+
>>> format_time(t, format='full', tzinfo=get_timezone('Europe/Paris'),
|
| 778 |
+
... locale='fr_FR') # doctest: +SKIP
|
| 779 |
+
u'15:30:00 heure normale d\u2019Europe centrale'
|
| 780 |
+
>>> format_time(t, format='full', tzinfo=get_timezone('US/Eastern'),
|
| 781 |
+
... locale='en_US') # doctest: +SKIP
|
| 782 |
+
u'3:30:00\u202fPM Eastern Standard Time'
|
| 783 |
+
|
| 784 |
+
:param time: the ``time`` or ``datetime`` object; if `None`, the current
|
| 785 |
+
time in UTC is used
|
| 786 |
+
:param format: one of "full", "long", "medium", or "short", or a custom
|
| 787 |
+
date/time pattern
|
| 788 |
+
:param tzinfo: the time-zone to apply to the time for display
|
| 789 |
+
:param locale: a `Locale` object or a locale identifier
|
| 790 |
+
"""
|
| 791 |
+
|
| 792 |
+
# get reference date for if we need to find the right timezone variant
|
| 793 |
+
# in the pattern
|
| 794 |
+
ref_date = time.date() if isinstance(time, datetime.datetime) else None
|
| 795 |
+
|
| 796 |
+
time = _get_time(time, tzinfo)
|
| 797 |
+
|
| 798 |
+
locale = Locale.parse(locale)
|
| 799 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 800 |
+
format = get_time_format(format, locale=locale)
|
| 801 |
+
return parse_pattern(format).apply(time, locale, reference_date=ref_date)
|
| 802 |
+
|
| 803 |
+
|
| 804 |
+
def format_skeleton(
|
| 805 |
+
skeleton: str,
|
| 806 |
+
datetime: _Instant = None,
|
| 807 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 808 |
+
fuzzy: bool = True,
|
| 809 |
+
locale: Locale | str | None = LC_TIME,
|
| 810 |
+
) -> str:
|
| 811 |
+
r"""Return a time and/or date formatted according to the given pattern.
|
| 812 |
+
|
| 813 |
+
The skeletons are defined in the CLDR data and provide more flexibility
|
| 814 |
+
than the simple short/long/medium formats, but are a bit harder to use.
|
| 815 |
+
The are defined using the date/time symbols without order or punctuation
|
| 816 |
+
and map to a suitable format for the given locale.
|
| 817 |
+
|
| 818 |
+
>>> from datetime import datetime
|
| 819 |
+
>>> t = datetime(2007, 4, 1, 15, 30)
|
| 820 |
+
>>> format_skeleton('MMMEd', t, locale='fr')
|
| 821 |
+
u'dim. 1 avr.'
|
| 822 |
+
>>> format_skeleton('MMMEd', t, locale='en')
|
| 823 |
+
u'Sun, Apr 1'
|
| 824 |
+
>>> format_skeleton('yMMd', t, locale='fi') # yMMd is not in the Finnish locale; yMd gets used
|
| 825 |
+
u'1.4.2007'
|
| 826 |
+
>>> format_skeleton('yMMd', t, fuzzy=False, locale='fi') # yMMd is not in the Finnish locale, an error is thrown
|
| 827 |
+
Traceback (most recent call last):
|
| 828 |
+
...
|
| 829 |
+
KeyError: yMMd
|
| 830 |
+
>>> format_skeleton('GH', t, fuzzy=True, locale='fi_FI') # GH is not in the Finnish locale and there is no close match, an error is thrown
|
| 831 |
+
Traceback (most recent call last):
|
| 832 |
+
...
|
| 833 |
+
KeyError: None
|
| 834 |
+
|
| 835 |
+
After the skeleton is resolved to a pattern `format_datetime` is called so
|
| 836 |
+
all timezone processing etc is the same as for that.
|
| 837 |
+
|
| 838 |
+
:param skeleton: A date time skeleton as defined in the cldr data.
|
| 839 |
+
:param datetime: the ``time`` or ``datetime`` object; if `None`, the current
|
| 840 |
+
time in UTC is used
|
| 841 |
+
:param tzinfo: the time-zone to apply to the time for display
|
| 842 |
+
:param fuzzy: If the skeleton is not found, allow choosing a skeleton that's
|
| 843 |
+
close enough to it. If there is no close match, a `KeyError`
|
| 844 |
+
is thrown.
|
| 845 |
+
:param locale: a `Locale` object or a locale identifier
|
| 846 |
+
"""
|
| 847 |
+
locale = Locale.parse(locale)
|
| 848 |
+
if fuzzy and skeleton not in locale.datetime_skeletons:
|
| 849 |
+
skeleton = match_skeleton(skeleton, locale.datetime_skeletons)
|
| 850 |
+
format = locale.datetime_skeletons[skeleton]
|
| 851 |
+
return format_datetime(datetime, format, tzinfo, locale)
|
| 852 |
+
|
| 853 |
+
|
| 854 |
+
TIMEDELTA_UNITS: tuple[tuple[str, int], ...] = (
|
| 855 |
+
('year', 3600 * 24 * 365),
|
| 856 |
+
('month', 3600 * 24 * 30),
|
| 857 |
+
('week', 3600 * 24 * 7),
|
| 858 |
+
('day', 3600 * 24),
|
| 859 |
+
('hour', 3600),
|
| 860 |
+
('minute', 60),
|
| 861 |
+
('second', 1),
|
| 862 |
+
)
|
| 863 |
+
|
| 864 |
+
|
| 865 |
+
def format_timedelta(
|
| 866 |
+
delta: datetime.timedelta | int,
|
| 867 |
+
granularity: Literal['year', 'month', 'week', 'day', 'hour', 'minute', 'second'] = 'second',
|
| 868 |
+
threshold: float = .85,
|
| 869 |
+
add_direction: bool = False,
|
| 870 |
+
format: Literal['narrow', 'short', 'medium', 'long'] = 'long',
|
| 871 |
+
locale: Locale | str | None = LC_TIME,
|
| 872 |
+
) -> str:
|
| 873 |
+
"""Return a time delta according to the rules of the given locale.
|
| 874 |
+
|
| 875 |
+
>>> from datetime import timedelta
|
| 876 |
+
>>> format_timedelta(timedelta(weeks=12), locale='en_US')
|
| 877 |
+
u'3 months'
|
| 878 |
+
>>> format_timedelta(timedelta(seconds=1), locale='es')
|
| 879 |
+
u'1 segundo'
|
| 880 |
+
|
| 881 |
+
The granularity parameter can be provided to alter the lowest unit
|
| 882 |
+
presented, which defaults to a second.
|
| 883 |
+
|
| 884 |
+
>>> format_timedelta(timedelta(hours=3), granularity='day', locale='en_US')
|
| 885 |
+
u'1 day'
|
| 886 |
+
|
| 887 |
+
The threshold parameter can be used to determine at which value the
|
| 888 |
+
presentation switches to the next higher unit. A higher threshold factor
|
| 889 |
+
means the presentation will switch later. For example:
|
| 890 |
+
|
| 891 |
+
>>> format_timedelta(timedelta(hours=23), threshold=0.9, locale='en_US')
|
| 892 |
+
u'1 day'
|
| 893 |
+
>>> format_timedelta(timedelta(hours=23), threshold=1.1, locale='en_US')
|
| 894 |
+
u'23 hours'
|
| 895 |
+
|
| 896 |
+
In addition directional information can be provided that informs
|
| 897 |
+
the user if the date is in the past or in the future:
|
| 898 |
+
|
| 899 |
+
>>> format_timedelta(timedelta(hours=1), add_direction=True, locale='en')
|
| 900 |
+
u'in 1 hour'
|
| 901 |
+
>>> format_timedelta(timedelta(hours=-1), add_direction=True, locale='en')
|
| 902 |
+
u'1 hour ago'
|
| 903 |
+
|
| 904 |
+
The format parameter controls how compact or wide the presentation is:
|
| 905 |
+
|
| 906 |
+
>>> format_timedelta(timedelta(hours=3), format='short', locale='en')
|
| 907 |
+
u'3 hr'
|
| 908 |
+
>>> format_timedelta(timedelta(hours=3), format='narrow', locale='en')
|
| 909 |
+
u'3h'
|
| 910 |
+
|
| 911 |
+
:param delta: a ``timedelta`` object representing the time difference to
|
| 912 |
+
format, or the delta in seconds as an `int` value
|
| 913 |
+
:param granularity: determines the smallest unit that should be displayed,
|
| 914 |
+
the value can be one of "year", "month", "week", "day",
|
| 915 |
+
"hour", "minute" or "second"
|
| 916 |
+
:param threshold: factor that determines at which point the presentation
|
| 917 |
+
switches to the next higher unit
|
| 918 |
+
:param add_direction: if this flag is set to `True` the return value will
|
| 919 |
+
include directional information. For instance a
|
| 920 |
+
positive timedelta will include the information about
|
| 921 |
+
it being in the future, a negative will be information
|
| 922 |
+
about the value being in the past.
|
| 923 |
+
:param format: the format, can be "narrow", "short" or "long". (
|
| 924 |
+
"medium" is deprecated, currently converted to "long" to
|
| 925 |
+
maintain compatibility)
|
| 926 |
+
:param locale: a `Locale` object or a locale identifier
|
| 927 |
+
"""
|
| 928 |
+
if format not in ('narrow', 'short', 'medium', 'long'):
|
| 929 |
+
raise TypeError('Format must be one of "narrow", "short" or "long"')
|
| 930 |
+
if format == 'medium':
|
| 931 |
+
warnings.warn(
|
| 932 |
+
'"medium" value for format param of format_timedelta'
|
| 933 |
+
' is deprecated. Use "long" instead',
|
| 934 |
+
category=DeprecationWarning,
|
| 935 |
+
stacklevel=2,
|
| 936 |
+
)
|
| 937 |
+
format = 'long'
|
| 938 |
+
if isinstance(delta, datetime.timedelta):
|
| 939 |
+
seconds = int((delta.days * 86400) + delta.seconds)
|
| 940 |
+
else:
|
| 941 |
+
seconds = delta
|
| 942 |
+
locale = Locale.parse(locale)
|
| 943 |
+
|
| 944 |
+
def _iter_patterns(a_unit):
|
| 945 |
+
if add_direction:
|
| 946 |
+
unit_rel_patterns = locale._data['date_fields'][a_unit]
|
| 947 |
+
if seconds >= 0:
|
| 948 |
+
yield unit_rel_patterns['future']
|
| 949 |
+
else:
|
| 950 |
+
yield unit_rel_patterns['past']
|
| 951 |
+
a_unit = f"duration-{a_unit}"
|
| 952 |
+
unit_pats = locale._data['unit_patterns'].get(a_unit, {})
|
| 953 |
+
yield unit_pats.get(format)
|
| 954 |
+
# We do not support `<alias>` tags at all while ingesting CLDR data,
|
| 955 |
+
# so these aliases specified in `root.xml` are hard-coded here:
|
| 956 |
+
# <unitLength type="long"><alias source="locale" path="../unitLength[@type='short']"/></unitLength>
|
| 957 |
+
# <unitLength type="narrow"><alias source="locale" path="../unitLength[@type='short']"/></unitLength>
|
| 958 |
+
if format in ("long", "narrow"):
|
| 959 |
+
yield unit_pats.get("short")
|
| 960 |
+
|
| 961 |
+
for unit, secs_per_unit in TIMEDELTA_UNITS:
|
| 962 |
+
value = abs(seconds) / secs_per_unit
|
| 963 |
+
if value >= threshold or unit == granularity:
|
| 964 |
+
if unit == granularity and value > 0:
|
| 965 |
+
value = max(1, value)
|
| 966 |
+
value = int(round(value))
|
| 967 |
+
plural_form = locale.plural_form(value)
|
| 968 |
+
pattern = None
|
| 969 |
+
for patterns in _iter_patterns(unit):
|
| 970 |
+
if patterns is not None:
|
| 971 |
+
pattern = patterns.get(plural_form) or patterns.get('other')
|
| 972 |
+
if pattern:
|
| 973 |
+
break
|
| 974 |
+
# This really should not happen
|
| 975 |
+
if pattern is None:
|
| 976 |
+
return ''
|
| 977 |
+
return pattern.replace('{0}', str(value))
|
| 978 |
+
|
| 979 |
+
return ''
|
| 980 |
+
|
| 981 |
+
|
| 982 |
+
def _format_fallback_interval(
|
| 983 |
+
start: _Instant,
|
| 984 |
+
end: _Instant,
|
| 985 |
+
skeleton: str | None,
|
| 986 |
+
tzinfo: datetime.tzinfo | None,
|
| 987 |
+
locale: Locale | str | None = LC_TIME,
|
| 988 |
+
) -> str:
|
| 989 |
+
if skeleton in locale.datetime_skeletons: # Use the given skeleton
|
| 990 |
+
format = lambda dt: format_skeleton(skeleton, dt, tzinfo, locale=locale)
|
| 991 |
+
elif all((isinstance(d, datetime.date) and not isinstance(d, datetime.datetime)) for d in (start, end)): # Both are just dates
|
| 992 |
+
format = lambda dt: format_date(dt, locale=locale)
|
| 993 |
+
elif all((isinstance(d, datetime.time) and not isinstance(d, datetime.date)) for d in (start, end)): # Both are times
|
| 994 |
+
format = lambda dt: format_time(dt, tzinfo=tzinfo, locale=locale)
|
| 995 |
+
else:
|
| 996 |
+
format = lambda dt: format_datetime(dt, tzinfo=tzinfo, locale=locale)
|
| 997 |
+
|
| 998 |
+
formatted_start = format(start)
|
| 999 |
+
formatted_end = format(end)
|
| 1000 |
+
|
| 1001 |
+
if formatted_start == formatted_end:
|
| 1002 |
+
return format(start)
|
| 1003 |
+
|
| 1004 |
+
return (
|
| 1005 |
+
locale.interval_formats.get(None, "{0}-{1}").
|
| 1006 |
+
replace("{0}", formatted_start).
|
| 1007 |
+
replace("{1}", formatted_end)
|
| 1008 |
+
)
|
| 1009 |
+
|
| 1010 |
+
|
| 1011 |
+
def format_interval(
|
| 1012 |
+
start: _Instant,
|
| 1013 |
+
end: _Instant,
|
| 1014 |
+
skeleton: str | None = None,
|
| 1015 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 1016 |
+
fuzzy: bool = True,
|
| 1017 |
+
locale: Locale | str | None = LC_TIME,
|
| 1018 |
+
) -> str:
|
| 1019 |
+
"""
|
| 1020 |
+
Format an interval between two instants according to the locale's rules.
|
| 1021 |
+
|
| 1022 |
+
>>> from datetime import date, time
|
| 1023 |
+
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "yMd", locale="fi")
|
| 1024 |
+
u'15.\u201317.1.2016'
|
| 1025 |
+
|
| 1026 |
+
>>> format_interval(time(12, 12), time(16, 16), "Hm", locale="en_GB")
|
| 1027 |
+
'12:12\u201316:16'
|
| 1028 |
+
|
| 1029 |
+
>>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US")
|
| 1030 |
+
'5:12\u202fAM\u2009–\u20094:16\u202fPM'
|
| 1031 |
+
|
| 1032 |
+
>>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it")
|
| 1033 |
+
'16:18\u201316:24'
|
| 1034 |
+
|
| 1035 |
+
If the start instant equals the end instant, the interval is formatted like the instant.
|
| 1036 |
+
|
| 1037 |
+
>>> format_interval(time(16, 18), time(16, 18), "Hm", locale="it")
|
| 1038 |
+
'16:18'
|
| 1039 |
+
|
| 1040 |
+
Unknown skeletons fall back to "default" formatting.
|
| 1041 |
+
|
| 1042 |
+
>>> format_interval(date(2015, 1, 1), date(2017, 1, 1), "wzq", locale="ja")
|
| 1043 |
+
'2015/01/01\uff5e2017/01/01'
|
| 1044 |
+
|
| 1045 |
+
>>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja")
|
| 1046 |
+
'16:18:00\uff5e16:24:00'
|
| 1047 |
+
|
| 1048 |
+
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de")
|
| 1049 |
+
'15.01.2016\u2009–\u200917.01.2016'
|
| 1050 |
+
|
| 1051 |
+
:param start: First instant (datetime/date/time)
|
| 1052 |
+
:param end: Second instant (datetime/date/time)
|
| 1053 |
+
:param skeleton: The "skeleton format" to use for formatting.
|
| 1054 |
+
:param tzinfo: tzinfo to use (if none is already attached)
|
| 1055 |
+
:param fuzzy: If the skeleton is not found, allow choosing a skeleton that's
|
| 1056 |
+
close enough to it.
|
| 1057 |
+
:param locale: A locale object or identifier.
|
| 1058 |
+
:return: Formatted interval
|
| 1059 |
+
"""
|
| 1060 |
+
locale = Locale.parse(locale)
|
| 1061 |
+
|
| 1062 |
+
# NB: The quote comments below are from the algorithm description in
|
| 1063 |
+
# https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats
|
| 1064 |
+
|
| 1065 |
+
# > Look for the intervalFormatItem element that matches the "skeleton",
|
| 1066 |
+
# > starting in the current locale and then following the locale fallback
|
| 1067 |
+
# > chain up to, but not including root.
|
| 1068 |
+
|
| 1069 |
+
interval_formats = locale.interval_formats
|
| 1070 |
+
|
| 1071 |
+
if skeleton not in interval_formats or not skeleton:
|
| 1072 |
+
# > If no match was found from the previous step, check what the closest
|
| 1073 |
+
# > match is in the fallback locale chain, as in availableFormats. That
|
| 1074 |
+
# > is, this allows for adjusting the string value field's width,
|
| 1075 |
+
# > including adjusting between "MMM" and "MMMM", and using different
|
| 1076 |
+
# > variants of the same field, such as 'v' and 'z'.
|
| 1077 |
+
if skeleton and fuzzy:
|
| 1078 |
+
skeleton = match_skeleton(skeleton, interval_formats)
|
| 1079 |
+
else:
|
| 1080 |
+
skeleton = None
|
| 1081 |
+
if not skeleton: # Still no match whatsoever?
|
| 1082 |
+
# > Otherwise, format the start and end datetime using the fallback pattern.
|
| 1083 |
+
return _format_fallback_interval(start, end, skeleton, tzinfo, locale)
|
| 1084 |
+
|
| 1085 |
+
skel_formats = interval_formats[skeleton]
|
| 1086 |
+
|
| 1087 |
+
if start == end:
|
| 1088 |
+
return format_skeleton(skeleton, start, tzinfo, fuzzy=fuzzy, locale=locale)
|
| 1089 |
+
|
| 1090 |
+
start = _ensure_datetime_tzinfo(_get_datetime(start), tzinfo=tzinfo)
|
| 1091 |
+
end = _ensure_datetime_tzinfo(_get_datetime(end), tzinfo=tzinfo)
|
| 1092 |
+
|
| 1093 |
+
start_fmt = DateTimeFormat(start, locale=locale)
|
| 1094 |
+
end_fmt = DateTimeFormat(end, locale=locale)
|
| 1095 |
+
|
| 1096 |
+
# > If a match is found from previous steps, compute the calendar field
|
| 1097 |
+
# > with the greatest difference between start and end datetime. If there
|
| 1098 |
+
# > is no difference among any of the fields in the pattern, format as a
|
| 1099 |
+
# > single date using availableFormats, and return.
|
| 1100 |
+
|
| 1101 |
+
for field in PATTERN_CHAR_ORDER: # These are in largest-to-smallest order
|
| 1102 |
+
if field in skel_formats and start_fmt.extract(field) != end_fmt.extract(field):
|
| 1103 |
+
# > If there is a match, use the pieces of the corresponding pattern to
|
| 1104 |
+
# > format the start and end datetime, as above.
|
| 1105 |
+
return "".join(
|
| 1106 |
+
parse_pattern(pattern).apply(instant, locale)
|
| 1107 |
+
for pattern, instant
|
| 1108 |
+
in zip(skel_formats[field], (start, end))
|
| 1109 |
+
)
|
| 1110 |
+
|
| 1111 |
+
# > Otherwise, format the start and end datetime using the fallback pattern.
|
| 1112 |
+
|
| 1113 |
+
return _format_fallback_interval(start, end, skeleton, tzinfo, locale)
|
| 1114 |
+
|
| 1115 |
+
|
| 1116 |
+
def get_period_id(
|
| 1117 |
+
time: _Instant,
|
| 1118 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 1119 |
+
type: Literal['selection'] | None = None,
|
| 1120 |
+
locale: Locale | str | None = LC_TIME,
|
| 1121 |
+
) -> str:
|
| 1122 |
+
"""
|
| 1123 |
+
Get the day period ID for a given time.
|
| 1124 |
+
|
| 1125 |
+
This ID can be used as a key for the period name dictionary.
|
| 1126 |
+
|
| 1127 |
+
>>> from datetime import time
|
| 1128 |
+
>>> get_period_names(locale="de")[get_period_id(time(7, 42), locale="de")]
|
| 1129 |
+
u'Morgen'
|
| 1130 |
+
|
| 1131 |
+
>>> get_period_id(time(0), locale="en_US")
|
| 1132 |
+
u'midnight'
|
| 1133 |
+
|
| 1134 |
+
>>> get_period_id(time(0), type="selection", locale="en_US")
|
| 1135 |
+
u'night1'
|
| 1136 |
+
|
| 1137 |
+
:param time: The time to inspect.
|
| 1138 |
+
:param tzinfo: The timezone for the time. See ``format_time``.
|
| 1139 |
+
:param type: The period type to use. Either "selection" or None.
|
| 1140 |
+
The selection type is used for selecting among phrases such as
|
| 1141 |
+
“Your email arrived yesterday evening” or “Your email arrived last night”.
|
| 1142 |
+
:param locale: the `Locale` object, or a locale string
|
| 1143 |
+
:return: period ID. Something is always returned -- even if it's just "am" or "pm".
|
| 1144 |
+
"""
|
| 1145 |
+
time = _get_time(time, tzinfo)
|
| 1146 |
+
seconds_past_midnight = int(time.hour * 60 * 60 + time.minute * 60 + time.second)
|
| 1147 |
+
locale = Locale.parse(locale)
|
| 1148 |
+
|
| 1149 |
+
# The LDML rules state that the rules may not overlap, so iterating in arbitrary
|
| 1150 |
+
# order should be alright, though `at` periods should be preferred.
|
| 1151 |
+
rulesets = locale.day_period_rules.get(type, {}).items()
|
| 1152 |
+
|
| 1153 |
+
for rule_id, rules in rulesets:
|
| 1154 |
+
for rule in rules:
|
| 1155 |
+
if "at" in rule and rule["at"] == seconds_past_midnight:
|
| 1156 |
+
return rule_id
|
| 1157 |
+
|
| 1158 |
+
for rule_id, rules in rulesets:
|
| 1159 |
+
for rule in rules:
|
| 1160 |
+
if "from" in rule and "before" in rule:
|
| 1161 |
+
if rule["from"] < rule["before"]:
|
| 1162 |
+
if rule["from"] <= seconds_past_midnight < rule["before"]:
|
| 1163 |
+
return rule_id
|
| 1164 |
+
else:
|
| 1165 |
+
# e.g. from="21:00" before="06:00"
|
| 1166 |
+
if rule["from"] <= seconds_past_midnight < 86400 or \
|
| 1167 |
+
0 <= seconds_past_midnight < rule["before"]:
|
| 1168 |
+
return rule_id
|
| 1169 |
+
|
| 1170 |
+
start_ok = end_ok = False
|
| 1171 |
+
|
| 1172 |
+
if "from" in rule and seconds_past_midnight >= rule["from"]:
|
| 1173 |
+
start_ok = True
|
| 1174 |
+
if "to" in rule and seconds_past_midnight <= rule["to"]:
|
| 1175 |
+
# This rule type does not exist in the present CLDR data;
|
| 1176 |
+
# excuse the lack of test coverage.
|
| 1177 |
+
end_ok = True
|
| 1178 |
+
if "before" in rule and seconds_past_midnight < rule["before"]:
|
| 1179 |
+
end_ok = True
|
| 1180 |
+
if "after" in rule:
|
| 1181 |
+
raise NotImplementedError("'after' is deprecated as of CLDR 29.")
|
| 1182 |
+
|
| 1183 |
+
if start_ok and end_ok:
|
| 1184 |
+
return rule_id
|
| 1185 |
+
|
| 1186 |
+
if seconds_past_midnight < 43200:
|
| 1187 |
+
return "am"
|
| 1188 |
+
else:
|
| 1189 |
+
return "pm"
|
| 1190 |
+
|
| 1191 |
+
|
| 1192 |
+
class ParseError(ValueError):
|
| 1193 |
+
pass
|
| 1194 |
+
|
| 1195 |
+
|
| 1196 |
+
def parse_date(
|
| 1197 |
+
string: str,
|
| 1198 |
+
locale: Locale | str | None = LC_TIME,
|
| 1199 |
+
format: _PredefinedTimeFormat = 'medium',
|
| 1200 |
+
) -> datetime.date:
|
| 1201 |
+
"""Parse a date from a string.
|
| 1202 |
+
|
| 1203 |
+
This function first tries to interpret the string as ISO-8601
|
| 1204 |
+
date format, then uses the date format for the locale as a hint to
|
| 1205 |
+
determine the order in which the date fields appear in the string.
|
| 1206 |
+
|
| 1207 |
+
>>> parse_date('4/1/04', locale='en_US')
|
| 1208 |
+
datetime.date(2004, 4, 1)
|
| 1209 |
+
>>> parse_date('01.04.2004', locale='de_DE')
|
| 1210 |
+
datetime.date(2004, 4, 1)
|
| 1211 |
+
>>> parse_date('2004-04-01', locale='en_US')
|
| 1212 |
+
datetime.date(2004, 4, 1)
|
| 1213 |
+
>>> parse_date('2004-04-01', locale='de_DE')
|
| 1214 |
+
datetime.date(2004, 4, 1)
|
| 1215 |
+
|
| 1216 |
+
:param string: the string containing the date
|
| 1217 |
+
:param locale: a `Locale` object or a locale identifier
|
| 1218 |
+
:param format: the format to use (see ``get_date_format``)
|
| 1219 |
+
"""
|
| 1220 |
+
numbers = re.findall(r'(\d+)', string)
|
| 1221 |
+
if not numbers:
|
| 1222 |
+
raise ParseError("No numbers were found in input")
|
| 1223 |
+
|
| 1224 |
+
# we try ISO-8601 format first, meaning similar to formats
|
| 1225 |
+
# extended YYYY-MM-DD or basic YYYYMMDD
|
| 1226 |
+
iso_alike = re.match(r'^(\d{4})-?([01]\d)-?([0-3]\d)$',
|
| 1227 |
+
string, flags=re.ASCII) # allow only ASCII digits
|
| 1228 |
+
if iso_alike:
|
| 1229 |
+
try:
|
| 1230 |
+
return datetime.date(*map(int, iso_alike.groups()))
|
| 1231 |
+
except ValueError:
|
| 1232 |
+
pass # a locale format might fit better, so let's continue
|
| 1233 |
+
|
| 1234 |
+
format_str = get_date_format(format=format, locale=locale).pattern.lower()
|
| 1235 |
+
year_idx = format_str.index('y')
|
| 1236 |
+
month_idx = format_str.find('m')
|
| 1237 |
+
if month_idx < 0:
|
| 1238 |
+
month_idx = format_str.index('l')
|
| 1239 |
+
day_idx = format_str.index('d')
|
| 1240 |
+
|
| 1241 |
+
indexes = sorted([(year_idx, 'Y'), (month_idx, 'M'), (day_idx, 'D')])
|
| 1242 |
+
indexes = {item[1]: idx for idx, item in enumerate(indexes)}
|
| 1243 |
+
|
| 1244 |
+
# FIXME: this currently only supports numbers, but should also support month
|
| 1245 |
+
# names, both in the requested locale, and english
|
| 1246 |
+
|
| 1247 |
+
year = numbers[indexes['Y']]
|
| 1248 |
+
year = 2000 + int(year) if len(year) == 2 else int(year)
|
| 1249 |
+
month = int(numbers[indexes['M']])
|
| 1250 |
+
day = int(numbers[indexes['D']])
|
| 1251 |
+
if month > 12:
|
| 1252 |
+
month, day = day, month
|
| 1253 |
+
return datetime.date(year, month, day)
|
| 1254 |
+
|
| 1255 |
+
|
| 1256 |
+
def parse_time(
|
| 1257 |
+
string: str,
|
| 1258 |
+
locale: Locale | str | None = LC_TIME,
|
| 1259 |
+
format: _PredefinedTimeFormat = 'medium',
|
| 1260 |
+
) -> datetime.time:
|
| 1261 |
+
"""Parse a time from a string.
|
| 1262 |
+
|
| 1263 |
+
This function uses the time format for the locale as a hint to determine
|
| 1264 |
+
the order in which the time fields appear in the string.
|
| 1265 |
+
|
| 1266 |
+
>>> parse_time('15:30:00', locale='en_US')
|
| 1267 |
+
datetime.time(15, 30)
|
| 1268 |
+
|
| 1269 |
+
:param string: the string containing the time
|
| 1270 |
+
:param locale: a `Locale` object or a locale identifier
|
| 1271 |
+
:param format: the format to use (see ``get_time_format``)
|
| 1272 |
+
:return: the parsed time
|
| 1273 |
+
:rtype: `time`
|
| 1274 |
+
"""
|
| 1275 |
+
numbers = re.findall(r'(\d+)', string)
|
| 1276 |
+
if not numbers:
|
| 1277 |
+
raise ParseError("No numbers were found in input")
|
| 1278 |
+
|
| 1279 |
+
# TODO: try ISO format first?
|
| 1280 |
+
format_str = get_time_format(format=format, locale=locale).pattern.lower()
|
| 1281 |
+
hour_idx = format_str.find('h')
|
| 1282 |
+
if hour_idx < 0:
|
| 1283 |
+
hour_idx = format_str.index('k')
|
| 1284 |
+
min_idx = format_str.index('m')
|
| 1285 |
+
# format might not contain seconds
|
| 1286 |
+
if (sec_idx := format_str.find('s')) < 0:
|
| 1287 |
+
sec_idx = math.inf
|
| 1288 |
+
|
| 1289 |
+
indexes = sorted([(hour_idx, 'H'), (min_idx, 'M'), (sec_idx, 'S')])
|
| 1290 |
+
indexes = {item[1]: idx for idx, item in enumerate(indexes)}
|
| 1291 |
+
|
| 1292 |
+
# TODO: support time zones
|
| 1293 |
+
|
| 1294 |
+
# Check if the format specifies a period to be used;
|
| 1295 |
+
# if it does, look for 'pm' to figure out an offset.
|
| 1296 |
+
hour_offset = 0
|
| 1297 |
+
if 'a' in format_str and 'pm' in string.lower():
|
| 1298 |
+
hour_offset = 12
|
| 1299 |
+
|
| 1300 |
+
# Parse up to three numbers from the string.
|
| 1301 |
+
minute = second = 0
|
| 1302 |
+
hour = int(numbers[indexes['H']]) + hour_offset
|
| 1303 |
+
if len(numbers) > 1:
|
| 1304 |
+
minute = int(numbers[indexes['M']])
|
| 1305 |
+
if len(numbers) > 2:
|
| 1306 |
+
second = int(numbers[indexes['S']])
|
| 1307 |
+
return datetime.time(hour, minute, second)
|
| 1308 |
+
|
| 1309 |
+
|
| 1310 |
+
class DateTimePattern:
|
| 1311 |
+
|
| 1312 |
+
def __init__(self, pattern: str, format: DateTimeFormat):
|
| 1313 |
+
self.pattern = pattern
|
| 1314 |
+
self.format = format
|
| 1315 |
+
|
| 1316 |
+
def __repr__(self) -> str:
|
| 1317 |
+
return f"<{type(self).__name__} {self.pattern!r}>"
|
| 1318 |
+
|
| 1319 |
+
def __str__(self) -> str:
|
| 1320 |
+
pat = self.pattern
|
| 1321 |
+
return pat
|
| 1322 |
+
|
| 1323 |
+
def __mod__(self, other: DateTimeFormat) -> str:
|
| 1324 |
+
if not isinstance(other, DateTimeFormat):
|
| 1325 |
+
return NotImplemented
|
| 1326 |
+
return self.format % other
|
| 1327 |
+
|
| 1328 |
+
def apply(
|
| 1329 |
+
self,
|
| 1330 |
+
datetime: datetime.date | datetime.time,
|
| 1331 |
+
locale: Locale | str | None,
|
| 1332 |
+
reference_date: datetime.date | None = None,
|
| 1333 |
+
) -> str:
|
| 1334 |
+
return self % DateTimeFormat(datetime, locale, reference_date)
|
| 1335 |
+
|
| 1336 |
+
|
| 1337 |
+
class DateTimeFormat:
|
| 1338 |
+
|
| 1339 |
+
def __init__(
|
| 1340 |
+
self,
|
| 1341 |
+
value: datetime.date | datetime.time,
|
| 1342 |
+
locale: Locale | str,
|
| 1343 |
+
reference_date: datetime.date | None = None,
|
| 1344 |
+
) -> None:
|
| 1345 |
+
assert isinstance(value, (datetime.date, datetime.datetime, datetime.time))
|
| 1346 |
+
if isinstance(value, (datetime.datetime, datetime.time)) and value.tzinfo is None:
|
| 1347 |
+
value = value.replace(tzinfo=UTC)
|
| 1348 |
+
self.value = value
|
| 1349 |
+
self.locale = Locale.parse(locale)
|
| 1350 |
+
self.reference_date = reference_date
|
| 1351 |
+
|
| 1352 |
+
def __getitem__(self, name: str) -> str:
|
| 1353 |
+
char = name[0]
|
| 1354 |
+
num = len(name)
|
| 1355 |
+
if char == 'G':
|
| 1356 |
+
return self.format_era(char, num)
|
| 1357 |
+
elif char in ('y', 'Y', 'u'):
|
| 1358 |
+
return self.format_year(char, num)
|
| 1359 |
+
elif char in ('Q', 'q'):
|
| 1360 |
+
return self.format_quarter(char, num)
|
| 1361 |
+
elif char in ('M', 'L'):
|
| 1362 |
+
return self.format_month(char, num)
|
| 1363 |
+
elif char in ('w', 'W'):
|
| 1364 |
+
return self.format_week(char, num)
|
| 1365 |
+
elif char == 'd':
|
| 1366 |
+
return self.format(self.value.day, num)
|
| 1367 |
+
elif char == 'D':
|
| 1368 |
+
return self.format_day_of_year(num)
|
| 1369 |
+
elif char == 'F':
|
| 1370 |
+
return self.format_day_of_week_in_month()
|
| 1371 |
+
elif char in ('E', 'e', 'c'):
|
| 1372 |
+
return self.format_weekday(char, num)
|
| 1373 |
+
elif char in ('a', 'b', 'B'):
|
| 1374 |
+
return self.format_period(char, num)
|
| 1375 |
+
elif char == 'h':
|
| 1376 |
+
if self.value.hour % 12 == 0:
|
| 1377 |
+
return self.format(12, num)
|
| 1378 |
+
else:
|
| 1379 |
+
return self.format(self.value.hour % 12, num)
|
| 1380 |
+
elif char == 'H':
|
| 1381 |
+
return self.format(self.value.hour, num)
|
| 1382 |
+
elif char == 'K':
|
| 1383 |
+
return self.format(self.value.hour % 12, num)
|
| 1384 |
+
elif char == 'k':
|
| 1385 |
+
if self.value.hour == 0:
|
| 1386 |
+
return self.format(24, num)
|
| 1387 |
+
else:
|
| 1388 |
+
return self.format(self.value.hour, num)
|
| 1389 |
+
elif char == 'm':
|
| 1390 |
+
return self.format(self.value.minute, num)
|
| 1391 |
+
elif char == 's':
|
| 1392 |
+
return self.format(self.value.second, num)
|
| 1393 |
+
elif char == 'S':
|
| 1394 |
+
return self.format_frac_seconds(num)
|
| 1395 |
+
elif char == 'A':
|
| 1396 |
+
return self.format_milliseconds_in_day(num)
|
| 1397 |
+
elif char in ('z', 'Z', 'v', 'V', 'x', 'X', 'O'):
|
| 1398 |
+
return self.format_timezone(char, num)
|
| 1399 |
+
else:
|
| 1400 |
+
raise KeyError(f"Unsupported date/time field {char!r}")
|
| 1401 |
+
|
| 1402 |
+
def extract(self, char: str) -> int:
|
| 1403 |
+
char = str(char)[0]
|
| 1404 |
+
if char == 'y':
|
| 1405 |
+
return self.value.year
|
| 1406 |
+
elif char == 'M':
|
| 1407 |
+
return self.value.month
|
| 1408 |
+
elif char == 'd':
|
| 1409 |
+
return self.value.day
|
| 1410 |
+
elif char == 'H':
|
| 1411 |
+
return self.value.hour
|
| 1412 |
+
elif char == 'h':
|
| 1413 |
+
return self.value.hour % 12 or 12
|
| 1414 |
+
elif char == 'm':
|
| 1415 |
+
return self.value.minute
|
| 1416 |
+
elif char == 'a':
|
| 1417 |
+
return int(self.value.hour >= 12) # 0 for am, 1 for pm
|
| 1418 |
+
else:
|
| 1419 |
+
raise NotImplementedError(f"Not implemented: extracting {char!r} from {self.value!r}")
|
| 1420 |
+
|
| 1421 |
+
def format_era(self, char: str, num: int) -> str:
|
| 1422 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)]
|
| 1423 |
+
era = int(self.value.year >= 0)
|
| 1424 |
+
return get_era_names(width, self.locale)[era]
|
| 1425 |
+
|
| 1426 |
+
def format_year(self, char: str, num: int) -> str:
|
| 1427 |
+
value = self.value.year
|
| 1428 |
+
if char.isupper():
|
| 1429 |
+
value = self.value.isocalendar()[0]
|
| 1430 |
+
year = self.format(value, num)
|
| 1431 |
+
if num == 2:
|
| 1432 |
+
year = year[-2:]
|
| 1433 |
+
return year
|
| 1434 |
+
|
| 1435 |
+
def format_quarter(self, char: str, num: int) -> str:
|
| 1436 |
+
quarter = (self.value.month - 1) // 3 + 1
|
| 1437 |
+
if num <= 2:
|
| 1438 |
+
return '%0*d' % (num, quarter)
|
| 1439 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num]
|
| 1440 |
+
context = {'Q': 'format', 'q': 'stand-alone'}[char]
|
| 1441 |
+
return get_quarter_names(width, context, self.locale)[quarter]
|
| 1442 |
+
|
| 1443 |
+
def format_month(self, char: str, num: int) -> str:
|
| 1444 |
+
if num <= 2:
|
| 1445 |
+
return '%0*d' % (num, self.value.month)
|
| 1446 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num]
|
| 1447 |
+
context = {'M': 'format', 'L': 'stand-alone'}[char]
|
| 1448 |
+
return get_month_names(width, context, self.locale)[self.value.month]
|
| 1449 |
+
|
| 1450 |
+
def format_week(self, char: str, num: int) -> str:
|
| 1451 |
+
if char.islower(): # week of year
|
| 1452 |
+
day_of_year = self.get_day_of_year()
|
| 1453 |
+
week = self.get_week_number(day_of_year)
|
| 1454 |
+
if week == 0:
|
| 1455 |
+
date = self.value - datetime.timedelta(days=day_of_year)
|
| 1456 |
+
week = self.get_week_number(self.get_day_of_year(date),
|
| 1457 |
+
date.weekday())
|
| 1458 |
+
return self.format(week, num)
|
| 1459 |
+
else: # week of month
|
| 1460 |
+
week = self.get_week_number(self.value.day)
|
| 1461 |
+
if week == 0:
|
| 1462 |
+
date = self.value - datetime.timedelta(days=self.value.day)
|
| 1463 |
+
week = self.get_week_number(date.day, date.weekday())
|
| 1464 |
+
return str(week)
|
| 1465 |
+
|
| 1466 |
+
def format_weekday(self, char: str = 'E', num: int = 4) -> str:
|
| 1467 |
+
"""
|
| 1468 |
+
Return weekday from parsed datetime according to format pattern.
|
| 1469 |
+
|
| 1470 |
+
>>> from datetime import date
|
| 1471 |
+
>>> format = DateTimeFormat(date(2016, 2, 28), Locale.parse('en_US'))
|
| 1472 |
+
>>> format.format_weekday()
|
| 1473 |
+
u'Sunday'
|
| 1474 |
+
|
| 1475 |
+
'E': Day of week - Use one through three letters for the abbreviated day name, four for the full (wide) name,
|
| 1476 |
+
five for the narrow name, or six for the short name.
|
| 1477 |
+
>>> format.format_weekday('E',2)
|
| 1478 |
+
u'Sun'
|
| 1479 |
+
|
| 1480 |
+
'e': Local day of week. Same as E except adds a numeric value that will depend on the local starting day of the
|
| 1481 |
+
week, using one or two letters. For this example, Monday is the first day of the week.
|
| 1482 |
+
>>> format.format_weekday('e',2)
|
| 1483 |
+
'01'
|
| 1484 |
+
|
| 1485 |
+
'c': Stand-Alone local day of week - Use one letter for the local numeric value (same as 'e'), three for the
|
| 1486 |
+
abbreviated day name, four for the full (wide) name, five for the narrow name, or six for the short name.
|
| 1487 |
+
>>> format.format_weekday('c',1)
|
| 1488 |
+
'1'
|
| 1489 |
+
|
| 1490 |
+
:param char: pattern format character ('e','E','c')
|
| 1491 |
+
:param num: count of format character
|
| 1492 |
+
|
| 1493 |
+
"""
|
| 1494 |
+
if num < 3:
|
| 1495 |
+
if char.islower():
|
| 1496 |
+
value = 7 - self.locale.first_week_day + self.value.weekday()
|
| 1497 |
+
return self.format(value % 7 + 1, num)
|
| 1498 |
+
num = 3
|
| 1499 |
+
weekday = self.value.weekday()
|
| 1500 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow', 6: 'short'}[num]
|
| 1501 |
+
context = "stand-alone" if char == "c" else "format"
|
| 1502 |
+
return get_day_names(width, context, self.locale)[weekday]
|
| 1503 |
+
|
| 1504 |
+
def format_day_of_year(self, num: int) -> str:
|
| 1505 |
+
return self.format(self.get_day_of_year(), num)
|
| 1506 |
+
|
| 1507 |
+
def format_day_of_week_in_month(self) -> str:
|
| 1508 |
+
return str((self.value.day - 1) // 7 + 1)
|
| 1509 |
+
|
| 1510 |
+
def format_period(self, char: str, num: int) -> str:
|
| 1511 |
+
"""
|
| 1512 |
+
Return period from parsed datetime according to format pattern.
|
| 1513 |
+
|
| 1514 |
+
>>> from datetime import datetime, time
|
| 1515 |
+
>>> format = DateTimeFormat(time(13, 42), 'fi_FI')
|
| 1516 |
+
>>> format.format_period('a', 1)
|
| 1517 |
+
u'ip.'
|
| 1518 |
+
>>> format.format_period('b', 1)
|
| 1519 |
+
u'iltap.'
|
| 1520 |
+
>>> format.format_period('b', 4)
|
| 1521 |
+
u'iltapäivä'
|
| 1522 |
+
>>> format.format_period('B', 4)
|
| 1523 |
+
u'iltapäivällä'
|
| 1524 |
+
>>> format.format_period('B', 5)
|
| 1525 |
+
u'ip.'
|
| 1526 |
+
|
| 1527 |
+
>>> format = DateTimeFormat(datetime(2022, 4, 28, 6, 27), 'zh_Hant')
|
| 1528 |
+
>>> format.format_period('a', 1)
|
| 1529 |
+
u'上午'
|
| 1530 |
+
>>> format.format_period('B', 1)
|
| 1531 |
+
u'清晨'
|
| 1532 |
+
|
| 1533 |
+
:param char: pattern format character ('a', 'b', 'B')
|
| 1534 |
+
:param num: count of format character
|
| 1535 |
+
|
| 1536 |
+
"""
|
| 1537 |
+
widths = [{3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)],
|
| 1538 |
+
'wide', 'narrow', 'abbreviated']
|
| 1539 |
+
if char == 'a':
|
| 1540 |
+
period = 'pm' if self.value.hour >= 12 else 'am'
|
| 1541 |
+
context = 'format'
|
| 1542 |
+
else:
|
| 1543 |
+
period = get_period_id(self.value, locale=self.locale)
|
| 1544 |
+
context = 'format' if char == 'B' else 'stand-alone'
|
| 1545 |
+
for width in widths:
|
| 1546 |
+
period_names = get_period_names(context=context, width=width, locale=self.locale)
|
| 1547 |
+
if period in period_names:
|
| 1548 |
+
return period_names[period]
|
| 1549 |
+
raise ValueError(f"Could not format period {period} in {self.locale}")
|
| 1550 |
+
|
| 1551 |
+
def format_frac_seconds(self, num: int) -> str:
|
| 1552 |
+
""" Return fractional seconds.
|
| 1553 |
+
|
| 1554 |
+
Rounds the time's microseconds to the precision given by the number \
|
| 1555 |
+
of digits passed in.
|
| 1556 |
+
"""
|
| 1557 |
+
value = self.value.microsecond / 1000000
|
| 1558 |
+
return self.format(round(value, num) * 10**num, num)
|
| 1559 |
+
|
| 1560 |
+
def format_milliseconds_in_day(self, num):
|
| 1561 |
+
msecs = self.value.microsecond // 1000 + self.value.second * 1000 + \
|
| 1562 |
+
self.value.minute * 60000 + self.value.hour * 3600000
|
| 1563 |
+
return self.format(msecs, num)
|
| 1564 |
+
|
| 1565 |
+
def format_timezone(self, char: str, num: int) -> str:
|
| 1566 |
+
width = {3: 'short', 4: 'long', 5: 'iso8601'}[max(3, num)]
|
| 1567 |
+
|
| 1568 |
+
# It could be that we only receive a time to format, but also have a
|
| 1569 |
+
# reference date which is important to distinguish between timezone
|
| 1570 |
+
# variants (summer/standard time)
|
| 1571 |
+
value = self.value
|
| 1572 |
+
if self.reference_date:
|
| 1573 |
+
value = datetime.datetime.combine(self.reference_date, self.value)
|
| 1574 |
+
|
| 1575 |
+
if char == 'z':
|
| 1576 |
+
return get_timezone_name(value, width, locale=self.locale)
|
| 1577 |
+
elif char == 'Z':
|
| 1578 |
+
if num == 5:
|
| 1579 |
+
return get_timezone_gmt(value, width, locale=self.locale, return_z=True)
|
| 1580 |
+
return get_timezone_gmt(value, width, locale=self.locale)
|
| 1581 |
+
elif char == 'O':
|
| 1582 |
+
if num == 4:
|
| 1583 |
+
return get_timezone_gmt(value, width, locale=self.locale)
|
| 1584 |
+
# TODO: To add support for O:1
|
| 1585 |
+
elif char == 'v':
|
| 1586 |
+
return get_timezone_name(value.tzinfo, width,
|
| 1587 |
+
locale=self.locale)
|
| 1588 |
+
elif char == 'V':
|
| 1589 |
+
if num == 1:
|
| 1590 |
+
return get_timezone_name(value.tzinfo, width,
|
| 1591 |
+
uncommon=True, locale=self.locale)
|
| 1592 |
+
elif num == 2:
|
| 1593 |
+
return get_timezone_name(value.tzinfo, locale=self.locale, return_zone=True)
|
| 1594 |
+
elif num == 3:
|
| 1595 |
+
return get_timezone_location(value.tzinfo, locale=self.locale, return_city=True)
|
| 1596 |
+
return get_timezone_location(value.tzinfo, locale=self.locale)
|
| 1597 |
+
# Included additional elif condition to add support for 'Xx' in timezone format
|
| 1598 |
+
elif char == 'X':
|
| 1599 |
+
if num == 1:
|
| 1600 |
+
return get_timezone_gmt(value, width='iso8601_short', locale=self.locale,
|
| 1601 |
+
return_z=True)
|
| 1602 |
+
elif num in (2, 4):
|
| 1603 |
+
return get_timezone_gmt(value, width='short', locale=self.locale,
|
| 1604 |
+
return_z=True)
|
| 1605 |
+
elif num in (3, 5):
|
| 1606 |
+
return get_timezone_gmt(value, width='iso8601', locale=self.locale,
|
| 1607 |
+
return_z=True)
|
| 1608 |
+
elif char == 'x':
|
| 1609 |
+
if num == 1:
|
| 1610 |
+
return get_timezone_gmt(value, width='iso8601_short', locale=self.locale)
|
| 1611 |
+
elif num in (2, 4):
|
| 1612 |
+
return get_timezone_gmt(value, width='short', locale=self.locale)
|
| 1613 |
+
elif num in (3, 5):
|
| 1614 |
+
return get_timezone_gmt(value, width='iso8601', locale=self.locale)
|
| 1615 |
+
|
| 1616 |
+
def format(self, value: SupportsInt, length: int) -> str:
|
| 1617 |
+
return '%0*d' % (length, value)
|
| 1618 |
+
|
| 1619 |
+
def get_day_of_year(self, date: datetime.date | None = None) -> int:
|
| 1620 |
+
if date is None:
|
| 1621 |
+
date = self.value
|
| 1622 |
+
return (date - date.replace(month=1, day=1)).days + 1
|
| 1623 |
+
|
| 1624 |
+
def get_week_number(self, day_of_period: int, day_of_week: int | None = None) -> int:
|
| 1625 |
+
"""Return the number of the week of a day within a period. This may be
|
| 1626 |
+
the week number in a year or the week number in a month.
|
| 1627 |
+
|
| 1628 |
+
Usually this will return a value equal to or greater than 1, but if the
|
| 1629 |
+
first week of the period is so short that it actually counts as the last
|
| 1630 |
+
week of the previous period, this function will return 0.
|
| 1631 |
+
|
| 1632 |
+
>>> date = datetime.date(2006, 1, 8)
|
| 1633 |
+
>>> DateTimeFormat(date, 'de_DE').get_week_number(6)
|
| 1634 |
+
1
|
| 1635 |
+
>>> DateTimeFormat(date, 'en_US').get_week_number(6)
|
| 1636 |
+
2
|
| 1637 |
+
|
| 1638 |
+
:param day_of_period: the number of the day in the period (usually
|
| 1639 |
+
either the day of month or the day of year)
|
| 1640 |
+
:param day_of_week: the week day; if omitted, the week day of the
|
| 1641 |
+
current date is assumed
|
| 1642 |
+
"""
|
| 1643 |
+
if day_of_week is None:
|
| 1644 |
+
day_of_week = self.value.weekday()
|
| 1645 |
+
first_day = (day_of_week - self.locale.first_week_day -
|
| 1646 |
+
day_of_period + 1) % 7
|
| 1647 |
+
if first_day < 0:
|
| 1648 |
+
first_day += 7
|
| 1649 |
+
week_number = (day_of_period + first_day - 1) // 7
|
| 1650 |
+
|
| 1651 |
+
if 7 - first_day >= self.locale.min_week_days:
|
| 1652 |
+
week_number += 1
|
| 1653 |
+
|
| 1654 |
+
if self.locale.first_week_day == 0:
|
| 1655 |
+
# Correct the weeknumber in case of iso-calendar usage (first_week_day=0).
|
| 1656 |
+
# If the weeknumber exceeds the maximum number of weeks for the given year
|
| 1657 |
+
# we must count from zero.For example the above calculation gives week 53
|
| 1658 |
+
# for 2018-12-31. By iso-calender definition 2018 has a max of 52
|
| 1659 |
+
# weeks, thus the weeknumber must be 53-52=1.
|
| 1660 |
+
max_weeks = datetime.date(year=self.value.year, day=28, month=12).isocalendar()[1]
|
| 1661 |
+
if week_number > max_weeks:
|
| 1662 |
+
week_number -= max_weeks
|
| 1663 |
+
|
| 1664 |
+
return week_number
|
| 1665 |
+
|
| 1666 |
+
|
| 1667 |
+
PATTERN_CHARS: dict[str, list[int] | None] = {
|
| 1668 |
+
'G': [1, 2, 3, 4, 5], # era
|
| 1669 |
+
'y': None, 'Y': None, 'u': None, # year
|
| 1670 |
+
'Q': [1, 2, 3, 4, 5], 'q': [1, 2, 3, 4, 5], # quarter
|
| 1671 |
+
'M': [1, 2, 3, 4, 5], 'L': [1, 2, 3, 4, 5], # month
|
| 1672 |
+
'w': [1, 2], 'W': [1], # week
|
| 1673 |
+
'd': [1, 2], 'D': [1, 2, 3], 'F': [1], 'g': None, # day
|
| 1674 |
+
'E': [1, 2, 3, 4, 5, 6], 'e': [1, 2, 3, 4, 5, 6], 'c': [1, 3, 4, 5, 6], # week day
|
| 1675 |
+
'a': [1, 2, 3, 4, 5], 'b': [1, 2, 3, 4, 5], 'B': [1, 2, 3, 4, 5], # period
|
| 1676 |
+
'h': [1, 2], 'H': [1, 2], 'K': [1, 2], 'k': [1, 2], # hour
|
| 1677 |
+
'm': [1, 2], # minute
|
| 1678 |
+
's': [1, 2], 'S': None, 'A': None, # second
|
| 1679 |
+
'z': [1, 2, 3, 4], 'Z': [1, 2, 3, 4, 5], 'O': [1, 4], 'v': [1, 4], # zone
|
| 1680 |
+
'V': [1, 2, 3, 4], 'x': [1, 2, 3, 4, 5], 'X': [1, 2, 3, 4, 5], # zone
|
| 1681 |
+
}
|
| 1682 |
+
|
| 1683 |
+
#: The pattern characters declared in the Date Field Symbol Table
|
| 1684 |
+
#: (https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table)
|
| 1685 |
+
#: in order of decreasing magnitude.
|
| 1686 |
+
PATTERN_CHAR_ORDER = "GyYuUQqMLlwWdDFgEecabBChHKkjJmsSAzZOvVXx"
|
| 1687 |
+
|
| 1688 |
+
|
| 1689 |
+
def parse_pattern(pattern: str | DateTimePattern) -> DateTimePattern:
|
| 1690 |
+
"""Parse date, time, and datetime format patterns.
|
| 1691 |
+
|
| 1692 |
+
>>> parse_pattern("MMMMd").format
|
| 1693 |
+
u'%(MMMM)s%(d)s'
|
| 1694 |
+
>>> parse_pattern("MMM d, yyyy").format
|
| 1695 |
+
u'%(MMM)s %(d)s, %(yyyy)s'
|
| 1696 |
+
|
| 1697 |
+
Pattern can contain literal strings in single quotes:
|
| 1698 |
+
|
| 1699 |
+
>>> parse_pattern("H:mm' Uhr 'z").format
|
| 1700 |
+
u'%(H)s:%(mm)s Uhr %(z)s'
|
| 1701 |
+
|
| 1702 |
+
An actual single quote can be used by using two adjacent single quote
|
| 1703 |
+
characters:
|
| 1704 |
+
|
| 1705 |
+
>>> parse_pattern("hh' o''clock'").format
|
| 1706 |
+
u"%(hh)s o'clock"
|
| 1707 |
+
|
| 1708 |
+
:param pattern: the formatting pattern to parse
|
| 1709 |
+
"""
|
| 1710 |
+
if isinstance(pattern, DateTimePattern):
|
| 1711 |
+
return pattern
|
| 1712 |
+
return _cached_parse_pattern(pattern)
|
| 1713 |
+
|
| 1714 |
+
|
| 1715 |
+
@lru_cache(maxsize=1024)
|
| 1716 |
+
def _cached_parse_pattern(pattern: str) -> DateTimePattern:
|
| 1717 |
+
result = []
|
| 1718 |
+
|
| 1719 |
+
for tok_type, tok_value in tokenize_pattern(pattern):
|
| 1720 |
+
if tok_type == "chars":
|
| 1721 |
+
result.append(tok_value.replace('%', '%%'))
|
| 1722 |
+
elif tok_type == "field":
|
| 1723 |
+
fieldchar, fieldnum = tok_value
|
| 1724 |
+
limit = PATTERN_CHARS[fieldchar]
|
| 1725 |
+
if limit and fieldnum not in limit:
|
| 1726 |
+
raise ValueError(f"Invalid length for field: {fieldchar * fieldnum!r}")
|
| 1727 |
+
result.append('%%(%s)s' % (fieldchar * fieldnum))
|
| 1728 |
+
else:
|
| 1729 |
+
raise NotImplementedError(f"Unknown token type: {tok_type}")
|
| 1730 |
+
return DateTimePattern(pattern, ''.join(result))
|
| 1731 |
+
|
| 1732 |
+
|
| 1733 |
+
def tokenize_pattern(pattern: str) -> list[tuple[str, str | tuple[str, int]]]:
|
| 1734 |
+
"""
|
| 1735 |
+
Tokenize date format patterns.
|
| 1736 |
+
|
| 1737 |
+
Returns a list of (token_type, token_value) tuples.
|
| 1738 |
+
|
| 1739 |
+
``token_type`` may be either "chars" or "field".
|
| 1740 |
+
|
| 1741 |
+
For "chars" tokens, the value is the literal value.
|
| 1742 |
+
|
| 1743 |
+
For "field" tokens, the value is a tuple of (field character, repetition count).
|
| 1744 |
+
|
| 1745 |
+
:param pattern: Pattern string
|
| 1746 |
+
:type pattern: str
|
| 1747 |
+
:rtype: list[tuple]
|
| 1748 |
+
"""
|
| 1749 |
+
result = []
|
| 1750 |
+
quotebuf = None
|
| 1751 |
+
charbuf = []
|
| 1752 |
+
fieldchar = ['']
|
| 1753 |
+
fieldnum = [0]
|
| 1754 |
+
|
| 1755 |
+
def append_chars():
|
| 1756 |
+
result.append(('chars', ''.join(charbuf).replace('\0', "'")))
|
| 1757 |
+
del charbuf[:]
|
| 1758 |
+
|
| 1759 |
+
def append_field():
|
| 1760 |
+
result.append(('field', (fieldchar[0], fieldnum[0])))
|
| 1761 |
+
fieldchar[0] = ''
|
| 1762 |
+
fieldnum[0] = 0
|
| 1763 |
+
|
| 1764 |
+
for char in pattern.replace("''", '\0'):
|
| 1765 |
+
if quotebuf is None:
|
| 1766 |
+
if char == "'": # quote started
|
| 1767 |
+
if fieldchar[0]:
|
| 1768 |
+
append_field()
|
| 1769 |
+
elif charbuf:
|
| 1770 |
+
append_chars()
|
| 1771 |
+
quotebuf = []
|
| 1772 |
+
elif char in PATTERN_CHARS:
|
| 1773 |
+
if charbuf:
|
| 1774 |
+
append_chars()
|
| 1775 |
+
if char == fieldchar[0]:
|
| 1776 |
+
fieldnum[0] += 1
|
| 1777 |
+
else:
|
| 1778 |
+
if fieldchar[0]:
|
| 1779 |
+
append_field()
|
| 1780 |
+
fieldchar[0] = char
|
| 1781 |
+
fieldnum[0] = 1
|
| 1782 |
+
else:
|
| 1783 |
+
if fieldchar[0]:
|
| 1784 |
+
append_field()
|
| 1785 |
+
charbuf.append(char)
|
| 1786 |
+
|
| 1787 |
+
elif quotebuf is not None:
|
| 1788 |
+
if char == "'": # end of quote
|
| 1789 |
+
charbuf.extend(quotebuf)
|
| 1790 |
+
quotebuf = None
|
| 1791 |
+
else: # inside quote
|
| 1792 |
+
quotebuf.append(char)
|
| 1793 |
+
|
| 1794 |
+
if fieldchar[0]:
|
| 1795 |
+
append_field()
|
| 1796 |
+
elif charbuf:
|
| 1797 |
+
append_chars()
|
| 1798 |
+
|
| 1799 |
+
return result
|
| 1800 |
+
|
| 1801 |
+
|
| 1802 |
+
def untokenize_pattern(tokens: Iterable[tuple[str, str | tuple[str, int]]]) -> str:
|
| 1803 |
+
"""
|
| 1804 |
+
Turn a date format pattern token stream back into a string.
|
| 1805 |
+
|
| 1806 |
+
This is the reverse operation of ``tokenize_pattern``.
|
| 1807 |
+
|
| 1808 |
+
:type tokens: Iterable[tuple]
|
| 1809 |
+
:rtype: str
|
| 1810 |
+
"""
|
| 1811 |
+
output = []
|
| 1812 |
+
for tok_type, tok_value in tokens:
|
| 1813 |
+
if tok_type == "field":
|
| 1814 |
+
output.append(tok_value[0] * tok_value[1])
|
| 1815 |
+
elif tok_type == "chars":
|
| 1816 |
+
if not any(ch in PATTERN_CHARS for ch in tok_value): # No need to quote
|
| 1817 |
+
output.append(tok_value)
|
| 1818 |
+
else:
|
| 1819 |
+
output.append("'%s'" % tok_value.replace("'", "''"))
|
| 1820 |
+
return "".join(output)
|
| 1821 |
+
|
| 1822 |
+
|
| 1823 |
+
def split_interval_pattern(pattern: str) -> list[str]:
|
| 1824 |
+
"""
|
| 1825 |
+
Split an interval-describing datetime pattern into multiple pieces.
|
| 1826 |
+
|
| 1827 |
+
> The pattern is then designed to be broken up into two pieces by determining the first repeating field.
|
| 1828 |
+
- https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats
|
| 1829 |
+
|
| 1830 |
+
>>> split_interval_pattern(u'E d.M. \u2013 E d.M.')
|
| 1831 |
+
[u'E d.M. \u2013 ', 'E d.M.']
|
| 1832 |
+
>>> split_interval_pattern("Y 'text' Y 'more text'")
|
| 1833 |
+
["Y 'text '", "Y 'more text'"]
|
| 1834 |
+
>>> split_interval_pattern(u"E, MMM d \u2013 E")
|
| 1835 |
+
[u'E, MMM d \u2013 ', u'E']
|
| 1836 |
+
>>> split_interval_pattern("MMM d")
|
| 1837 |
+
['MMM d']
|
| 1838 |
+
>>> split_interval_pattern("y G")
|
| 1839 |
+
['y G']
|
| 1840 |
+
>>> split_interval_pattern(u"MMM d \u2013 d")
|
| 1841 |
+
[u'MMM d \u2013 ', u'd']
|
| 1842 |
+
|
| 1843 |
+
:param pattern: Interval pattern string
|
| 1844 |
+
:return: list of "subpatterns"
|
| 1845 |
+
"""
|
| 1846 |
+
|
| 1847 |
+
seen_fields = set()
|
| 1848 |
+
parts = [[]]
|
| 1849 |
+
|
| 1850 |
+
for tok_type, tok_value in tokenize_pattern(pattern):
|
| 1851 |
+
if tok_type == "field":
|
| 1852 |
+
if tok_value[0] in seen_fields: # Repeated field
|
| 1853 |
+
parts.append([])
|
| 1854 |
+
seen_fields.clear()
|
| 1855 |
+
seen_fields.add(tok_value[0])
|
| 1856 |
+
parts[-1].append((tok_type, tok_value))
|
| 1857 |
+
|
| 1858 |
+
return [untokenize_pattern(tokens) for tokens in parts]
|
| 1859 |
+
|
| 1860 |
+
|
| 1861 |
+
def match_skeleton(skeleton: str, options: Iterable[str], allow_different_fields: bool = False) -> str | None:
|
| 1862 |
+
"""
|
| 1863 |
+
Find the closest match for the given datetime skeleton among the options given.
|
| 1864 |
+
|
| 1865 |
+
This uses the rules outlined in the TR35 document.
|
| 1866 |
+
|
| 1867 |
+
>>> match_skeleton('yMMd', ('yMd', 'yMMMd'))
|
| 1868 |
+
'yMd'
|
| 1869 |
+
|
| 1870 |
+
>>> match_skeleton('yMMd', ('jyMMd',), allow_different_fields=True)
|
| 1871 |
+
'jyMMd'
|
| 1872 |
+
|
| 1873 |
+
>>> match_skeleton('yMMd', ('qyMMd',), allow_different_fields=False)
|
| 1874 |
+
|
| 1875 |
+
>>> match_skeleton('hmz', ('hmv',))
|
| 1876 |
+
'hmv'
|
| 1877 |
+
|
| 1878 |
+
:param skeleton: The skeleton to match
|
| 1879 |
+
:type skeleton: str
|
| 1880 |
+
:param options: An iterable of other skeletons to match against
|
| 1881 |
+
:type options: Iterable[str]
|
| 1882 |
+
:return: The closest skeleton match, or if no match was found, None.
|
| 1883 |
+
:rtype: str|None
|
| 1884 |
+
"""
|
| 1885 |
+
|
| 1886 |
+
# TODO: maybe implement pattern expansion?
|
| 1887 |
+
|
| 1888 |
+
# Based on the implementation in
|
| 1889 |
+
# http://source.icu-project.org/repos/icu/icu4j/trunk/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java
|
| 1890 |
+
|
| 1891 |
+
# Filter out falsy values and sort for stability; when `interval_formats` is passed in, there may be a None key.
|
| 1892 |
+
options = sorted(option for option in options if option)
|
| 1893 |
+
|
| 1894 |
+
if 'z' in skeleton and not any('z' in option for option in options):
|
| 1895 |
+
skeleton = skeleton.replace('z', 'v')
|
| 1896 |
+
if 'k' in skeleton and not any('k' in option for option in options):
|
| 1897 |
+
skeleton = skeleton.replace('k', 'H')
|
| 1898 |
+
if 'K' in skeleton and not any('K' in option for option in options):
|
| 1899 |
+
skeleton = skeleton.replace('K', 'h')
|
| 1900 |
+
if 'a' in skeleton and not any('a' in option for option in options):
|
| 1901 |
+
skeleton = skeleton.replace('a', '')
|
| 1902 |
+
if 'b' in skeleton and not any('b' in option for option in options):
|
| 1903 |
+
skeleton = skeleton.replace('b', '')
|
| 1904 |
+
|
| 1905 |
+
get_input_field_width = dict(t[1] for t in tokenize_pattern(skeleton) if t[0] == "field").get
|
| 1906 |
+
best_skeleton = None
|
| 1907 |
+
best_distance = None
|
| 1908 |
+
for option in options:
|
| 1909 |
+
get_opt_field_width = dict(t[1] for t in tokenize_pattern(option) if t[0] == "field").get
|
| 1910 |
+
distance = 0
|
| 1911 |
+
for field in PATTERN_CHARS:
|
| 1912 |
+
input_width = get_input_field_width(field, 0)
|
| 1913 |
+
opt_width = get_opt_field_width(field, 0)
|
| 1914 |
+
if input_width == opt_width:
|
| 1915 |
+
continue
|
| 1916 |
+
if opt_width == 0 or input_width == 0:
|
| 1917 |
+
if not allow_different_fields: # This one is not okay
|
| 1918 |
+
option = None
|
| 1919 |
+
break
|
| 1920 |
+
distance += 0x1000 # Magic weight constant for "entirely different fields"
|
| 1921 |
+
elif field == 'M' and ((input_width > 2 and opt_width <= 2) or (input_width <= 2 and opt_width > 2)):
|
| 1922 |
+
distance += 0x100 # Magic weight for "text turns into a number"
|
| 1923 |
+
else:
|
| 1924 |
+
distance += abs(input_width - opt_width)
|
| 1925 |
+
|
| 1926 |
+
if not option: # We lost the option along the way (probably due to "allow_different_fields")
|
| 1927 |
+
continue
|
| 1928 |
+
|
| 1929 |
+
if not best_skeleton or distance < best_distance:
|
| 1930 |
+
best_skeleton = option
|
| 1931 |
+
best_distance = distance
|
| 1932 |
+
|
| 1933 |
+
if distance == 0: # Found a perfect match!
|
| 1934 |
+
break
|
| 1935 |
+
|
| 1936 |
+
return best_skeleton
|
SPFsmartGATE/LIVE/TMP/babel/babel/languages.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from babel.core import get_global
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def get_official_languages(territory: str, regional: bool = False, de_facto: bool = False) -> tuple[str, ...]:
|
| 7 |
+
"""
|
| 8 |
+
Get the official language(s) for the given territory.
|
| 9 |
+
|
| 10 |
+
The language codes, if any are known, are returned in order of descending popularity.
|
| 11 |
+
|
| 12 |
+
If the `regional` flag is set, then languages which are regionally official are also returned.
|
| 13 |
+
|
| 14 |
+
If the `de_facto` flag is set, then languages which are "de facto" official are also returned.
|
| 15 |
+
|
| 16 |
+
.. warning:: Note that the data is as up to date as the current version of the CLDR used
|
| 17 |
+
by Babel. If you need scientifically accurate information, use another source!
|
| 18 |
+
|
| 19 |
+
:param territory: Territory code
|
| 20 |
+
:type territory: str
|
| 21 |
+
:param regional: Whether to return regionally official languages too
|
| 22 |
+
:type regional: bool
|
| 23 |
+
:param de_facto: Whether to return de-facto official languages too
|
| 24 |
+
:type de_facto: bool
|
| 25 |
+
:return: Tuple of language codes
|
| 26 |
+
:rtype: tuple[str]
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
territory = str(territory).upper()
|
| 30 |
+
allowed_stati = {"official"}
|
| 31 |
+
if regional:
|
| 32 |
+
allowed_stati.add("official_regional")
|
| 33 |
+
if de_facto:
|
| 34 |
+
allowed_stati.add("de_facto_official")
|
| 35 |
+
|
| 36 |
+
languages = get_global("territory_languages").get(territory, {})
|
| 37 |
+
pairs = [
|
| 38 |
+
(info['population_percent'], language)
|
| 39 |
+
for language, info in languages.items()
|
| 40 |
+
if info.get('official_status') in allowed_stati
|
| 41 |
+
]
|
| 42 |
+
pairs.sort(reverse=True)
|
| 43 |
+
return tuple(lang for _, lang in pairs)
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def get_territory_language_info(territory: str) -> dict[str, dict[str, float | str | None]]:
|
| 47 |
+
"""
|
| 48 |
+
Get a dictionary of language information for a territory.
|
| 49 |
+
|
| 50 |
+
The dictionary is keyed by language code; the values are dicts with more information.
|
| 51 |
+
|
| 52 |
+
The following keys are currently known for the values:
|
| 53 |
+
|
| 54 |
+
* `population_percent`: The percentage of the territory's population speaking the
|
| 55 |
+
language.
|
| 56 |
+
* `official_status`: An optional string describing the officiality status of the language.
|
| 57 |
+
Known values are "official", "official_regional" and "de_facto_official".
|
| 58 |
+
|
| 59 |
+
.. warning:: Note that the data is as up to date as the current version of the CLDR used
|
| 60 |
+
by Babel. If you need scientifically accurate information, use another source!
|
| 61 |
+
|
| 62 |
+
.. note:: Note that the format of the dict returned may change between Babel versions.
|
| 63 |
+
|
| 64 |
+
See https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html
|
| 65 |
+
|
| 66 |
+
:param territory: Territory code
|
| 67 |
+
:type territory: str
|
| 68 |
+
:return: Language information dictionary
|
| 69 |
+
:rtype: dict[str, dict]
|
| 70 |
+
"""
|
| 71 |
+
territory = str(territory).upper()
|
| 72 |
+
return get_global("territory_languages").get(territory, {}).copy()
|
SPFsmartGATE/LIVE/TMP/babel/babel/lists.py
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.lists
|
| 3 |
+
~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Locale dependent formatting of lists.
|
| 6 |
+
|
| 7 |
+
The default locale for the functions in this module is determined by the
|
| 8 |
+
following environment variables, in that order:
|
| 9 |
+
|
| 10 |
+
* ``LC_ALL``, and
|
| 11 |
+
* ``LANG``
|
| 12 |
+
|
| 13 |
+
:copyright: (c) 2015-2024 by the Babel Team.
|
| 14 |
+
:license: BSD, see LICENSE for more details.
|
| 15 |
+
"""
|
| 16 |
+
from __future__ import annotations
|
| 17 |
+
|
| 18 |
+
from collections.abc import Sequence
|
| 19 |
+
from typing import TYPE_CHECKING
|
| 20 |
+
|
| 21 |
+
from babel.core import Locale, default_locale
|
| 22 |
+
|
| 23 |
+
if TYPE_CHECKING:
|
| 24 |
+
from typing_extensions import Literal
|
| 25 |
+
|
| 26 |
+
DEFAULT_LOCALE = default_locale()
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def format_list(
|
| 30 |
+
lst: Sequence[str],
|
| 31 |
+
style: Literal['standard', 'standard-short', 'or', 'or-short', 'unit', 'unit-short', 'unit-narrow'] = 'standard',
|
| 32 |
+
locale: Locale | str | None = DEFAULT_LOCALE,
|
| 33 |
+
) -> str:
|
| 34 |
+
"""
|
| 35 |
+
Format the items in `lst` as a list.
|
| 36 |
+
|
| 37 |
+
>>> format_list(['apples', 'oranges', 'pears'], locale='en')
|
| 38 |
+
u'apples, oranges, and pears'
|
| 39 |
+
>>> format_list(['apples', 'oranges', 'pears'], locale='zh')
|
| 40 |
+
u'apples\u3001oranges\u548cpears'
|
| 41 |
+
>>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi')
|
| 42 |
+
u'omena, peruna tai aplari'
|
| 43 |
+
|
| 44 |
+
Not all styles are necessarily available in all locales.
|
| 45 |
+
The function will attempt to fall back to replacement styles according to the rules
|
| 46 |
+
set forth in the CLDR root XML file, and raise a ValueError if no suitable replacement
|
| 47 |
+
can be found.
|
| 48 |
+
|
| 49 |
+
The following text is verbatim from the Unicode TR35-49 spec [1].
|
| 50 |
+
|
| 51 |
+
* standard:
|
| 52 |
+
A typical 'and' list for arbitrary placeholders.
|
| 53 |
+
eg. "January, February, and March"
|
| 54 |
+
* standard-short:
|
| 55 |
+
A short version of an 'and' list, suitable for use with short or abbreviated placeholder values.
|
| 56 |
+
eg. "Jan., Feb., and Mar."
|
| 57 |
+
* or:
|
| 58 |
+
A typical 'or' list for arbitrary placeholders.
|
| 59 |
+
eg. "January, February, or March"
|
| 60 |
+
* or-short:
|
| 61 |
+
A short version of an 'or' list.
|
| 62 |
+
eg. "Jan., Feb., or Mar."
|
| 63 |
+
* unit:
|
| 64 |
+
A list suitable for wide units.
|
| 65 |
+
eg. "3 feet, 7 inches"
|
| 66 |
+
* unit-short:
|
| 67 |
+
A list suitable for short units
|
| 68 |
+
eg. "3 ft, 7 in"
|
| 69 |
+
* unit-narrow:
|
| 70 |
+
A list suitable for narrow units, where space on the screen is very limited.
|
| 71 |
+
eg. "3′ 7″"
|
| 72 |
+
|
| 73 |
+
[1]: https://www.unicode.org/reports/tr35/tr35-49/tr35-general.html#ListPatterns
|
| 74 |
+
|
| 75 |
+
:param lst: a sequence of items to format in to a list
|
| 76 |
+
:param style: the style to format the list with. See above for description.
|
| 77 |
+
:param locale: the locale
|
| 78 |
+
"""
|
| 79 |
+
locale = Locale.parse(locale)
|
| 80 |
+
if not lst:
|
| 81 |
+
return ''
|
| 82 |
+
if len(lst) == 1:
|
| 83 |
+
return lst[0]
|
| 84 |
+
|
| 85 |
+
patterns = _resolve_list_style(locale, style)
|
| 86 |
+
|
| 87 |
+
if len(lst) == 2 and '2' in patterns:
|
| 88 |
+
return patterns['2'].format(*lst)
|
| 89 |
+
|
| 90 |
+
result = patterns['start'].format(lst[0], lst[1])
|
| 91 |
+
for elem in lst[2:-1]:
|
| 92 |
+
result = patterns['middle'].format(result, elem)
|
| 93 |
+
result = patterns['end'].format(result, lst[-1])
|
| 94 |
+
|
| 95 |
+
return result
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
# Based on CLDR 45's root.xml file's `<alias>`es.
|
| 99 |
+
# The root file defines both `standard` and `or`,
|
| 100 |
+
# so they're always available.
|
| 101 |
+
# TODO: It would likely be better to use the
|
| 102 |
+
# babel.localedata.Alias mechanism for this,
|
| 103 |
+
# but I'm not quite sure how it's supposed to
|
| 104 |
+
# work with inheritance and data in the root.
|
| 105 |
+
_style_fallbacks = {
|
| 106 |
+
"or-narrow": ["or-short", "or"],
|
| 107 |
+
"or-short": ["or"],
|
| 108 |
+
"standard-narrow": ["standard-short", "standard"],
|
| 109 |
+
"standard-short": ["standard"],
|
| 110 |
+
"unit": ["unit-short", "standard"],
|
| 111 |
+
"unit-narrow": ["unit-short", "unit", "standard"],
|
| 112 |
+
"unit-short": ["standard"],
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def _resolve_list_style(locale: Locale, style: str):
|
| 117 |
+
for style in (style, *(_style_fallbacks.get(style, []))): # noqa: B020
|
| 118 |
+
if style in locale.list_patterns:
|
| 119 |
+
return locale.list_patterns[style]
|
| 120 |
+
raise ValueError(
|
| 121 |
+
f"Loc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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.localedata
|
| 3 |
+
~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Low-level locale data access.
|
| 6 |
+
|
| 7 |
+
:note: The `Locale` class, which uses this module under the hood, provides a
|
| 8 |
+
more convenient interface for accessing the locale data.
|
| 9 |
+
|
| 10 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 11 |
+
:license: BSD, see LICENSE for more details.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import os
|
| 17 |
+
import pickle
|
| 18 |
+
import re
|
| 19 |
+
import sys
|
| 20 |
+
import threading
|
| 21 |
+
from collections import abc
|
| 22 |
+
from collections.abc import Iterator, Mapping, MutableMapping
|
| 23 |
+
from functools import lru_cache
|
| 24 |
+
from itertools import chain
|
| 25 |
+
from typing import Any
|
| 26 |
+
|
| 27 |
+
_cache: dict[str, Any] = {}
|
| 28 |
+
_cache_lock = threading.RLock()
|
| 29 |
+
_dirname = os.path.join(os.path.dirname(__file__), 'locale-data')
|
| 30 |
+
_windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def normalize_locale(name: str) -> str | None:
|
| 34 |
+
"""Normalize a locale ID by stripping spaces and apply proper casing.
|
| 35 |
+
|
| 36 |
+
Returns the normalized locale ID string or `None` if the ID is not
|
| 37 |
+
recognized.
|
| 38 |
+
"""
|
| 39 |
+
if not name or not isinstance(name, str):
|
| 40 |
+
return None
|
| 41 |
+
name = name.strip().lower()
|
| 42 |
+
for locale_id in chain.from_iterable([_cache, locale_identifiers()]):
|
| 43 |
+
if name == locale_id.lower():
|
| 44 |
+
return locale_id
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def resolve_locale_filename(name: os.PathLike[str] | str) -> str:
|
| 48 |
+
"""
|
| 49 |
+
Resolve a locale identifier to a `.dat` path on disk.
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
# Clean up any possible relative paths.
|
| 53 |
+
name = os.path.basename(name)
|
| 54 |
+
|
| 55 |
+
# Ensure we're not left with one of the Windows reserved names.
|
| 56 |
+
if sys.platform == "win32" and _windows_reserved_name_re.match(os.path.splitext(name)[0]):
|
| 57 |
+
raise ValueError(f"Name {name} is invalid on Windows")
|
| 58 |
+
|
| 59 |
+
# Build the path.
|
| 60 |
+
return os.path.join(_dirname, f"{name}.dat")
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def exists(name: str) -> bool:
|
| 64 |
+
"""Check whether locale data is available for the given locale.
|
| 65 |
+
|
| 66 |
+
Returns `True` if it exists, `False` otherwise.
|
| 67 |
+
|
| 68 |
+
:param name: the locale identifier string
|
| 69 |
+
"""
|
| 70 |
+
if not name or not isinstance(name, str):
|
| 71 |
+
return False
|
| 72 |
+
if name in _cache:
|
| 73 |
+
return True
|
| 74 |
+
file_found = os.path.exists(resolve_locale_filename(name))
|
| 75 |
+
return True if file_found else bool(normalize_locale(name))
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
@lru_cache(maxsize=None)
|
| 79 |
+
def locale_identifiers() -> list[str]:
|
| 80 |
+
"""Return a list of all locale identifiers for which locale data is
|
| 81 |
+
available.
|
| 82 |
+
|
| 83 |
+
This data is cached after the first invocation.
|
| 84 |
+
You can clear the cache by calling `locale_identifiers.cache_clear()`.
|
| 85 |
+
|
| 86 |
+
.. versionadded:: 0.8.1
|
| 87 |
+
|
| 88 |
+
:return: a list of locale identifiers (strings)
|
| 89 |
+
"""
|
| 90 |
+
return [
|
| 91 |
+
stem
|
| 92 |
+
for stem, extension in
|
| 93 |
+
(os.path.splitext(filename) for filename in os.listdir(_dirname))
|
| 94 |
+
if extension == '.dat' and stem != 'root'
|
| 95 |
+
]
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def _is_non_likely_script(name: str) -> bool:
|
| 99 |
+
"""Return whether the locale is of the form ``lang_Script``,
|
| 100 |
+
and the script is not the likely script for the language.
|
| 101 |
+
|
| 102 |
+
This implements the behavior of the ``nonlikelyScript`` value of the
|
| 103 |
+
``localRules`` attribute for parent locales added in CLDR 45.
|
| 104 |
+
"""
|
| 105 |
+
from babel.core import get_global, parse_locale
|
| 106 |
+
|
| 107 |
+
try:
|
| 108 |
+
lang, territory, script, variant, *rest = parse_locale(name)
|
| 109 |
+
except ValueError:
|
| 110 |
+
return False
|
| 111 |
+
|
| 112 |
+
if lang and script and not territory and not variant and not rest:
|
| 113 |
+
likely_subtag = get_global('likely_subtags').get(lang)
|
| 114 |
+
_, _, likely_script, *_ = parse_locale(likely_subtag)
|
| 115 |
+
return script != likely_script
|
| 116 |
+
return False
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def load(name: os.PathLike[str] | str, merge_inherited: bool = True) -> dict[str, Any]:
|
| 120 |
+
"""Load the locale data for the given locale.
|
| 121 |
+
|
| 122 |
+
The locale data is a dictionary that contains much of the data defined by
|
| 123 |
+
the Common Locale Data Repository (CLDR). This data is stored as a
|
| 124 |
+
collection of pickle files inside the ``babel`` package.
|
| 125 |
+
|
| 126 |
+
>>> d = load('en_US')
|
| 127 |
+
>>> d['languages']['sv']
|
| 128 |
+
u'Swedish'
|
| 129 |
+
|
| 130 |
+
Note that the results are cached, and subsequent requests for the same
|
| 131 |
+
locale return the same dictionary:
|
| 132 |
+
|
| 133 |
+
>>> d1 = load('en_US')
|
| 134 |
+
>>> d2 = load('en_US')
|
| 135 |
+
>>> d1 is d2
|
| 136 |
+
True
|
| 137 |
+
|
| 138 |
+
:param name: the locale identifier string (or "root")
|
| 139 |
+
:param merge_inherited: whether the inherited data should be merged into
|
| 140 |
+
the data of the requested locale
|
| 141 |
+
:raise `IOError`: if no locale data file is found for the given locale
|
| 142 |
+
identifier, or one of the locales it inherits from
|
| 143 |
+
"""
|
| 144 |
+
name = os.path.basename(name)
|
| 145 |
+
_cache_lock.acquire()
|
| 146 |
+
try:
|
| 147 |
+
data = _cache.get(name)
|
| 148 |
+
if not data:
|
| 149 |
+
# Load inherited data
|
| 150 |
+
if name == 'root' or not merge_inherited:
|
| 151 |
+
data = {}
|
| 152 |
+
else:
|
| 153 |
+
from babel.core import get_global
|
| 154 |
+
parent = get_global('parent_exceptions').get(name)
|
| 155 |
+
if not parent:
|
| 156 |
+
if _is_non_likely_script(name):
|
| 157 |
+
parent = 'root'
|
| 158 |
+
else:
|
| 159 |
+
parts = name.split('_')
|
| 160 |
+
parent = "root" if len(parts) == 1 else "_".join(parts[:-1])
|
| 161 |
+
data = load(parent).copy()
|
| 162 |
+
filename = resolve_locale_filename(name)
|
| 163 |
+
with open(filename, 'rb') as fileobj:
|
| 164 |
+
if name != 'root' and merge_inherited:
|
| 165 |
+
merge(data, pickle.load(fileobj))
|
| 166 |
+
else:
|
| 167 |
+
data = pickle.load(fileobj)
|
| 168 |
+
_cache[name] = data
|
| 169 |
+
return data
|
| 170 |
+
finally:
|
| 171 |
+
_cache_lock.release()
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
def merge(dict1: MutableMapping[Any, Any], dict2: Mapping[Any, Any]) -> None:
|
| 175 |
+
"""Merge the data from `dict2` into the `dict1` dictionary, making copies
|
| 176 |
+
of nested dictionaries.
|
| 177 |
+
|
| 178 |
+
>>> d = {1: 'foo', 3: 'baz'}
|
| 179 |
+
>>> merge(d, {1: 'Foo', 2: 'Bar'})
|
| 180 |
+
>>> sorted(d.items())
|
| 181 |
+
[(1, 'Foo'), (2, 'Bar'), (3, 'baz')]
|
| 182 |
+
|
| 183 |
+
:param dict1: the dictionary to merge into
|
| 184 |
+
:param dict2: the dictionary containing the data that should be merged
|
| 185 |
+
"""
|
| 186 |
+
for key, val2 in dict2.items():
|
| 187 |
+
if val2 is not None:
|
| 188 |
+
val1 = dict1.get(key)
|
| 189 |
+
if isinstance(val2, dict):
|
| 190 |
+
if val1 is None:
|
| 191 |
+
val1 = {}
|
| 192 |
+
if isinstance(val1, Alias):
|
| 193 |
+
val1 = (val1, val2)
|
| 194 |
+
elif isinstance(val1, tuple):
|
| 195 |
+
alias, others = val1
|
| 196 |
+
others = others.copy()
|
| 197 |
+
merge(others, val2)
|
| 198 |
+
val1 = (alias, others)
|
| 199 |
+
else:
|
| 200 |
+
val1 = val1.copy()
|
| 201 |
+
merge(val1, val2)
|
| 202 |
+
else:
|
| 203 |
+
val1 = val2
|
| 204 |
+
dict1[key] = val1
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
class Alias:
|
| 208 |
+
"""Representation of an alias in the locale data.
|
| 209 |
+
|
| 210 |
+
An alias is a value that refers to some other part of the locale data,
|
| 211 |
+
as specified by the `keys`.
|
| 212 |
+
"""
|
| 213 |
+
|
| 214 |
+
def __init__(self, keys: tuple[str, ...]) -> None:
|
| 215 |
+
self.keys = tuple(keys)
|
| 216 |
+
|
| 217 |
+
def __repr__(self) -> str:
|
| 218 |
+
return f"<{type(self).__name__} {self.keys!r}>"
|
| 219 |
+
|
| 220 |
+
def resolve(self, data: Mapping[str | int | None, Any]) -> Mapping[str | int | None, Any]:
|
| 221 |
+
"""Resolve the alias based on the given data.
|
| 222 |
+
|
| 223 |
+
This is done recursively, so if one alias resolves to a second alias,
|
| 224 |
+
that second alias will also be resolved.
|
| 225 |
+
|
| 226 |
+
:param data: the locale data
|
| 227 |
+
:type data: `dict`
|
| 228 |
+
"""
|
| 229 |
+
base = data
|
| 230 |
+
for key in self.keys:
|
| 231 |
+
data = data[key]
|
| 232 |
+
if isinstance(data, Alias):
|
| 233 |
+
data = data.resolve(base)
|
| 234 |
+
elif isinstance(data, tuple):
|
| 235 |
+
alias, others = data
|
| 236 |
+
data = alias.resolve(base)
|
| 237 |
+
return data
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
class LocaleDataDict(abc.MutableMapping):
|
| 241 |
+
"""Dictionary wrapper that automatically resolves aliases to the actual
|
| 242 |
+
values.
|
| 243 |
+
"""
|
| 244 |
+
|
| 245 |
+
def __init__(self, data: MutableMapping[str | int | None, Any], base: Mapping[str | int | None, Any] | None = None):
|
| 246 |
+
self._data = data
|
| 247 |
+
if base is None:
|
| 248 |
+
base = data
|
| 249 |
+
self.base = base
|
| 250 |
+
|
| 251 |
+
def __len__(self) -> int:
|
| 252 |
+
return len(self._data)
|
| 253 |
+
|
| 254 |
+
def __iter__(self) -> Iterator[str | int | None]:
|
| 255 |
+
return iter(self._data)
|
| 256 |
+
|
| 257 |
+
def __getitem__(self, key: str | int | None) -> Any:
|
| 258 |
+
orig = val = self._data[key]
|
| 259 |
+
if isinstance(val, Alias): # resolve an alias
|
| 260 |
+
val = val.resolve(self.base)
|
| 261 |
+
if isinstance(val, tuple): # Merge a partial dict with an alias
|
| 262 |
+
alias, others = val
|
| 263 |
+
val = alias.resolve(self.base).copy()
|
| 264 |
+
merge(val, others)
|
| 265 |
+
if isinstance(val, dict): # Return a nested alias-resolving dict
|
| 266 |
+
val = LocaleDataDict(val, base=self.base)
|
| 267 |
+
if val is not orig:
|
| 268 |
+
self._data[key] = val
|
| 269 |
+
return val
|
| 270 |
+
|
| 271 |
+
def __setitem__(self, key: str | int | None, value: Any) -> None:
|
| 272 |
+
self._data[key] = value
|
| 273 |
+
|
| 274 |
+
def __delitem__(self, key: str | int | None) -> None:
|
| 275 |
+
del self._data[key]
|
| 276 |
+
|
| 277 |
+
def copy(self) -> LocaleDataDict:
|
| 278 |
+
return LocaleDataDict(self._data.copy(), base=self.base)
|
SPFsmartGATE/LIVE/TMP/babel/babel/numbers.py
ADDED
|
@@ -0,0 +1,1573 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.numbers
|
| 3 |
+
~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Locale dependent formatting and parsing of numeric data.
|
| 6 |
+
|
| 7 |
+
The default locale for the functions in this module is determined by the
|
| 8 |
+
following environment variables, in that order:
|
| 9 |
+
|
| 10 |
+
* ``LC_NUMERIC``,
|
| 11 |
+
* ``LC_ALL``, and
|
| 12 |
+
* ``LANG``
|
| 13 |
+
|
| 14 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 15 |
+
:license: BSD, see LICENSE for more details.
|
| 16 |
+
"""
|
| 17 |
+
# TODO:
|
| 18 |
+
# Padding and rounding increments in pattern:
|
| 19 |
+
# - https://www.unicode.org/reports/tr35/ (Appendix G.6)
|
| 20 |
+
from __future__ import annotations
|
| 21 |
+
|
| 22 |
+
import datetime
|
| 23 |
+
import decimal
|
| 24 |
+
import re
|
| 25 |
+
import warnings
|
| 26 |
+
from typing import TYPE_CHECKING, Any, cast, overload
|
| 27 |
+
|
| 28 |
+
from babel.core import Locale, default_locale, get_global
|
| 29 |
+
from babel.localedata import LocaleDataDict
|
| 30 |
+
|
| 31 |
+
if TYPE_CHECKING:
|
| 32 |
+
from typing_extensions import Literal
|
| 33 |
+
|
| 34 |
+
LC_NUMERIC = default_locale('LC_NUMERIC')
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class UnknownCurrencyError(Exception):
|
| 38 |
+
"""Exception thrown when a currency is requested for which no data is available.
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
def __init__(self, identifier: str) -> None:
|
| 42 |
+
"""Create the exception.
|
| 43 |
+
:param identifier: the identifier string of the unsupported currency
|
| 44 |
+
"""
|
| 45 |
+
Exception.__init__(self, f"Unknown currency {identifier!r}.")
|
| 46 |
+
|
| 47 |
+
#: The identifier of the locale that could not be found.
|
| 48 |
+
self.identifier = identifier
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def list_currencies(locale: Locale | str | None = None) -> set[str]:
|
| 52 |
+
""" Return a `set` of normalized currency codes.
|
| 53 |
+
|
| 54 |
+
.. versionadded:: 2.5.0
|
| 55 |
+
|
| 56 |
+
:param locale: filters returned currency codes by the provided locale.
|
| 57 |
+
Expected to be a locale instance or code. If no locale is
|
| 58 |
+
provided, returns the list of all currencies from all
|
| 59 |
+
locales.
|
| 60 |
+
"""
|
| 61 |
+
# Get locale-scoped currencies.
|
| 62 |
+
if locale:
|
| 63 |
+
return set(Locale.parse(locale).currencies)
|
| 64 |
+
return set(get_global('all_currencies'))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def validate_currency(currency: str, locale: Locale | str | None = None) -> None:
|
| 68 |
+
""" Check the currency code is recognized by Babel.
|
| 69 |
+
|
| 70 |
+
Accepts a ``locale`` parameter for fined-grained validation, working as
|
| 71 |
+
the one defined above in ``list_currencies()`` method.
|
| 72 |
+
|
| 73 |
+
Raises a `UnknownCurrencyError` exception if the currency is unknown to Babel.
|
| 74 |
+
"""
|
| 75 |
+
if currency not in list_currencies(locale):
|
| 76 |
+
raise UnknownCurrencyError(currency)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def is_currency(currency: str, locale: Locale | str | None = None) -> bool:
|
| 80 |
+
""" Returns `True` only if a currency is recognized by Babel.
|
| 81 |
+
|
| 82 |
+
This method always return a Boolean and never raise.
|
| 83 |
+
"""
|
| 84 |
+
if not currency or not isinstance(currency, str):
|
| 85 |
+
return False
|
| 86 |
+
try:
|
| 87 |
+
validate_currency(currency, locale)
|
| 88 |
+
except UnknownCurrencyError:
|
| 89 |
+
return False
|
| 90 |
+
return True
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def normalize_currency(currency: str, locale: Locale | str | None = None) -> str | None:
|
| 94 |
+
"""Returns the normalized identifier of any currency code.
|
| 95 |
+
|
| 96 |
+
Accepts a ``locale`` parameter for fined-grained validation, working as
|
| 97 |
+
the one defined above in ``list_currencies()`` method.
|
| 98 |
+
|
| 99 |
+
Returns None if the currency is unknown to Babel.
|
| 100 |
+
"""
|
| 101 |
+
if isinstance(currency, str):
|
| 102 |
+
currency = currency.upper()
|
| 103 |
+
if not is_currency(currency, locale):
|
| 104 |
+
return None
|
| 105 |
+
return currency
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
def get_currency_name(
|
| 109 |
+
currency: str,
|
| 110 |
+
count: float | decimal.Decimal | None = None,
|
| 111 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 112 |
+
) -> str:
|
| 113 |
+
"""Return the name used by the locale for the specified currency.
|
| 114 |
+
|
| 115 |
+
>>> get_currency_name('USD', locale='en_US')
|
| 116 |
+
u'US Dollar'
|
| 117 |
+
|
| 118 |
+
.. versionadded:: 0.9.4
|
| 119 |
+
|
| 120 |
+
:param currency: the currency code.
|
| 121 |
+
:param count: the optional count. If provided the currency name
|
| 122 |
+
will be pluralized to that number if possible.
|
| 123 |
+
:param locale: the `Locale` object or locale identifier.
|
| 124 |
+
"""
|
| 125 |
+
loc = Locale.parse(locale)
|
| 126 |
+
if count is not None:
|
| 127 |
+
try:
|
| 128 |
+
plural_form = loc.plural_form(count)
|
| 129 |
+
except (OverflowError, ValueError):
|
| 130 |
+
plural_form = 'other'
|
| 131 |
+
plural_names = loc._data['currency_names_plural']
|
| 132 |
+
if currency in plural_names:
|
| 133 |
+
currency_plural_names = plural_names[currency]
|
| 134 |
+
if plural_form in currency_plural_names:
|
| 135 |
+
return currency_plural_names[plural_form]
|
| 136 |
+
if 'other' in currency_plural_names:
|
| 137 |
+
return currency_plural_names['other']
|
| 138 |
+
return loc.currencies.get(currency, currency)
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def get_currency_symbol(currency: str, locale: Locale | str | None = LC_NUMERIC) -> str:
|
| 142 |
+
"""Return the symbol used by the locale for the specified currency.
|
| 143 |
+
|
| 144 |
+
>>> get_currency_symbol('USD', locale='en_US')
|
| 145 |
+
u'$'
|
| 146 |
+
|
| 147 |
+
:param currency: the currency code.
|
| 148 |
+
:param locale: the `Locale` object or locale identifier.
|
| 149 |
+
"""
|
| 150 |
+
return Locale.parse(locale).currency_symbols.get(currency, currency)
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
def get_currency_precision(currency: str) -> int:
|
| 154 |
+
"""Return currency's precision.
|
| 155 |
+
|
| 156 |
+
Precision is the number of decimals found after the decimal point in the
|
| 157 |
+
currency's format pattern.
|
| 158 |
+
|
| 159 |
+
.. versionadded:: 2.5.0
|
| 160 |
+
|
| 161 |
+
:param currency: the currency code.
|
| 162 |
+
"""
|
| 163 |
+
precisions = get_global('currency_fractions')
|
| 164 |
+
return precisions.get(currency, precisions['DEFAULT'])[0]
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
def get_currency_unit_pattern(
|
| 168 |
+
currency: str,
|
| 169 |
+
count: float | decimal.Decimal | None = None,
|
| 170 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 171 |
+
) -> str:
|
| 172 |
+
"""
|
| 173 |
+
Return the unit pattern used for long display of a currency value
|
| 174 |
+
for a given locale.
|
| 175 |
+
This is a string containing ``{0}`` where the numeric part
|
| 176 |
+
should be substituted and ``{1}`` where the currency long display
|
| 177 |
+
name should be substituted.
|
| 178 |
+
|
| 179 |
+
>>> get_currency_unit_pattern('USD', locale='en_US', count=10)
|
| 180 |
+
u'{0} {1}'
|
| 181 |
+
|
| 182 |
+
.. versionadded:: 2.7.0
|
| 183 |
+
|
| 184 |
+
:param currency: the currency code.
|
| 185 |
+
:param count: the optional count. If provided the unit
|
| 186 |
+
pattern for that number will be returned.
|
| 187 |
+
:param locale: the `Locale` object or locale identifier.
|
| 188 |
+
"""
|
| 189 |
+
loc = Locale.parse(locale)
|
| 190 |
+
if count is not None:
|
| 191 |
+
plural_form = loc.plural_form(count)
|
| 192 |
+
try:
|
| 193 |
+
return loc._data['currency_unit_patterns'][plural_form]
|
| 194 |
+
except LookupError:
|
| 195 |
+
# Fall back to 'other'
|
| 196 |
+
pass
|
| 197 |
+
|
| 198 |
+
return loc._data['currency_unit_patterns']['other']
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
@overload
|
| 202 |
+
def get_territory_currencies(
|
| 203 |
+
territory: str,
|
| 204 |
+
start_date: datetime.date | None = ...,
|
| 205 |
+
end_date: datetime.date | None = ...,
|
| 206 |
+
tender: bool = ...,
|
| 207 |
+
non_tender: bool = ...,
|
| 208 |
+
include_details: Literal[False] = ...,
|
| 209 |
+
) -> list[str]:
|
| 210 |
+
... # pragma: no cover
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
@overload
|
| 214 |
+
def get_territory_currencies(
|
| 215 |
+
territory: str,
|
| 216 |
+
start_date: datetime.date | None = ...,
|
| 217 |
+
end_date: datetime.date | None = ...,
|
| 218 |
+
tender: bool = ...,
|
| 219 |
+
non_tender: bool = ...,
|
| 220 |
+
include_details: Literal[True] = ...,
|
| 221 |
+
) -> list[dict[str, Any]]:
|
| 222 |
+
... # pragma: no cover
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
def get_territory_currencies(
|
| 226 |
+
territory: str,
|
| 227 |
+
start_date: datetime.date | None = None,
|
| 228 |
+
end_date: datetime.date | None = None,
|
| 229 |
+
tender: bool = True,
|
| 230 |
+
non_tender: bool = False,
|
| 231 |
+
include_details: bool = False,
|
| 232 |
+
) -> list[str] | list[dict[str, Any]]:
|
| 233 |
+
"""Returns the list of currencies for the given territory that are valid for
|
| 234 |
+
the given date range. In addition to that the currency database
|
| 235 |
+
distinguishes between tender and non-tender currencies. By default only
|
| 236 |
+
tender currencies are returned.
|
| 237 |
+
|
| 238 |
+
The return value is a list of all currencies roughly ordered by the time
|
| 239 |
+
of when the currency became active. The longer the currency is being in
|
| 240 |
+
use the more to the left of the list it will be.
|
| 241 |
+
|
| 242 |
+
The start date defaults to today. If no end date is given it will be the
|
| 243 |
+
same as the start date. Otherwise a range can be defined. For instance
|
| 244 |
+
this can be used to find the currencies in use in Austria between 1995 and
|
| 245 |
+
2011:
|
| 246 |
+
|
| 247 |
+
>>> from datetime import date
|
| 248 |
+
>>> get_territory_currencies('AT', date(1995, 1, 1), date(2011, 1, 1))
|
| 249 |
+
['ATS', 'EUR']
|
| 250 |
+
|
| 251 |
+
Likewise it's also possible to find all the currencies in use on a
|
| 252 |
+
single date:
|
| 253 |
+
|
| 254 |
+
>>> get_territory_currencies('AT', date(1995, 1, 1))
|
| 255 |
+
['ATS']
|
| 256 |
+
>>> get_territory_currencies('AT', date(2011, 1, 1))
|
| 257 |
+
['EUR']
|
| 258 |
+
|
| 259 |
+
By default the return value only includes tender currencies. This
|
| 260 |
+
however can be changed:
|
| 261 |
+
|
| 262 |
+
>>> get_territory_currencies('US')
|
| 263 |
+
['USD']
|
| 264 |
+
>>> get_territory_currencies('US', tender=False, non_tender=True,
|
| 265 |
+
... start_date=date(2014, 1, 1))
|
| 266 |
+
['USN', 'USS']
|
| 267 |
+
|
| 268 |
+
.. versionadded:: 2.0
|
| 269 |
+
|
| 270 |
+
:param territory: the name of the territory to find the currency for.
|
| 271 |
+
:param start_date: the start date. If not given today is assumed.
|
| 272 |
+
:param end_date: the end date. If not given the start date is assumed.
|
| 273 |
+
:param tender: controls whether tender currencies should be included.
|
| 274 |
+
:param non_tender: controls whether non-tender currencies should be
|
| 275 |
+
included.
|
| 276 |
+
:param include_details: if set to `True`, instead of returning currency
|
| 277 |
+
codes the return value will be dictionaries
|
| 278 |
+
with detail information. In that case each
|
| 279 |
+
dictionary will have the keys ``'currency'``,
|
| 280 |
+
``'from'``, ``'to'``, and ``'tender'``.
|
| 281 |
+
"""
|
| 282 |
+
currencies = get_global('territory_currencies')
|
| 283 |
+
if start_date is None:
|
| 284 |
+
start_date = datetime.date.today()
|
| 285 |
+
elif isinstance(start_date, datetime.datetime):
|
| 286 |
+
start_date = start_date.date()
|
| 287 |
+
if end_date is None:
|
| 288 |
+
end_date = start_date
|
| 289 |
+
elif isinstance(end_date, datetime.datetime):
|
| 290 |
+
end_date = end_date.date()
|
| 291 |
+
|
| 292 |
+
curs = currencies.get(territory.upper(), ())
|
| 293 |
+
# TODO: validate that the territory exists
|
| 294 |
+
|
| 295 |
+
def _is_active(start, end):
|
| 296 |
+
return (start is None or start <= end_date) and \
|
| 297 |
+
(end is None or end >= start_date)
|
| 298 |
+
|
| 299 |
+
result = []
|
| 300 |
+
for currency_code, start, end, is_tender in curs:
|
| 301 |
+
if start:
|
| 302 |
+
start = datetime.date(*start)
|
| 303 |
+
if end:
|
| 304 |
+
end = datetime.date(*end)
|
| 305 |
+
if ((is_tender and tender) or
|
| 306 |
+
(not is_tender and non_tender)) and _is_active(start, end):
|
| 307 |
+
if include_details:
|
| 308 |
+
result.append({
|
| 309 |
+
'currency': currency_code,
|
| 310 |
+
'from': start,
|
| 311 |
+
'to': end,
|
| 312 |
+
'tender': is_tender,
|
| 313 |
+
})
|
| 314 |
+
else:
|
| 315 |
+
result.append(currency_code)
|
| 316 |
+
|
| 317 |
+
return result
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
def _get_numbering_system(locale: Locale, numbering_system: Literal["default"] | str = "latn") -> str:
|
| 321 |
+
if numbering_system == "default":
|
| 322 |
+
return locale.default_numbering_system
|
| 323 |
+
else:
|
| 324 |
+
return numbering_system
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
def _get_number_symbols(
|
| 328 |
+
locale: Locale | str | None,
|
| 329 |
+
*,
|
| 330 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 331 |
+
) -> LocaleDataDict:
|
| 332 |
+
parsed_locale = Locale.parse(locale)
|
| 333 |
+
numbering_system = _get_numbering_system(parsed_locale, numbering_system)
|
| 334 |
+
try:
|
| 335 |
+
return parsed_locale.number_symbols[numbering_system]
|
| 336 |
+
except KeyError as error:
|
| 337 |
+
raise UnsupportedNumberingSystemError(f"Unknown numbering system {numbering_system} for Locale {parsed_locale}.") from error
|
| 338 |
+
|
| 339 |
+
|
| 340 |
+
class UnsupportedNumberingSystemError(Exception):
|
| 341 |
+
"""Exception thrown when an unsupported numbering system is requested for the given Locale."""
|
| 342 |
+
pass
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
def get_decimal_symbol(
|
| 346 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 347 |
+
*,
|
| 348 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 349 |
+
) -> str:
|
| 350 |
+
"""Return the symbol used by the locale to separate decimal fractions.
|
| 351 |
+
|
| 352 |
+
>>> get_decimal_symbol('en_US')
|
| 353 |
+
u'.'
|
| 354 |
+
>>> get_decimal_symbol('ar_EG', numbering_system='default')
|
| 355 |
+
u'٫'
|
| 356 |
+
>>> get_decimal_symbol('ar_EG', numbering_system='latn')
|
| 357 |
+
u'.'
|
| 358 |
+
|
| 359 |
+
:param locale: the `Locale` object or locale identifier
|
| 360 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 361 |
+
The special value "default" will use the default numbering system of the locale.
|
| 362 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 363 |
+
"""
|
| 364 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('decimal', '.')
|
| 365 |
+
|
| 366 |
+
|
| 367 |
+
def get_plus_sign_symbol(
|
| 368 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 369 |
+
*,
|
| 370 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 371 |
+
) -> str:
|
| 372 |
+
"""Return the plus sign symbol used by the current locale.
|
| 373 |
+
|
| 374 |
+
>>> get_plus_sign_symbol('en_US')
|
| 375 |
+
u'+'
|
| 376 |
+
>>> get_plus_sign_symbol('ar_EG', numbering_system='default')
|
| 377 |
+
u'\u061c+'
|
| 378 |
+
>>> get_plus_sign_symbol('ar_EG', numbering_system='latn')
|
| 379 |
+
u'\u200e+'
|
| 380 |
+
|
| 381 |
+
:param locale: the `Locale` object or locale identifier
|
| 382 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 383 |
+
The special value "default" will use the default numbering system of the locale.
|
| 384 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 385 |
+
"""
|
| 386 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('plusSign', '+')
|
| 387 |
+
|
| 388 |
+
|
| 389 |
+
def get_minus_sign_symbol(
|
| 390 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 391 |
+
*,
|
| 392 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 393 |
+
) -> str:
|
| 394 |
+
"""Return the plus sign symbol used by the current locale.
|
| 395 |
+
|
| 396 |
+
>>> get_minus_sign_symbol('en_US')
|
| 397 |
+
u'-'
|
| 398 |
+
>>> get_minus_sign_symbol('ar_EG', numbering_system='default')
|
| 399 |
+
u'\u061c-'
|
| 400 |
+
>>> get_minus_sign_symbol('ar_EG', numbering_system='latn')
|
| 401 |
+
u'\u200e-'
|
| 402 |
+
|
| 403 |
+
:param locale: the `Locale` object or locale identifier
|
| 404 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 405 |
+
The special value "default" will use the default numbering system of the locale.
|
| 406 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 407 |
+
"""
|
| 408 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('minusSign', '-')
|
| 409 |
+
|
| 410 |
+
|
| 411 |
+
def get_exponential_symbol(
|
| 412 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 413 |
+
*,
|
| 414 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 415 |
+
) -> str:
|
| 416 |
+
"""Return the symbol used by the locale to separate mantissa and exponent.
|
| 417 |
+
|
| 418 |
+
>>> get_exponential_symbol('en_US')
|
| 419 |
+
u'E'
|
| 420 |
+
>>> get_exponential_symbol('ar_EG', numbering_system='default')
|
| 421 |
+
u'أس'
|
| 422 |
+
>>> get_exponential_symbol('ar_EG', numbering_system='latn')
|
| 423 |
+
u'E'
|
| 424 |
+
|
| 425 |
+
:param locale: the `Locale` object or locale identifier
|
| 426 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 427 |
+
The special value "default" will use the default numbering system of the locale.
|
| 428 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 429 |
+
"""
|
| 430 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('exponential', 'E')
|
| 431 |
+
|
| 432 |
+
|
| 433 |
+
def get_group_symbol(
|
| 434 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 435 |
+
*,
|
| 436 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 437 |
+
) -> str:
|
| 438 |
+
"""Return the symbol used by the locale to separate groups of thousands.
|
| 439 |
+
|
| 440 |
+
>>> get_group_symbol('en_US')
|
| 441 |
+
u','
|
| 442 |
+
>>> get_group_symbol('ar_EG', numbering_system='default')
|
| 443 |
+
u'٬'
|
| 444 |
+
>>> get_group_symbol('ar_EG', numbering_system='latn')
|
| 445 |
+
u','
|
| 446 |
+
|
| 447 |
+
:param locale: the `Locale` object or locale identifier
|
| 448 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 449 |
+
The special value "default" will use the default numbering system of the locale.
|
| 450 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 451 |
+
"""
|
| 452 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('group', ',')
|
| 453 |
+
|
| 454 |
+
|
| 455 |
+
def get_infinity_symbol(
|
| 456 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 457 |
+
*,
|
| 458 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 459 |
+
) -> str:
|
| 460 |
+
"""Return the symbol used by the locale to represent infinity.
|
| 461 |
+
|
| 462 |
+
>>> get_infinity_symbol('en_US')
|
| 463 |
+
u'∞'
|
| 464 |
+
>>> get_infinity_symbol('ar_EG', numbering_system='default')
|
| 465 |
+
u'∞'
|
| 466 |
+
>>> get_infinity_symbol('ar_EG', numbering_system='latn')
|
| 467 |
+
u'∞'
|
| 468 |
+
|
| 469 |
+
:param locale: the `Locale` object or locale identifier
|
| 470 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 471 |
+
The special value "default" will use the default numbering system of the locale.
|
| 472 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 473 |
+
"""
|
| 474 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('infinity', '∞')
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
def format_number(number: float | decimal.Decimal | str, locale: Locale | str | None = LC_NUMERIC) -> str:
|
| 478 |
+
"""Return the given number formatted for a specific locale.
|
| 479 |
+
|
| 480 |
+
>>> format_number(1099, locale='en_US') # doctest: +SKIP
|
| 481 |
+
u'1,099'
|
| 482 |
+
>>> format_number(1099, locale='de_DE') # doctest: +SKIP
|
| 483 |
+
u'1.099'
|
| 484 |
+
|
| 485 |
+
.. deprecated:: 2.6.0
|
| 486 |
+
|
| 487 |
+
Use babel.numbers.format_decimal() instead.
|
| 488 |
+
|
| 489 |
+
:param number: the number to format
|
| 490 |
+
:param locale: the `Locale` object or locale identifier
|
| 491 |
+
|
| 492 |
+
|
| 493 |
+
"""
|
| 494 |
+
warnings.warn('Use babel.numbers.format_decimal() instead.', DeprecationWarning, stacklevel=2)
|
| 495 |
+
return format_decimal(number, locale=locale)
|
| 496 |
+
|
| 497 |
+
|
| 498 |
+
def get_decimal_precision(number: decimal.Decimal) -> int:
|
| 499 |
+
"""Return maximum precision of a decimal instance's fractional part.
|
| 500 |
+
|
| 501 |
+
Precision is extracted from the fractional part only.
|
| 502 |
+
"""
|
| 503 |
+
# Copied from: https://github.com/mahmoud/boltons/pull/59
|
| 504 |
+
assert isinstance(number, decimal.Decimal)
|
| 505 |
+
decimal_tuple = number.normalize().as_tuple()
|
| 506 |
+
# Note: DecimalTuple.exponent can be 'n' (qNaN), 'N' (sNaN), or 'F' (Infinity)
|
| 507 |
+
if not isinstance(decimal_tuple.exponent, int) or decimal_tuple.exponent >= 0:
|
| 508 |
+
return 0
|
| 509 |
+
return abs(decimal_tuple.exponent)
|
| 510 |
+
|
| 511 |
+
|
| 512 |
+
def get_decimal_quantum(precision: int | decimal.Decimal) -> decimal.Decimal:
|
| 513 |
+
"""Return minimal quantum of a number, as defined by precision."""
|
| 514 |
+
assert isinstance(precision, (int, decimal.Decimal))
|
| 515 |
+
return decimal.Decimal(10) ** (-precision)
|
| 516 |
+
|
| 517 |
+
|
| 518 |
+
def format_decimal(
|
| 519 |
+
number: float | decimal.Decimal | str,
|
| 520 |
+
format: str | NumberPattern | None = None,
|
| 521 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 522 |
+
decimal_quantization: bool = True,
|
| 523 |
+
group_separator: bool = True,
|
| 524 |
+
*,
|
| 525 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 526 |
+
) -> str:
|
| 527 |
+
"""Return the given decimal number formatted for a specific locale.
|
| 528 |
+
|
| 529 |
+
>>> format_decimal(1.2345, locale='en_US')
|
| 530 |
+
u'1.234'
|
| 531 |
+
>>> format_decimal(1.2346, locale='en_US')
|
| 532 |
+
u'1.235'
|
| 533 |
+
>>> format_decimal(-1.2346, locale='en_US')
|
| 534 |
+
u'-1.235'
|
| 535 |
+
>>> format_decimal(1.2345, locale='sv_SE')
|
| 536 |
+
u'1,234'
|
| 537 |
+
>>> format_decimal(1.2345, locale='de')
|
| 538 |
+
u'1,234'
|
| 539 |
+
>>> format_decimal(1.2345, locale='ar_EG', numbering_system='default')
|
| 540 |
+
u'1٫234'
|
| 541 |
+
>>> format_decimal(1.2345, locale='ar_EG', numbering_system='latn')
|
| 542 |
+
u'1.234'
|
| 543 |
+
|
| 544 |
+
The appropriate thousands grouping and the decimal separator are used for
|
| 545 |
+
each locale:
|
| 546 |
+
|
| 547 |
+
>>> format_decimal(12345.5, locale='en_US')
|
| 548 |
+
u'12,345.5'
|
| 549 |
+
|
| 550 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 551 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 552 |
+
this behavior with the `decimal_quantization` parameter:
|
| 553 |
+
|
| 554 |
+
>>> format_decimal(1.2346, locale='en_US')
|
| 555 |
+
u'1.235'
|
| 556 |
+
>>> format_decimal(1.2346, locale='en_US', decimal_quantization=False)
|
| 557 |
+
u'1.2346'
|
| 558 |
+
>>> format_decimal(12345.67, locale='fr_CA', group_separator=False)
|
| 559 |
+
u'12345,67'
|
| 560 |
+
>>> format_decimal(12345.67, locale='en_US', group_separator=True)
|
| 561 |
+
u'12,345.67'
|
| 562 |
+
|
| 563 |
+
:param number: the number to format
|
| 564 |
+
:param format:
|
| 565 |
+
:param locale: the `Locale` object or locale identifier
|
| 566 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 567 |
+
the format pattern. Defaults to `True`.
|
| 568 |
+
:param group_separator: Boolean to switch group separator on/off in a locale's
|
| 569 |
+
number format.
|
| 570 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 571 |
+
The special value "default" will use the default numbering system of the locale.
|
| 572 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 573 |
+
"""
|
| 574 |
+
locale = Locale.parse(locale)
|
| 575 |
+
if format is None:
|
| 576 |
+
format = locale.decimal_formats[format]
|
| 577 |
+
pattern = parse_pattern(format)
|
| 578 |
+
return pattern.apply(
|
| 579 |
+
number, locale, decimal_quantization=decimal_quantization, group_separator=group_separator, numbering_system=numbering_system)
|
| 580 |
+
|
| 581 |
+
|
| 582 |
+
def format_compact_decimal(
|
| 583 |
+
number: float | decimal.Decimal | str,
|
| 584 |
+
*,
|
| 585 |
+
format_type: Literal["short", "long"] = "short",
|
| 586 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 587 |
+
fraction_digits: int = 0,
|
| 588 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 589 |
+
) -> str:
|
| 590 |
+
"""Return the given decimal number formatted for a specific locale in compact form.
|
| 591 |
+
|
| 592 |
+
>>> format_compact_decimal(12345, format_type="short", locale='en_US')
|
| 593 |
+
u'12K'
|
| 594 |
+
>>> format_compact_decimal(12345, format_type="long", locale='en_US')
|
| 595 |
+
u'12 thousand'
|
| 596 |
+
>>> format_compact_decimal(12345, format_type="short", locale='en_US', fraction_digits=2)
|
| 597 |
+
u'12.34K'
|
| 598 |
+
>>> format_compact_decimal(1234567, format_type="short", locale="ja_JP")
|
| 599 |
+
u'123万'
|
| 600 |
+
>>> format_compact_decimal(2345678, format_type="long", locale="mk")
|
| 601 |
+
u'2 милиони'
|
| 602 |
+
>>> format_compact_decimal(21000000, format_type="long", locale="mk")
|
| 603 |
+
u'21 милион'
|
| 604 |
+
>>> format_compact_decimal(12345, format_type="short", locale='ar_EG', fraction_digits=2, numbering_system='default')
|
| 605 |
+
u'12٫34\xa0ألف'
|
| 606 |
+
|
| 607 |
+
:param number: the number to format
|
| 608 |
+
:param format_type: Compact format to use ("short" or "long")
|
| 609 |
+
:param locale: the `Locale` object or locale identifier
|
| 610 |
+
:param fraction_digits: Number of digits after the decimal point to use. Defaults to `0`.
|
| 611 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 612 |
+
The special value "default" will use the default numbering system of the locale.
|
| 613 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 614 |
+
"""
|
| 615 |
+
locale = Locale.parse(locale)
|
| 616 |
+
compact_format = locale.compact_decimal_formats[format_type]
|
| 617 |
+
number, format = _get_compact_format(number, compact_format, locale, fraction_digits)
|
| 618 |
+
# Did not find a format, fall back.
|
| 619 |
+
if format is None:
|
| 620 |
+
format = locale.decimal_formats[None]
|
| 621 |
+
pattern = parse_pattern(format)
|
| 622 |
+
return pattern.apply(number, locale, decimal_quantization=False, numbering_system=numbering_system)
|
| 623 |
+
|
| 624 |
+
|
| 625 |
+
def _get_compact_format(
|
| 626 |
+
number: float | decimal.Decimal | str,
|
| 627 |
+
compact_format: LocaleDataDict,
|
| 628 |
+
locale: Locale,
|
| 629 |
+
fraction_digits: int,
|
| 630 |
+
) -> tuple[decimal.Decimal, NumberPattern | None]:
|
| 631 |
+
"""Returns the number after dividing by the unit and the format pattern to use.
|
| 632 |
+
The algorithm is described here:
|
| 633 |
+
https://www.unicode.org/reports/tr35/tr35-45/tr35-numbers.html#Compact_Number_Formats.
|
| 634 |
+
"""
|
| 635 |
+
if not isinstance(number, decimal.Decimal):
|
| 636 |
+
number = decimal.Decimal(str(number))
|
| 637 |
+
if number.is_nan() or number.is_infinite():
|
| 638 |
+
return number, None
|
| 639 |
+
format = None
|
| 640 |
+
for magnitude in sorted([int(m) for m in compact_format["other"]], reverse=True):
|
| 641 |
+
if abs(number) >= magnitude:
|
| 642 |
+
# check the pattern using "other" as the amount
|
| 643 |
+
format = compact_format["other"][str(magnitude)]
|
| 644 |
+
pattern = parse_pattern(format).pattern
|
| 645 |
+
# if the pattern is "0", we do not divide the number
|
| 646 |
+
if pattern == "0":
|
| 647 |
+
break
|
| 648 |
+
# otherwise, we need to divide the number by the magnitude but remove zeros
|
| 649 |
+
# equal to the number of 0's in the pattern minus 1
|
| 650 |
+
number = cast(decimal.Decimal, number / (magnitude // (10 ** (pattern.count("0") - 1))))
|
| 651 |
+
# round to the number of fraction digits requested
|
| 652 |
+
rounded = round(number, fraction_digits)
|
| 653 |
+
# if the remaining number is singular, use the singular format
|
| 654 |
+
plural_form = locale.plural_form(abs(number))
|
| 655 |
+
if plural_form not in compact_format:
|
| 656 |
+
plural_form = "other"
|
| 657 |
+
if number == 1 and "1" in compact_format:
|
| 658 |
+
plural_form = "1"
|
| 659 |
+
format = compact_format[plural_form][str(magnitude)]
|
| 660 |
+
number = rounded
|
| 661 |
+
break
|
| 662 |
+
return number, format
|
| 663 |
+
|
| 664 |
+
|
| 665 |
+
class UnknownCurrencyFormatError(KeyError):
|
| 666 |
+
"""Exception raised when an unknown currency format is requested."""
|
| 667 |
+
|
| 668 |
+
|
| 669 |
+
def format_currency(
|
| 670 |
+
number: float | decimal.Decimal | str,
|
| 671 |
+
currency: str,
|
| 672 |
+
format: str | NumberPattern | None = None,
|
| 673 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 674 |
+
currency_digits: bool = True,
|
| 675 |
+
format_type: Literal["name", "standard", "accounting"] = "standard",
|
| 676 |
+
decimal_quantization: bool = True,
|
| 677 |
+
group_separator: bool = True,
|
| 678 |
+
*,
|
| 679 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 680 |
+
) -> str:
|
| 681 |
+
"""Return formatted currency value.
|
| 682 |
+
|
| 683 |
+
>>> format_currency(1099.98, 'USD', locale='en_US')
|
| 684 |
+
'$1,099.98'
|
| 685 |
+
>>> format_currency(1099.98, 'USD', locale='es_CO')
|
| 686 |
+
u'US$1.099,98'
|
| 687 |
+
>>> format_currency(1099.98, 'EUR', locale='de_DE')
|
| 688 |
+
u'1.099,98\\xa0\\u20ac'
|
| 689 |
+
>>> format_currency(1099.98, 'EGP', locale='ar_EG', numbering_system='default')
|
| 690 |
+
u'\u200f1٬099٫98\xa0ج.م.\u200f'
|
| 691 |
+
|
| 692 |
+
The format can also be specified explicitly. The currency is
|
| 693 |
+
placed with the '¤' sign. As the sign gets repeated the format
|
| 694 |
+
expands (¤ being the symbol, ¤¤ is the currency abbreviation and
|
| 695 |
+
¤¤¤ is the full name of the currency):
|
| 696 |
+
|
| 697 |
+
>>> format_currency(1099.98, 'EUR', u'\xa4\xa4 #,##0.00', locale='en_US')
|
| 698 |
+
u'EUR 1,099.98'
|
| 699 |
+
>>> format_currency(1099.98, 'EUR', u'#,##0.00 \xa4\xa4\xa4', locale='en_US')
|
| 700 |
+
u'1,099.98 euros'
|
| 701 |
+
|
| 702 |
+
Currencies usually have a specific number of decimal digits. This function
|
| 703 |
+
favours that information over the given format:
|
| 704 |
+
|
| 705 |
+
>>> format_currency(1099.98, 'JPY', locale='en_US')
|
| 706 |
+
u'\\xa51,100'
|
| 707 |
+
>>> format_currency(1099.98, 'COP', u'#,##0.00', locale='es_ES')
|
| 708 |
+
u'1.099,98'
|
| 709 |
+
|
| 710 |
+
However, the number of decimal digits can be overridden from the currency
|
| 711 |
+
information, by setting the last parameter to ``False``:
|
| 712 |
+
|
| 713 |
+
>>> format_currency(1099.98, 'JPY', locale='en_US', currency_digits=False)
|
| 714 |
+
u'\\xa51,099.98'
|
| 715 |
+
>>> format_currency(1099.98, 'COP', u'#,##0.00', locale='es_ES', currency_digits=False)
|
| 716 |
+
u'1.099,98'
|
| 717 |
+
|
| 718 |
+
If a format is not specified the type of currency format to use
|
| 719 |
+
from the locale can be specified:
|
| 720 |
+
|
| 721 |
+
>>> format_currency(1099.98, 'EUR', locale='en_US', format_type='standard')
|
| 722 |
+
u'\\u20ac1,099.98'
|
| 723 |
+
|
| 724 |
+
When the given currency format type is not available, an exception is
|
| 725 |
+
raised:
|
| 726 |
+
|
| 727 |
+
>>> format_currency('1099.98', 'EUR', locale='root', format_type='unknown')
|
| 728 |
+
Traceback (most recent call last):
|
| 729 |
+
...
|
| 730 |
+
UnknownCurrencyFormatError: "'unknown' is not a known currency format type"
|
| 731 |
+
|
| 732 |
+
>>> format_currency(101299.98, 'USD', locale='en_US', group_separator=False)
|
| 733 |
+
u'$101299.98'
|
| 734 |
+
|
| 735 |
+
>>> format_currency(101299.98, 'USD', locale='en_US', group_separator=True)
|
| 736 |
+
u'$101,299.98'
|
| 737 |
+
|
| 738 |
+
You can also pass format_type='name' to use long display names. The order of
|
| 739 |
+
the number and currency name, along with the correct localized plural form
|
| 740 |
+
of the currency name, is chosen according to locale:
|
| 741 |
+
|
| 742 |
+
>>> format_currency(1, 'USD', locale='en_US', format_type='name')
|
| 743 |
+
u'1.00 US dollar'
|
| 744 |
+
>>> format_currency(1099.98, 'USD', locale='en_US', format_type='name')
|
| 745 |
+
u'1,099.98 US dollars'
|
| 746 |
+
>>> format_currency(1099.98, 'USD', locale='ee', format_type='name')
|
| 747 |
+
u'us ga dollar 1,099.98'
|
| 748 |
+
|
| 749 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 750 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 751 |
+
this behavior with the `decimal_quantization` parameter:
|
| 752 |
+
|
| 753 |
+
>>> format_currency(1099.9876, 'USD', locale='en_US')
|
| 754 |
+
u'$1,099.99'
|
| 755 |
+
>>> format_currency(1099.9876, 'USD', locale='en_US', decimal_quantization=False)
|
| 756 |
+
u'$1,099.9876'
|
| 757 |
+
|
| 758 |
+
:param number: the number to format
|
| 759 |
+
:param currency: the currency code
|
| 760 |
+
:param format: the format string to use
|
| 761 |
+
:param locale: the `Locale` object or locale identifier
|
| 762 |
+
:param currency_digits: use the currency's natural number of decimal digits
|
| 763 |
+
:param format_type: the currency format type to use
|
| 764 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 765 |
+
the format pattern. Defaults to `True`.
|
| 766 |
+
:param group_separator: Boolean to switch group separator on/off in a locale's
|
| 767 |
+
number format.
|
| 768 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 769 |
+
The special value "default" will use the default numbering system of the locale.
|
| 770 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 771 |
+
"""
|
| 772 |
+
if format_type == 'name':
|
| 773 |
+
return _format_currency_long_name(number, currency, format=format,
|
| 774 |
+
locale=locale, currency_digits=currency_digits,
|
| 775 |
+
decimal_quantization=decimal_quantization, group_separator=group_separator,
|
| 776 |
+
numbering_system=numbering_system)
|
| 777 |
+
locale = Locale.parse(locale)
|
| 778 |
+
if format:
|
| 779 |
+
pattern = parse_pattern(format)
|
| 780 |
+
else:
|
| 781 |
+
try:
|
| 782 |
+
pattern = locale.currency_formats[format_type]
|
| 783 |
+
except KeyError:
|
| 784 |
+
raise UnknownCurrencyFormatError(f"{format_type!r} is not a known currency format type") from None
|
| 785 |
+
|
| 786 |
+
return pattern.apply(
|
| 787 |
+
number, locale, currency=currency, currency_digits=currency_digits,
|
| 788 |
+
decimal_quantization=decimal_quantization, group_separator=group_separator, numbering_system=numbering_system)
|
| 789 |
+
|
| 790 |
+
|
| 791 |
+
def _format_currency_long_name(
|
| 792 |
+
number: float | decimal.Decimal | str,
|
| 793 |
+
currency: str,
|
| 794 |
+
format: str | NumberPattern | None = None,
|
| 795 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 796 |
+
currency_digits: bool = True,
|
| 797 |
+
format_type: Literal["name", "standard", "accounting"] = "standard",
|
| 798 |
+
decimal_quantization: bool = True,
|
| 799 |
+
group_separator: bool = True,
|
| 800 |
+
*,
|
| 801 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 802 |
+
) -> str:
|
| 803 |
+
# Algorithm described here:
|
| 804 |
+
# https://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies
|
| 805 |
+
locale = Locale.parse(locale)
|
| 806 |
+
# Step 1.
|
| 807 |
+
# There are no examples of items with explicit count (0 or 1) in current
|
| 808 |
+
# locale data. So there is no point implementing that.
|
| 809 |
+
# Step 2.
|
| 810 |
+
|
| 811 |
+
# Correct number to numeric type, important for looking up plural rules:
|
| 812 |
+
number_n = float(number) if isinstance(number, str) else number
|
| 813 |
+
|
| 814 |
+
# Step 3.
|
| 815 |
+
unit_pattern = get_currency_unit_pattern(currency, count=number_n, locale=locale)
|
| 816 |
+
|
| 817 |
+
# Step 4.
|
| 818 |
+
display_name = get_currency_name(currency, count=number_n, locale=locale)
|
| 819 |
+
|
| 820 |
+
# Step 5.
|
| 821 |
+
if not format:
|
| 822 |
+
format = locale.decimal_formats[None]
|
| 823 |
+
|
| 824 |
+
pattern = parse_pattern(format)
|
| 825 |
+
|
| 826 |
+
number_part = pattern.apply(
|
| 827 |
+
number, locale, currency=currency, currency_digits=currency_digits,
|
| 828 |
+
decimal_quantization=decimal_quantization, group_separator=group_separator, numbering_system=numbering_system)
|
| 829 |
+
|
| 830 |
+
return unit_pattern.format(number_part, display_name)
|
| 831 |
+
|
| 832 |
+
|
| 833 |
+
def format_compact_currency(
|
| 834 |
+
number: float | decimal.Decimal | str,
|
| 835 |
+
currency: str,
|
| 836 |
+
*,
|
| 837 |
+
format_type: Literal["short"] = "short",
|
| 838 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 839 |
+
fraction_digits: int = 0,
|
| 840 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 841 |
+
) -> str:
|
| 842 |
+
"""Format a number as a currency value in compact form.
|
| 843 |
+
|
| 844 |
+
>>> format_compact_currency(12345, 'USD', locale='en_US')
|
| 845 |
+
u'$12K'
|
| 846 |
+
>>> format_compact_currency(123456789, 'USD', locale='en_US', fraction_digits=2)
|
| 847 |
+
u'$123.46M'
|
| 848 |
+
>>> format_compact_currency(123456789, 'EUR', locale='de_DE', fraction_digits=1)
|
| 849 |
+
'123,5\xa0Mio.\xa0€'
|
| 850 |
+
|
| 851 |
+
:param number: the number to format
|
| 852 |
+
:param currency: the currency code
|
| 853 |
+
:param format_type: the compact format type to use. Defaults to "short".
|
| 854 |
+
:param locale: the `Locale` object or locale identifier
|
| 855 |
+
:param fraction_digits: Number of digits after the decimal point to use. Defaults to `0`.
|
| 856 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 857 |
+
The special value "default" will use the default numbering system of the locale.
|
| 858 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 859 |
+
"""
|
| 860 |
+
locale = Locale.parse(locale)
|
| 861 |
+
try:
|
| 862 |
+
compact_format = locale.compact_currency_formats[format_type]
|
| 863 |
+
except KeyError as error:
|
| 864 |
+
raise UnknownCurrencyFormatError(f"{format_type!r} is not a known compact currency format type") from error
|
| 865 |
+
number, format = _get_compact_format(number, compact_format, locale, fraction_digits)
|
| 866 |
+
# Did not find a format, fall back.
|
| 867 |
+
if format is None or "¤" not in str(format):
|
| 868 |
+
# find first format that has a currency symbol
|
| 869 |
+
for magnitude in compact_format['other']:
|
| 870 |
+
format = compact_format['other'][magnitude].pattern
|
| 871 |
+
if '¤' not in format:
|
| 872 |
+
continue
|
| 873 |
+
# remove characters that are not the currency symbol, 0's or spaces
|
| 874 |
+
format = re.sub(r'[^0\s\¤]', '', format)
|
| 875 |
+
# compress adjacent spaces into one
|
| 876 |
+
format = re.sub(r'(\s)\s+', r'\1', format).strip()
|
| 877 |
+
break
|
| 878 |
+
if format is None:
|
| 879 |
+
raise ValueError('No compact currency format found for the given number and locale.')
|
| 880 |
+
pattern = parse_pattern(format)
|
| 881 |
+
return pattern.apply(number, locale, currency=currency, currency_digits=False, decimal_quantization=False,
|
| 882 |
+
numbering_system=numbering_system)
|
| 883 |
+
|
| 884 |
+
|
| 885 |
+
def format_percent(
|
| 886 |
+
number: float | decimal.Decimal | str,
|
| 887 |
+
format: str | NumberPattern | None = None,
|
| 888 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 889 |
+
decimal_quantization: bool = True,
|
| 890 |
+
group_separator: bool = True,
|
| 891 |
+
*,
|
| 892 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 893 |
+
) -> str:
|
| 894 |
+
"""Return formatted percent value for a specific locale.
|
| 895 |
+
|
| 896 |
+
>>> format_percent(0.34, locale='en_US')
|
| 897 |
+
u'34%'
|
| 898 |
+
>>> format_percent(25.1234, locale='en_US')
|
| 899 |
+
u'2,512%'
|
| 900 |
+
>>> format_percent(25.1234, locale='sv_SE')
|
| 901 |
+
u'2\\xa0512\\xa0%'
|
| 902 |
+
>>> format_percent(25.1234, locale='ar_EG', numbering_system='default')
|
| 903 |
+
u'2٬512%'
|
| 904 |
+
|
| 905 |
+
The format pattern can also be specified explicitly:
|
| 906 |
+
|
| 907 |
+
>>> format_percent(25.1234, u'#,##0\u2030', locale='en_US')
|
| 908 |
+
u'25,123\u2030'
|
| 909 |
+
|
| 910 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 911 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 912 |
+
this behavior with the `decimal_quantization` parameter:
|
| 913 |
+
|
| 914 |
+
>>> format_percent(23.9876, locale='en_US')
|
| 915 |
+
u'2,399%'
|
| 916 |
+
>>> format_percent(23.9876, locale='en_US', decimal_quantization=False)
|
| 917 |
+
u'2,398.76%'
|
| 918 |
+
|
| 919 |
+
>>> format_percent(229291.1234, locale='pt_BR', group_separator=False)
|
| 920 |
+
u'22929112%'
|
| 921 |
+
|
| 922 |
+
>>> format_percent(229291.1234, locale='pt_BR', group_separator=True)
|
| 923 |
+
u'22.929.112%'
|
| 924 |
+
|
| 925 |
+
:param number: the percent number to format
|
| 926 |
+
:param format:
|
| 927 |
+
:param locale: the `Locale` object or locale identifier
|
| 928 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 929 |
+
the format pattern. Defaults to `True`.
|
| 930 |
+
:param group_separator: Boolean to switch group separator on/off in a locale's
|
| 931 |
+
number format.
|
| 932 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 933 |
+
The special value "default" will use the default numbering system of the locale.
|
| 934 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 935 |
+
"""
|
| 936 |
+
locale = Locale.parse(locale)
|
| 937 |
+
if not format:
|
| 938 |
+
format = locale.percent_formats[None]
|
| 939 |
+
pattern = parse_pattern(format)
|
| 940 |
+
return pattern.apply(
|
| 941 |
+
number, locale, decimal_quantization=decimal_quantization, group_separator=group_separator,
|
| 942 |
+
numbering_system=numbering_system,
|
| 943 |
+
)
|
| 944 |
+
|
| 945 |
+
|
| 946 |
+
def format_scientific(
|
| 947 |
+
number: float | decimal.Decimal | str,
|
| 948 |
+
format: str | NumberPattern | None = None,
|
| 949 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 950 |
+
decimal_quantization: bool = True,
|
| 951 |
+
*,
|
| 952 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 953 |
+
) -> str:
|
| 954 |
+
"""Return value formatted in scientific notation for a specific locale.
|
| 955 |
+
|
| 956 |
+
>>> format_scientific(10000, locale='en_US')
|
| 957 |
+
u'1E4'
|
| 958 |
+
>>> format_scientific(10000, locale='ar_EG', numbering_system='default')
|
| 959 |
+
u'1أس4'
|
| 960 |
+
|
| 961 |
+
The format pattern can also be specified explicitly:
|
| 962 |
+
|
| 963 |
+
>>> format_scientific(1234567, u'##0.##E00', locale='en_US')
|
| 964 |
+
u'1.23E06'
|
| 965 |
+
|
| 966 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 967 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 968 |
+
this behavior with the `decimal_quantization` parameter:
|
| 969 |
+
|
| 970 |
+
>>> format_scientific(1234.9876, u'#.##E0', locale='en_US')
|
| 971 |
+
u'1.23E3'
|
| 972 |
+
>>> format_scientific(1234.9876, u'#.##E0', locale='en_US', decimal_quantization=False)
|
| 973 |
+
u'1.2349876E3'
|
| 974 |
+
|
| 975 |
+
:param number: the number to format
|
| 976 |
+
:param format:
|
| 977 |
+
:param locale: the `Locale` object or locale identifier
|
| 978 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 979 |
+
the format pattern. Defaults to `True`.
|
| 980 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 981 |
+
The special value "default" will use the default numbering system of the locale.
|
| 982 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 983 |
+
"""
|
| 984 |
+
locale = Locale.parse(locale)
|
| 985 |
+
if not format:
|
| 986 |
+
format = locale.scientific_formats[None]
|
| 987 |
+
pattern = parse_pattern(format)
|
| 988 |
+
return pattern.apply(
|
| 989 |
+
number, locale, decimal_quantization=decimal_quantization, numbering_system=numbering_system)
|
| 990 |
+
|
| 991 |
+
|
| 992 |
+
class NumberFormatError(ValueError):
|
| 993 |
+
"""Exception raised when a string cannot be parsed into a number."""
|
| 994 |
+
|
| 995 |
+
def __init__(self, message: str, suggestions: list[str] | None = None) -> None:
|
| 996 |
+
super().__init__(message)
|
| 997 |
+
#: a list of properly formatted numbers derived from the invalid input
|
| 998 |
+
self.suggestions = suggestions
|
| 999 |
+
|
| 1000 |
+
|
| 1001 |
+
SPACE_CHARS = {
|
| 1002 |
+
' ', # space
|
| 1003 |
+
'\xa0', # no-break space
|
| 1004 |
+
'\u202f', # narrow no-break space
|
| 1005 |
+
}
|
| 1006 |
+
|
| 1007 |
+
SPACE_CHARS_RE = re.compile('|'.join(SPACE_CHARS))
|
| 1008 |
+
|
| 1009 |
+
|
| 1010 |
+
def parse_number(
|
| 1011 |
+
string: str,
|
| 1012 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 1013 |
+
*,
|
| 1014 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1015 |
+
) -> int:
|
| 1016 |
+
"""Parse localized number string into an integer.
|
| 1017 |
+
|
| 1018 |
+
>>> parse_number('1,099', locale='en_US')
|
| 1019 |
+
1099
|
| 1020 |
+
>>> parse_number('1.099', locale='de_DE')
|
| 1021 |
+
1099
|
| 1022 |
+
|
| 1023 |
+
When the given string cannot be parsed, an exception is raised:
|
| 1024 |
+
|
| 1025 |
+
>>> parse_number('1.099,98', locale='de')
|
| 1026 |
+
Traceback (most recent call last):
|
| 1027 |
+
...
|
| 1028 |
+
NumberFormatError: '1.099,98' is not a valid number
|
| 1029 |
+
|
| 1030 |
+
:param string: the string to parse
|
| 1031 |
+
:param locale: the `Locale` object or locale identifier
|
| 1032 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1033 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1034 |
+
:return: the parsed number
|
| 1035 |
+
:raise `NumberFormatError`: if the string can not be converted to a number
|
| 1036 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 1037 |
+
"""
|
| 1038 |
+
group_symbol = get_group_symbol(locale, numbering_system=numbering_system)
|
| 1039 |
+
|
| 1040 |
+
if (
|
| 1041 |
+
group_symbol in SPACE_CHARS and # if the grouping symbol is a kind of space,
|
| 1042 |
+
group_symbol not in string and # and the string to be parsed does not contain it,
|
| 1043 |
+
SPACE_CHARS_RE.search(string) # but it does contain any other kind of space instead,
|
| 1044 |
+
):
|
| 1045 |
+
# ... it's reasonable to assume it is taking the place of the grouping symbol.
|
| 1046 |
+
string = SPACE_CHARS_RE.sub(group_symbol, string)
|
| 1047 |
+
|
| 1048 |
+
try:
|
| 1049 |
+
return int(string.replace(group_symbol, ''))
|
| 1050 |
+
except ValueError as ve:
|
| 1051 |
+
raise NumberFormatError(f"{string!r} is not a valid number") from ve
|
| 1052 |
+
|
| 1053 |
+
|
| 1054 |
+
def parse_decimal(
|
| 1055 |
+
string: str,
|
| 1056 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 1057 |
+
strict: bool = False,
|
| 1058 |
+
*,
|
| 1059 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1060 |
+
) -> decimal.Decimal:
|
| 1061 |
+
"""Parse localized decimal string into a decimal.
|
| 1062 |
+
|
| 1063 |
+
>>> parse_decimal('1,099.98', locale='en_US')
|
| 1064 |
+
Decimal('1099.98')
|
| 1065 |
+
>>> parse_decimal('1.099,98', locale='de')
|
| 1066 |
+
Decimal('1099.98')
|
| 1067 |
+
>>> parse_decimal('12 345,123', locale='ru')
|
| 1068 |
+
Decimal('12345.123')
|
| 1069 |
+
>>> parse_decimal('1٬099٫98', locale='ar_EG', numbering_system='default')
|
| 1070 |
+
Decimal('1099.98')
|
| 1071 |
+
|
| 1072 |
+
When the given string cannot be parsed, an exception is raised:
|
| 1073 |
+
|
| 1074 |
+
>>> parse_decimal('2,109,998', locale='de')
|
| 1075 |
+
Traceback (most recent call last):
|
| 1076 |
+
...
|
| 1077 |
+
NumberFormatError: '2,109,998' is not a valid decimal number
|
| 1078 |
+
|
| 1079 |
+
If `strict` is set to `True` and the given string contains a number
|
| 1080 |
+
formatted in an irregular way, an exception is raised:
|
| 1081 |
+
|
| 1082 |
+
>>> parse_decimal('30.00', locale='de', strict=True)
|
| 1083 |
+
Traceback (most recent call last):
|
| 1084 |
+
...
|
| 1085 |
+
NumberFormatError: '30.00' is not a properly formatted decimal number. Did you mean '3.000'? Or maybe '30,00'?
|
| 1086 |
+
|
| 1087 |
+
>>> parse_decimal('0.00', locale='de', strict=True)
|
| 1088 |
+
Traceback (most recent call last):
|
| 1089 |
+
...
|
| 1090 |
+
NumberFormatError: '0.00' is not a properly formatted decimal number. Did you mean '0'?
|
| 1091 |
+
|
| 1092 |
+
:param string: the string to parse
|
| 1093 |
+
:param locale: the `Locale` object or locale identifier
|
| 1094 |
+
:param strict: controls whether numbers formatted in a weird way are
|
| 1095 |
+
accepted or rejected
|
| 1096 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1097 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1098 |
+
:raise NumberFormatError: if the string can not be converted to a
|
| 1099 |
+
decimal number
|
| 1100 |
+
:raise UnsupportedNumberingSystemError: if the numbering system is not supported by the locale.
|
| 1101 |
+
"""
|
| 1102 |
+
locale = Locale.parse(locale)
|
| 1103 |
+
group_symbol = get_group_symbol(locale, numbering_system=numbering_system)
|
| 1104 |
+
decimal_symbol = get_decimal_symbol(locale, numbering_system=numbering_system)
|
| 1105 |
+
|
| 1106 |
+
if not strict and (
|
| 1107 |
+
group_symbol in SPACE_CHARS and # if the grouping symbol is a kind of space,
|
| 1108 |
+
group_symbol not in string and # and the string to be parsed does not contain it,
|
| 1109 |
+
SPACE_CHARS_RE.search(string) # but it does contain any other kind of space instead,
|
| 1110 |
+
):
|
| 1111 |
+
# ... it's reasonable to assume it is taking the place of the grouping symbol.
|
| 1112 |
+
string = SPACE_CHARS_RE.sub(group_symbol, string)
|
| 1113 |
+
|
| 1114 |
+
try:
|
| 1115 |
+
parsed = decimal.Decimal(string.replace(group_symbol, '')
|
| 1116 |
+
.replace(decimal_symbol, '.'))
|
| 1117 |
+
except decimal.InvalidOperation as exc:
|
| 1118 |
+
raise NumberFormatError(f"{string!r} is not a valid decimal number") from exc
|
| 1119 |
+
if strict and group_symbol in string:
|
| 1120 |
+
proper = format_decimal(parsed, locale=locale, decimal_quantization=False, numbering_system=numbering_system)
|
| 1121 |
+
if string != proper and proper != _remove_trailing_zeros_after_decimal(string, decimal_symbol):
|
| 1122 |
+
try:
|
| 1123 |
+
parsed_alt = decimal.Decimal(string.replace(decimal_symbol, '')
|
| 1124 |
+
.replace(group_symbol, '.'))
|
| 1125 |
+
except decimal.InvalidOperation as exc:
|
| 1126 |
+
raise NumberFormatError(
|
| 1127 |
+
f"{string!r} is not a properly formatted decimal number. "
|
| 1128 |
+
f"Did you mean {proper!r}?",
|
| 1129 |
+
suggestions=[proper],
|
| 1130 |
+
) from exc
|
| 1131 |
+
else:
|
| 1132 |
+
proper_alt = format_decimal(
|
| 1133 |
+
parsed_alt,
|
| 1134 |
+
locale=locale,
|
| 1135 |
+
decimal_quantization=False,
|
| 1136 |
+
numbering_system=numbering_system,
|
| 1137 |
+
)
|
| 1138 |
+
if proper_alt == proper:
|
| 1139 |
+
raise NumberFormatError(
|
| 1140 |
+
f"{string!r} is not a properly formatted decimal number. "
|
| 1141 |
+
f"Did you mean {proper!r}?",
|
| 1142 |
+
suggestions=[proper],
|
| 1143 |
+
)
|
| 1144 |
+
else:
|
| 1145 |
+
raise NumberFormatError(
|
| 1146 |
+
f"{string!r} is not a properly formatted decimal number. "
|
| 1147 |
+
f"Did you mean {proper!r}? Or maybe {proper_alt!r}?",
|
| 1148 |
+
suggestions=[proper, proper_alt],
|
| 1149 |
+
)
|
| 1150 |
+
return parsed
|
| 1151 |
+
|
| 1152 |
+
|
| 1153 |
+
def _remove_trailing_zeros_after_decimal(string: str, decimal_symbol: str) -> str:
|
| 1154 |
+
"""
|
| 1155 |
+
Remove trailing zeros from the decimal part of a numeric string.
|
| 1156 |
+
|
| 1157 |
+
This function takes a string representing a numeric value and a decimal symbol.
|
| 1158 |
+
It removes any trailing zeros that appear after the decimal symbol in the number.
|
| 1159 |
+
If the decimal part becomes empty after removing trailing zeros, the decimal symbol
|
| 1160 |
+
is also removed. If the string does not contain the decimal symbol, it is returned unchanged.
|
| 1161 |
+
|
| 1162 |
+
:param string: The numeric string from which to remove trailing zeros.
|
| 1163 |
+
:type string: str
|
| 1164 |
+
:param decimal_symbol: The symbol used to denote the decimal point.
|
| 1165 |
+
:type decimal_symbol: str
|
| 1166 |
+
:return: The numeric string with trailing zeros removed from its decimal part.
|
| 1167 |
+
:rtype: str
|
| 1168 |
+
|
| 1169 |
+
Example:
|
| 1170 |
+
>>> _remove_trailing_zeros_after_decimal("123.4500", ".")
|
| 1171 |
+
'123.45'
|
| 1172 |
+
>>> _remove_trailing_zeros_after_decimal("100.000", ".")
|
| 1173 |
+
'100'
|
| 1174 |
+
>>> _remove_trailing_zeros_after_decimal("100", ".")
|
| 1175 |
+
'100'
|
| 1176 |
+
"""
|
| 1177 |
+
integer_part, _, decimal_part = string.partition(decimal_symbol)
|
| 1178 |
+
|
| 1179 |
+
if decimal_part:
|
| 1180 |
+
decimal_part = decimal_part.rstrip("0")
|
| 1181 |
+
if decimal_part:
|
| 1182 |
+
return integer_part + decimal_symbol + decimal_part
|
| 1183 |
+
return integer_part
|
| 1184 |
+
|
| 1185 |
+
return string
|
| 1186 |
+
|
| 1187 |
+
|
| 1188 |
+
PREFIX_END = r'[^0-9@#.,]'
|
| 1189 |
+
NUMBER_TOKEN = r'[0-9@#.,E+]'
|
| 1190 |
+
|
| 1191 |
+
PREFIX_PATTERN = r"(?P<prefix>(?:'[^']*'|%s)*)" % PREFIX_END
|
| 1192 |
+
NUMBER_PATTERN = r"(?P<number>%s*)" % NUMBER_TOKEN
|
| 1193 |
+
SUFFIX_PATTERN = r"(?P<suffix>.*)"
|
| 1194 |
+
|
| 1195 |
+
number_re = re.compile(f"{PREFIX_PATTERN}{NUMBER_PATTERN}{SUFFIX_PATTERN}")
|
| 1196 |
+
|
| 1197 |
+
|
| 1198 |
+
def parse_grouping(p: str) -> tuple[int, int]:
|
| 1199 |
+
"""Parse primary and secondary digit grouping
|
| 1200 |
+
|
| 1201 |
+
>>> parse_grouping('##')
|
| 1202 |
+
(1000, 1000)
|
| 1203 |
+
>>> parse_grouping('#,###')
|
| 1204 |
+
(3, 3)
|
| 1205 |
+
>>> parse_grouping('#,####,###')
|
| 1206 |
+
(3, 4)
|
| 1207 |
+
"""
|
| 1208 |
+
width = len(p)
|
| 1209 |
+
g1 = p.rfind(',')
|
| 1210 |
+
if g1 == -1:
|
| 1211 |
+
return 1000, 1000
|
| 1212 |
+
g1 = width - g1 - 1
|
| 1213 |
+
g2 = p[:-g1 - 1].rfind(',')
|
| 1214 |
+
if g2 == -1:
|
| 1215 |
+
return g1, g1
|
| 1216 |
+
g2 = width - g1 - g2 - 2
|
| 1217 |
+
return g1, g2
|
| 1218 |
+
|
| 1219 |
+
|
| 1220 |
+
def parse_pattern(pattern: NumberPattern | str) -> NumberPattern:
|
| 1221 |
+
"""Parse number format patterns"""
|
| 1222 |
+
if isinstance(pattern, NumberPattern):
|
| 1223 |
+
return pattern
|
| 1224 |
+
|
| 1225 |
+
def _match_number(pattern):
|
| 1226 |
+
rv = number_re.search(pattern)
|
| 1227 |
+
if rv is None:
|
| 1228 |
+
raise ValueError(f"Invalid number pattern {pattern!r}")
|
| 1229 |
+
return rv.groups()
|
| 1230 |
+
|
| 1231 |
+
pos_pattern = pattern
|
| 1232 |
+
|
| 1233 |
+
# Do we have a negative subpattern?
|
| 1234 |
+
if ';' in pattern:
|
| 1235 |
+
pos_pattern, neg_pattern = pattern.split(';', 1)
|
| 1236 |
+
pos_prefix, number, pos_suffix = _match_number(pos_pattern)
|
| 1237 |
+
neg_prefix, _, neg_suffix = _match_number(neg_pattern)
|
| 1238 |
+
else:
|
| 1239 |
+
pos_prefix, number, pos_suffix = _match_number(pos_pattern)
|
| 1240 |
+
neg_prefix = f"-{pos_prefix}"
|
| 1241 |
+
neg_suffix = pos_suffix
|
| 1242 |
+
if 'E' in number:
|
| 1243 |
+
number, exp = number.split('E', 1)
|
| 1244 |
+
else:
|
| 1245 |
+
exp = None
|
| 1246 |
+
if '@' in number and '.' in number and '0' in number:
|
| 1247 |
+
raise ValueError('Significant digit patterns can not contain "@" or "0"')
|
| 1248 |
+
if '.' in number:
|
| 1249 |
+
integer, fraction = number.rsplit('.', 1)
|
| 1250 |
+
else:
|
| 1251 |
+
integer = number
|
| 1252 |
+
fraction = ''
|
| 1253 |
+
|
| 1254 |
+
def parse_precision(p):
|
| 1255 |
+
"""Calculate the min and max allowed digits"""
|
| 1256 |
+
min = max = 0
|
| 1257 |
+
for c in p:
|
| 1258 |
+
if c in '@0':
|
| 1259 |
+
min += 1
|
| 1260 |
+
max += 1
|
| 1261 |
+
elif c == '#':
|
| 1262 |
+
max += 1
|
| 1263 |
+
elif c == ',':
|
| 1264 |
+
continue
|
| 1265 |
+
else:
|
| 1266 |
+
break
|
| 1267 |
+
return min, max
|
| 1268 |
+
|
| 1269 |
+
int_prec = parse_precision(integer)
|
| 1270 |
+
frac_prec = parse_precision(fraction)
|
| 1271 |
+
if exp:
|
| 1272 |
+
exp_plus = exp.startswith('+')
|
| 1273 |
+
exp = exp.lstrip('+')
|
| 1274 |
+
exp_prec = parse_precision(exp)
|
| 1275 |
+
else:
|
| 1276 |
+
exp_plus = None
|
| 1277 |
+
exp_prec = None
|
| 1278 |
+
grouping = parse_grouping(integer)
|
| 1279 |
+
return NumberPattern(pattern, (pos_prefix, neg_prefix),
|
| 1280 |
+
(pos_suffix, neg_suffix), grouping,
|
| 1281 |
+
int_prec, frac_prec,
|
| 1282 |
+
exp_prec, exp_plus, number)
|
| 1283 |
+
|
| 1284 |
+
|
| 1285 |
+
class NumberPattern:
|
| 1286 |
+
|
| 1287 |
+
def __init__(
|
| 1288 |
+
self,
|
| 1289 |
+
pattern: str,
|
| 1290 |
+
prefix: tuple[str, str],
|
| 1291 |
+
suffix: tuple[str, str],
|
| 1292 |
+
grouping: tuple[int, int],
|
| 1293 |
+
int_prec: tuple[int, int],
|
| 1294 |
+
frac_prec: tuple[int, int],
|
| 1295 |
+
exp_prec: tuple[int, int] | None,
|
| 1296 |
+
exp_plus: bool | None,
|
| 1297 |
+
number_pattern: str | None = None,
|
| 1298 |
+
) -> None:
|
| 1299 |
+
# Metadata of the decomposed parsed pattern.
|
| 1300 |
+
self.pattern = pattern
|
| 1301 |
+
self.prefix = prefix
|
| 1302 |
+
self.suffix = suffix
|
| 1303 |
+
self.number_pattern = number_pattern
|
| 1304 |
+
self.grouping = grouping
|
| 1305 |
+
self.int_prec = int_prec
|
| 1306 |
+
self.frac_prec = frac_prec
|
| 1307 |
+
self.exp_prec = exp_prec
|
| 1308 |
+
self.exp_plus = exp_plus
|
| 1309 |
+
self.scale = self.compute_scale()
|
| 1310 |
+
|
| 1311 |
+
def __repr__(self) -> str:
|
| 1312 |
+
return f"<{type(self).__name__} {self.pattern!r}>"
|
| 1313 |
+
|
| 1314 |
+
def compute_scale(self) -> Literal[0, 2, 3]:
|
| 1315 |
+
"""Return the scaling factor to apply to the number before rendering.
|
| 1316 |
+
|
| 1317 |
+
Auto-set to a factor of 2 or 3 if presence of a ``%`` or ``‰`` sign is
|
| 1318 |
+
detected in the prefix or suffix of the pattern. Default is to not mess
|
| 1319 |
+
with the scale at all and keep it to 0.
|
| 1320 |
+
"""
|
| 1321 |
+
scale = 0
|
| 1322 |
+
if '%' in ''.join(self.prefix + self.suffix):
|
| 1323 |
+
scale = 2
|
| 1324 |
+
elif '‰' in ''.join(self.prefix + self.suffix):
|
| 1325 |
+
scale = 3
|
| 1326 |
+
return scale
|
| 1327 |
+
|
| 1328 |
+
def scientific_notation_elements(
|
| 1329 |
+
self,
|
| 1330 |
+
value: decimal.Decimal,
|
| 1331 |
+
locale: Locale | str | None,
|
| 1332 |
+
*,
|
| 1333 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1334 |
+
) -> tuple[decimal.Decimal, int, str]:
|
| 1335 |
+
""" Returns normalized scientific notation components of a value.
|
| 1336 |
+
"""
|
| 1337 |
+
# Normalize value to only have one lead digit.
|
| 1338 |
+
exp = value.adjusted()
|
| 1339 |
+
value = value * get_decimal_quantum(exp)
|
| 1340 |
+
assert value.adjusted() == 0
|
| 1341 |
+
|
| 1342 |
+
# Shift exponent and value by the minimum number of leading digits
|
| 1343 |
+
# imposed by the rendering pattern. And always make that number
|
| 1344 |
+
# greater or equal to 1.
|
| 1345 |
+
lead_shift = max([1, min(self.int_prec)]) - 1
|
| 1346 |
+
exp = exp - lead_shift
|
| 1347 |
+
value = value * get_decimal_quantum(-lead_shift)
|
| 1348 |
+
|
| 1349 |
+
# Get exponent sign symbol.
|
| 1350 |
+
exp_sign = ''
|
| 1351 |
+
if exp < 0:
|
| 1352 |
+
exp_sign = get_minus_sign_symbol(locale, numbering_system=numbering_system)
|
| 1353 |
+
elif self.exp_plus:
|
| 1354 |
+
exp_sign = get_plus_sign_symbol(locale, numbering_system=numbering_system)
|
| 1355 |
+
|
| 1356 |
+
# Normalize exponent value now that we have the sign.
|
| 1357 |
+
exp = abs(exp)
|
| 1358 |
+
|
| 1359 |
+
return value, exp, exp_sign
|
| 1360 |
+
|
| 1361 |
+
def apply(
|
| 1362 |
+
self,
|
| 1363 |
+
value: float | decimal.Decimal | str,
|
| 1364 |
+
locale: Locale | str | None,
|
| 1365 |
+
currency: str | None = None,
|
| 1366 |
+
currency_digits: bool = True,
|
| 1367 |
+
decimal_quantization: bool = True,
|
| 1368 |
+
force_frac: tuple[int, int] | None = None,
|
| 1369 |
+
group_separator: bool = True,
|
| 1370 |
+
*,
|
| 1371 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1372 |
+
):
|
| 1373 |
+
"""Renders into a string a number following the defined pattern.
|
| 1374 |
+
|
| 1375 |
+
Forced decimal quantization is active by default so we'll produce a
|
| 1376 |
+
number string that is strictly following CLDR pattern definitions.
|
| 1377 |
+
|
| 1378 |
+
:param value: The value to format. If this is not a Decimal object,
|
| 1379 |
+
it will be cast to one.
|
| 1380 |
+
:type value: decimal.Decimal|float|int
|
| 1381 |
+
:param locale: The locale to use for formatting.
|
| 1382 |
+
:type locale: str|babel.core.Locale
|
| 1383 |
+
:param currency: Which currency, if any, to format as.
|
| 1384 |
+
:type currency: str|None
|
| 1385 |
+
:param currency_digits: Whether or not to use the currency's precision.
|
| 1386 |
+
If false, the pattern's precision is used.
|
| 1387 |
+
:type currency_digits: bool
|
| 1388 |
+
:param decimal_quantization: Whether decimal numbers should be forcibly
|
| 1389 |
+
quantized to produce a formatted output
|
| 1390 |
+
strictly matching the CLDR definition for
|
| 1391 |
+
the locale.
|
| 1392 |
+
:type decimal_quantization: bool
|
| 1393 |
+
:param force_frac: DEPRECATED - a forced override for `self.frac_prec`
|
| 1394 |
+
for a single formatting invocation.
|
| 1395 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1396 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1397 |
+
:return: Formatted decimal string.
|
| 1398 |
+
:rtype: str
|
| 1399 |
+
:raise UnsupportedNumberingSystemError: If the numbering system is not supported by the locale.
|
| 1400 |
+
"""
|
| 1401 |
+
if not isinstance(value, decimal.Decimal):
|
| 1402 |
+
value = decimal.Decimal(str(value))
|
| 1403 |
+
|
| 1404 |
+
value = value.scaleb(self.scale)
|
| 1405 |
+
|
| 1406 |
+
# Separate the absolute value from its sign.
|
| 1407 |
+
is_negative = int(value.is_signed())
|
| 1408 |
+
value = abs(value).normalize()
|
| 1409 |
+
|
| 1410 |
+
# Prepare scientific notation metadata.
|
| 1411 |
+
if self.exp_prec:
|
| 1412 |
+
value, exp, exp_sign = self.scientific_notation_elements(value, locale, numbering_system=numbering_system)
|
| 1413 |
+
|
| 1414 |
+
# Adjust the precision of the fractional part and force it to the
|
| 1415 |
+
# currency's if necessary.
|
| 1416 |
+
if force_frac:
|
| 1417 |
+
# TODO (3.x?): Remove this parameter
|
| 1418 |
+
warnings.warn(
|
| 1419 |
+
'The force_frac parameter to NumberPattern.apply() is deprecated.',
|
| 1420 |
+
DeprecationWarning,
|
| 1421 |
+
stacklevel=2,
|
| 1422 |
+
)
|
| 1423 |
+
frac_prec = force_frac
|
| 1424 |
+
elif currency and currency_digits:
|
| 1425 |
+
frac_prec = (get_currency_precision(currency), ) * 2
|
| 1426 |
+
else:
|
| 1427 |
+
frac_prec = self.frac_prec
|
| 1428 |
+
|
| 1429 |
+
# Bump decimal precision to the natural precision of the number if it
|
| 1430 |
+
# exceeds the one we're about to use. This adaptative precision is only
|
| 1431 |
+
# triggered if the decimal quantization is disabled or if a scientific
|
| 1432 |
+
# notation pattern has a missing mandatory fractional part (as in the
|
| 1433 |
+
# default '#E0' pattern). This special case has been extensively
|
| 1434 |
+
# discussed at https://github.com/python-babel/babel/pull/494#issuecomment-307649969 .
|
| 1435 |
+
if not decimal_quantization or (self.exp_prec and frac_prec == (0, 0)):
|
| 1436 |
+
frac_prec = (frac_prec[0], max([frac_prec[1], get_decimal_precision(value)]))
|
| 1437 |
+
|
| 1438 |
+
# Render scientific notation.
|
| 1439 |
+
if self.exp_prec:
|
| 1440 |
+
number = ''.join([
|
| 1441 |
+
self._quantize_value(value, locale, frac_prec, group_separator, numbering_system=numbering_system),
|
| 1442 |
+
get_exponential_symbol(locale, numbering_system=numbering_system),
|
| 1443 |
+
exp_sign, # type: ignore # exp_sign is always defined here
|
| 1444 |
+
self._format_int(str(exp), self.exp_prec[0], self.exp_prec[1], locale, numbering_system=numbering_system), # type: ignore # exp is always defined here
|
| 1445 |
+
])
|
| 1446 |
+
|
| 1447 |
+
# Is it a significant digits pattern?
|
| 1448 |
+
elif '@' in self.pattern:
|
| 1449 |
+
text = self._format_significant(value,
|
| 1450 |
+
self.int_prec[0],
|
| 1451 |
+
self.int_prec[1])
|
| 1452 |
+
a, sep, b = text.partition(".")
|
| 1453 |
+
number = self._format_int(a, 0, 1000, locale, numbering_system=numbering_system)
|
| 1454 |
+
if sep:
|
| 1455 |
+
number += get_decimal_symbol(locale, numbering_system=numbering_system) + b
|
| 1456 |
+
|
| 1457 |
+
# A normal number pattern.
|
| 1458 |
+
else:
|
| 1459 |
+
number = self._quantize_value(value, locale, frac_prec, group_separator, numbering_system=numbering_system)
|
| 1460 |
+
|
| 1461 |
+
retval = ''.join([
|
| 1462 |
+
self.prefix[is_negative],
|
| 1463 |
+
number if self.number_pattern != '' else '',
|
| 1464 |
+
self.suffix[is_negative]])
|
| 1465 |
+
|
| 1466 |
+
if '¤' in retval and currency is not None:
|
| 1467 |
+
retval = retval.replace('¤¤¤', get_currency_name(currency, value, locale))
|
| 1468 |
+
retval = retval.replace('¤¤', currency.upper())
|
| 1469 |
+
retval = retval.replace('¤', get_currency_symbol(currency, locale))
|
| 1470 |
+
|
| 1471 |
+
# remove single quotes around text, except for doubled single quotes
|
| 1472 |
+
# which are replaced with a single quote
|
| 1473 |
+
retval = re.sub(r"'([^']*)'", lambda m: m.group(1) or "'", retval)
|
| 1474 |
+
|
| 1475 |
+
return retval
|
| 1476 |
+
|
| 1477 |
+
#
|
| 1478 |
+
# This is one tricky piece of code. The idea is to rely as much as possible
|
| 1479 |
+
# on the decimal module to minimize the amount of code.
|
| 1480 |
+
#
|
| 1481 |
+
# Conceptually, the implementation of this method can be summarized in the
|
| 1482 |
+
# following steps:
|
| 1483 |
+
#
|
| 1484 |
+
# - Move or shift the decimal point (i.e. the exponent) so the maximum
|
| 1485 |
+
# amount of significant digits fall into the integer part (i.e. to the
|
| 1486 |
+
# left of the decimal point)
|
| 1487 |
+
#
|
| 1488 |
+
# - Round the number to the nearest integer, discarding all the fractional
|
| 1489 |
+
# part which contained extra digits to be eliminated
|
| 1490 |
+
#
|
| 1491 |
+
# - Convert the rounded integer to a string, that will contain the final
|
| 1492 |
+
# sequence of significant digits already trimmed to the maximum
|
| 1493 |
+
#
|
| 1494 |
+
# - Restore the original position of the decimal point, potentially
|
| 1495 |
+
# padding with zeroes on either side
|
| 1496 |
+
#
|
| 1497 |
+
def _format_significant(self, value: decimal.Decimal, minimum: int, maximum: int) -> str:
|
| 1498 |
+
exp = value.adjusted()
|
| 1499 |
+
scale = maximum - 1 - exp
|
| 1500 |
+
digits = str(value.scaleb(scale).quantize(decimal.Decimal(1)))
|
| 1501 |
+
if scale <= 0:
|
| 1502 |
+
result = digits + '0' * -scale
|
| 1503 |
+
else:
|
| 1504 |
+
intpart = digits[:-scale]
|
| 1505 |
+
i = len(intpart)
|
| 1506 |
+
j = i + max(minimum - i, 0)
|
| 1507 |
+
result = "{intpart}.{pad:0<{fill}}{fracpart}{fracextra}".format(
|
| 1508 |
+
intpart=intpart or '0',
|
| 1509 |
+
pad='',
|
| 1510 |
+
fill=-min(exp + 1, 0),
|
| 1511 |
+
fracpart=digits[i:j],
|
| 1512 |
+
fracextra=digits[j:].rstrip('0'),
|
| 1513 |
+
).rstrip('.')
|
| 1514 |
+
return result
|
| 1515 |
+
|
| 1516 |
+
def _format_int(
|
| 1517 |
+
self,
|
| 1518 |
+
value: str,
|
| 1519 |
+
min: int,
|
| 1520 |
+
max: int,
|
| 1521 |
+
locale: Locale | str | None,
|
| 1522 |
+
*,
|
| 1523 |
+
numbering_system: Literal["default"] | str,
|
| 1524 |
+
) -> str:
|
| 1525 |
+
width = len(value)
|
| 1526 |
+
if width < min:
|
| 1527 |
+
value = '0' * (min - width) + value
|
| 1528 |
+
gsize = self.grouping[0]
|
| 1529 |
+
ret = ''
|
| 1530 |
+
symbol = get_group_symbol(locale, numbering_system=numbering_system)
|
| 1531 |
+
while len(value) > gsize:
|
| 1532 |
+
ret = symbol + value[-gsize:] + ret
|
| 1533 |
+
value = value[:-gsize]
|
| 1534 |
+
gsize = self.grouping[1]
|
| 1535 |
+
return value + ret
|
| 1536 |
+
|
| 1537 |
+
def _quantize_value(
|
| 1538 |
+
self,
|
| 1539 |
+
value: decimal.Decimal,
|
| 1540 |
+
locale: Locale | str | None,
|
| 1541 |
+
frac_prec: tuple[int, int],
|
| 1542 |
+
group_separator: bool,
|
| 1543 |
+
*,
|
| 1544 |
+
numbering_system: Literal["default"] | str,
|
| 1545 |
+
) -> str:
|
| 1546 |
+
# If the number is +/-Infinity, we can't quantize it
|
| 1547 |
+
if value.is_infinite():
|
| 1548 |
+
return get_infinity_symbol(locale, numbering_system=numbering_system)
|
| 1549 |
+
quantum = get_decimal_quantum(frac_prec[1])
|
| 1550 |
+
rounded = value.quantize(quantum)
|
| 1551 |
+
a, sep, b = f"{rounded:f}".partition(".")
|
| 1552 |
+
integer_part = a
|
| 1553 |
+
if group_separator:
|
| 1554 |
+
integer_part = self._format_int(a, self.int_prec[0], self.int_prec[1], locale, numbering_system=numbering_system)
|
| 1555 |
+
number = integer_part + self._format_frac(b or '0', locale=locale, force_frac=frac_prec, numbering_system=numbering_system)
|
| 1556 |
+
return number
|
| 1557 |
+
|
| 1558 |
+
def _format_frac(
|
| 1559 |
+
self,
|
| 1560 |
+
value: str,
|
| 1561 |
+
locale: Locale | str | None,
|
| 1562 |
+
force_frac: tuple[int, int] | None = None,
|
| 1563 |
+
*,
|
| 1564 |
+
numbering_system: Literal["default"] | str,
|
| 1565 |
+
) -> str:
|
| 1566 |
+
min, max = force_frac or self.frac_prec
|
| 1567 |
+
if len(value) < min:
|
| 1568 |
+
value += ('0' * (min - len(value)))
|
| 1569 |
+
if max == 0 or (min == 0 and int(value) == 0):
|
| 1570 |
+
return ''
|
| 1571 |
+
while len(value) > min and value[-1] == '0':
|
| 1572 |
+
value = value[:-1]
|
| 1573 |
+
return get_decimal_symbol(locale, numbering_system=numbering_system) + value
|
SPFsmartGATE/LIVE/TMP/babel/babel/plural.py
ADDED
|
@@ -0,0 +1,640 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.numbers
|
| 3 |
+
~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
CLDR Plural support. See UTS #35.
|
| 6 |
+
|
| 7 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 8 |
+
:license: BSD, see LICENSE for more details.
|
| 9 |
+
"""
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import decimal
|
| 13 |
+
import re
|
| 14 |
+
from collections.abc import Iterable, Mapping
|
| 15 |
+
from typing import TYPE_CHECKING, Any, Callable
|
| 16 |
+
|
| 17 |
+
if TYPE_CHECKING:
|
| 18 |
+
from typing_extensions import Literal
|
| 19 |
+
|
| 20 |
+
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
|
| 21 |
+
_fallback_tag = 'other'
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def extract_operands(source: float | decimal.Decimal) -> tuple[decimal.Decimal | int, int, int, int, int, int, Literal[0], Literal[0]]:
|
| 25 |
+
"""Extract operands from a decimal, a float or an int, according to `CLDR rules`_.
|
| 26 |
+
|
| 27 |
+
The result is an 8-tuple (n, i, v, w, f, t, c, e), where those symbols are as follows:
|
| 28 |
+
|
| 29 |
+
====== ===============================================================
|
| 30 |
+
Symbol Value
|
| 31 |
+
------ ---------------------------------------------------------------
|
| 32 |
+
n absolute value of the source number (integer and decimals).
|
| 33 |
+
i integer digits of n.
|
| 34 |
+
v number of visible fraction digits in n, with trailing zeros.
|
| 35 |
+
w number of visible fraction digits in n, without trailing zeros.
|
| 36 |
+
f visible fractional digits in n, with trailing zeros.
|
| 37 |
+
t visible fractional digits in n, without trailing zeros.
|
| 38 |
+
c compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
|
| 39 |
+
e currently, synonym for ‘c’. however, may be redefined in the future.
|
| 40 |
+
====== ===============================================================
|
| 41 |
+
|
| 42 |
+
.. _`CLDR rules`: https://www.unicode.org/reports/tr35/tr35-61/tr35-numbers.html#Operands
|
| 43 |
+
|
| 44 |
+
:param source: A real number
|
| 45 |
+
:type source: int|float|decimal.Decimal
|
| 46 |
+
:return: A n-i-v-w-f-t-c-e tuple
|
| 47 |
+
:rtype: tuple[decimal.Decimal, int, int, int, int, int, int, int]
|
| 48 |
+
"""
|
| 49 |
+
n = abs(source)
|
| 50 |
+
i = int(n)
|
| 51 |
+
if isinstance(n, float):
|
| 52 |
+
if i == n:
|
| 53 |
+
n = i
|
| 54 |
+
else:
|
| 55 |
+
# Cast the `float` to a number via the string representation.
|
| 56 |
+
# This is required for Python 2.6 anyway (it will straight out fail to
|
| 57 |
+
# do the conversion otherwise), and it's highly unlikely that the user
|
| 58 |
+
# actually wants the lossless conversion behavior (quoting the Python
|
| 59 |
+
# documentation):
|
| 60 |
+
# > If value is a float, the binary floating point value is losslessly
|
| 61 |
+
# > converted to its exact decimal equivalent.
|
| 62 |
+
# > This conversion can often require 53 or more digits of precision.
|
| 63 |
+
# Should the user want that behavior, they can simply pass in a pre-
|
| 64 |
+
# converted `Decimal` instance of desired accuracy.
|
| 65 |
+
n = decimal.Decimal(str(n))
|
| 66 |
+
|
| 67 |
+
if isinstance(n, decimal.Decimal):
|
| 68 |
+
dec_tuple = n.as_tuple()
|
| 69 |
+
exp = dec_tuple.exponent
|
| 70 |
+
fraction_digits = dec_tuple.digits[exp:] if exp < 0 else ()
|
| 71 |
+
trailing = ''.join(str(d) for d in fraction_digits)
|
| 72 |
+
no_trailing = trailing.rstrip('0')
|
| 73 |
+
v = len(trailing)
|
| 74 |
+
w = len(no_trailing)
|
| 75 |
+
f = int(trailing or 0)
|
| 76 |
+
t = int(no_trailing or 0)
|
| 77 |
+
else:
|
| 78 |
+
v = w = f = t = 0
|
| 79 |
+
c = e = 0 # TODO: c and e are not supported
|
| 80 |
+
return n, i, v, w, f, t, c, e
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
class PluralRule:
|
| 84 |
+
"""Represents a set of language pluralization rules. The constructor
|
| 85 |
+
accepts a list of (tag, expr) tuples or a dict of `CLDR rules`_. The
|
| 86 |
+
resulting object is callable and accepts one parameter with a positive or
|
| 87 |
+
negative number (both integer and float) for the number that indicates the
|
| 88 |
+
plural form for a string and returns the tag for the format:
|
| 89 |
+
|
| 90 |
+
>>> rule = PluralRule({'one': 'n is 1'})
|
| 91 |
+
>>> rule(1)
|
| 92 |
+
'one'
|
| 93 |
+
>>> rule(2)
|
| 94 |
+
'other'
|
| 95 |
+
|
| 96 |
+
Currently the CLDR defines these tags: zero, one, two, few, many and
|
| 97 |
+
other where other is an implicit default. Rules should be mutually
|
| 98 |
+
exclusive; for a given numeric value, only one rule should apply (i.e.
|
| 99 |
+
the condition should only be true for one of the plural rule elements.
|
| 100 |
+
|
| 101 |
+
.. _`CLDR rules`: https://www.unicode.org/reports/tr35/tr35-33/tr35-numbers.html#Language_Plural_Rules
|
| 102 |
+
"""
|
| 103 |
+
|
| 104 |
+
__slots__ = ('abstract', '_func')
|
| 105 |
+
|
| 106 |
+
def __init__(self, rules: Mapping[str, str] | Iterable[tuple[str, str]]) -> None:
|
| 107 |
+
"""Initialize the rule instance.
|
| 108 |
+
|
| 109 |
+
:param rules: a list of ``(tag, expr)``) tuples with the rules
|
| 110 |
+
conforming to UTS #35 or a dict with the tags as keys
|
| 111 |
+
and expressions as values.
|
| 112 |
+
:raise RuleError: if the expression is malformed
|
| 113 |
+
"""
|
| 114 |
+
if isinstance(rules, Mapping):
|
| 115 |
+
rules = rules.items()
|
| 116 |
+
found = set()
|
| 117 |
+
self.abstract: list[tuple[str, Any]] = []
|
| 118 |
+
for key, expr in sorted(rules):
|
| 119 |
+
if key not in _plural_tags:
|
| 120 |
+
raise ValueError(f"unknown tag {key!r}")
|
| 121 |
+
elif key in found:
|
| 122 |
+
raise ValueError(f"tag {key!r} defined twice")
|
| 123 |
+
found.add(key)
|
| 124 |
+
ast = _Parser(expr).ast
|
| 125 |
+
if ast:
|
| 126 |
+
self.abstract.append((key, ast))
|
| 127 |
+
|
| 128 |
+
def __repr__(self) -> str:
|
| 129 |
+
rules = self.rules
|
| 130 |
+
args = ", ".join([f"{tag}: {rules[tag]}" for tag in _plural_tags if tag in rules])
|
| 131 |
+
return f"<{type(self).__name__} {args!r}>"
|
| 132 |
+
|
| 133 |
+
@classmethod
|
| 134 |
+
def parse(cls, rules: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> PluralRule:
|
| 135 |
+
"""Create a `PluralRule` instance for the given rules. If the rules
|
| 136 |
+
are a `PluralRule` object, that object is returned.
|
| 137 |
+
|
| 138 |
+
:param rules: the rules as list or dict, or a `PluralRule` object
|
| 139 |
+
:raise RuleError: if the expression is malformed
|
| 140 |
+
"""
|
| 141 |
+
if isinstance(rules, PluralRule):
|
| 142 |
+
return rules
|
| 143 |
+
return cls(rules)
|
| 144 |
+
|
| 145 |
+
@property
|
| 146 |
+
def rules(self) -> Mapping[str, str]:
|
| 147 |
+
"""The `PluralRule` as a dict of unicode plural rules.
|
| 148 |
+
|
| 149 |
+
>>> rule = PluralRule({'one': 'n is 1'})
|
| 150 |
+
>>> rule.rules
|
| 151 |
+
{'one': 'n is 1'}
|
| 152 |
+
"""
|
| 153 |
+
_compile = _UnicodeCompiler().compile
|
| 154 |
+
return {tag: _compile(ast) for tag, ast in self.abstract}
|
| 155 |
+
|
| 156 |
+
@property
|
| 157 |
+
def tags(self) -> frozenset[str]:
|
| 158 |
+
"""A set of explicitly defined tags in this rule. The implicit default
|
| 159 |
+
``'other'`` rules is not part of this set unless there is an explicit
|
| 160 |
+
rule for it.
|
| 161 |
+
"""
|
| 162 |
+
return frozenset(i[0] for i in self.abstract)
|
| 163 |
+
|
| 164 |
+
def __getstate__(self) -> list[tuple[str, Any]]:
|
| 165 |
+
return self.abstract
|
| 166 |
+
|
| 167 |
+
def __setstate__(self, abstract: list[tuple[str, Any]]) -> None:
|
| 168 |
+
self.abstract = abstract
|
| 169 |
+
|
| 170 |
+
def __call__(self, n: float | decimal.Decimal) -> str:
|
| 171 |
+
if not hasattr(self, '_func'):
|
| 172 |
+
self._func = to_python(self)
|
| 173 |
+
return self._func(n)
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
def to_javascript(rule: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> str:
|
| 177 |
+
"""Convert a list/dict of rules or a `PluralRule` object into a JavaScript
|
| 178 |
+
function. This function depends on no external library:
|
| 179 |
+
|
| 180 |
+
>>> to_javascript({'one': 'n is 1'})
|
| 181 |
+
"(function(n) { return (n == 1) ? 'one' : 'other'; })"
|
| 182 |
+
|
| 183 |
+
Implementation detail: The function generated will probably evaluate
|
| 184 |
+
expressions involved into range operations multiple times. This has the
|
| 185 |
+
advantage that external helper functions are not required and is not a
|
| 186 |
+
big performance hit for these simple calculations.
|
| 187 |
+
|
| 188 |
+
:param rule: the rules as list or dict, or a `PluralRule` object
|
| 189 |
+
:raise RuleError: if the expression is malformed
|
| 190 |
+
"""
|
| 191 |
+
to_js = _JavaScriptCompiler().compile
|
| 192 |
+
result = ['(function(n) { return ']
|
| 193 |
+
for tag, ast in PluralRule.parse(rule).abstract:
|
| 194 |
+
result.append(f"{to_js(ast)} ? {tag!r} : ")
|
| 195 |
+
result.append('%r; })' % _fallback_tag)
|
| 196 |
+
return ''.join(result)
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
def to_python(rule: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> Callable[[float | decimal.Decimal], str]:
|
| 200 |
+
"""Convert a list/dict of rules or a `PluralRule` object into a regular
|
| 201 |
+
Python function. This is useful in situations where you need a real
|
| 202 |
+
function and don't are about the actual rule object:
|
| 203 |
+
|
| 204 |
+
>>> func = to_python({'one': 'n is 1', 'few': 'n in 2..4'})
|
| 205 |
+
>>> func(1)
|
| 206 |
+
'one'
|
| 207 |
+
>>> func(3)
|
| 208 |
+
'few'
|
| 209 |
+
>>> func = to_python({'one': 'n in 1,11', 'few': 'n in 3..10,13..19'})
|
| 210 |
+
>>> func(11)
|
| 211 |
+
'one'
|
| 212 |
+
>>> func(15)
|
| 213 |
+
'few'
|
| 214 |
+
|
| 215 |
+
:param rule: the rules as list or dict, or a `PluralRule` object
|
| 216 |
+
:raise RuleError: if the expression is malformed
|
| 217 |
+
"""
|
| 218 |
+
namespace = {
|
| 219 |
+
'IN': in_range_list,
|
| 220 |
+
'WITHIN': within_range_list,
|
| 221 |
+
'MOD': cldr_modulo,
|
| 222 |
+
'extract_operands': extract_operands,
|
| 223 |
+
}
|
| 224 |
+
to_python_func = _PythonCompiler().compile
|
| 225 |
+
result = [
|
| 226 |
+
'def evaluate(n):',
|
| 227 |
+
' n, i, v, w, f, t, c, e = extract_operands(n)',
|
| 228 |
+
]
|
| 229 |
+
for tag, ast in PluralRule.parse(rule).abstract:
|
| 230 |
+
# the str() call is to coerce the tag to the native string. It's
|
| 231 |
+
# a limited ascii restricted set of tags anyways so that is fine.
|
| 232 |
+
result.append(f" if ({to_python_func(ast)}): return {str(tag)!r}")
|
| 233 |
+
result.append(f" return {_fallback_tag!r}")
|
| 234 |
+
code = compile('\n'.join(result), '<rule>', 'exec')
|
| 235 |
+
eval(code, namespace)
|
| 236 |
+
return namespace['evaluate']
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
def to_gettext(rule: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> str:
|
| 240 |
+
"""The plural rule as gettext expression. The gettext expression is
|
| 241 |
+
technically limited to integers and returns indices rather than tags.
|
| 242 |
+
|
| 243 |
+
>>> to_gettext({'one': 'n is 1', 'two': 'n is 2'})
|
| 244 |
+
'nplurals=3; plural=((n == 1) ? 0 : (n == 2) ? 1 : 2);'
|
| 245 |
+
|
| 246 |
+
:param rule: the rules as list or dict, or a `PluralRule` object
|
| 247 |
+
:raise RuleError: if the expression is malformed
|
| 248 |
+
"""
|
| 249 |
+
rule = PluralRule.parse(rule)
|
| 250 |
+
|
| 251 |
+
used_tags = rule.tags | {_fallback_tag}
|
| 252 |
+
_compile = _GettextCompiler().compile
|
| 253 |
+
_get_index = [tag for tag in _plural_tags if tag in used_tags].index
|
| 254 |
+
|
| 255 |
+
result = [f"nplurals={len(used_tags)}; plural=("]
|
| 256 |
+
for tag, ast in rule.abstract:
|
| 257 |
+
result.append(f"{_compile(ast)} ? {_get_index(tag)} : ")
|
| 258 |
+
result.append(f"{_get_index(_fallback_tag)});")
|
| 259 |
+
return ''.join(result)
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
def in_range_list(num: float | decimal.Decimal, range_list: Iterable[Iterable[float | decimal.Decimal]]) -> bool:
|
| 263 |
+
"""Integer range list test. This is the callback for the "in" operator
|
| 264 |
+
of the UTS #35 pluralization rule language:
|
| 265 |
+
|
| 266 |
+
>>> in_range_list(1, [(1, 3)])
|
| 267 |
+
True
|
| 268 |
+
>>> in_range_list(3, [(1, 3)])
|
| 269 |
+
True
|
| 270 |
+
>>> in_range_list(3, [(1, 3), (5, 8)])
|
| 271 |
+
True
|
| 272 |
+
>>> in_range_list(1.2, [(1, 4)])
|
| 273 |
+
False
|
| 274 |
+
>>> in_range_list(10, [(1, 4)])
|
| 275 |
+
False
|
| 276 |
+
>>> in_range_list(10, [(1, 4), (6, 8)])
|
| 277 |
+
False
|
| 278 |
+
"""
|
| 279 |
+
return num == int(num) and within_range_list(num, range_list)
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
def within_range_list(num: float | decimal.Decimal, range_list: Iterable[Iterable[float | decimal.Decimal]]) -> bool:
|
| 283 |
+
"""Float range test. This is the callback for the "within" operator
|
| 284 |
+
of the UTS #35 pluralization rule language:
|
| 285 |
+
|
| 286 |
+
>>> within_range_list(1, [(1, 3)])
|
| 287 |
+
True
|
| 288 |
+
>>> within_range_list(1.0, [(1, 3)])
|
| 289 |
+
True
|
| 290 |
+
>>> within_range_list(1.2, [(1, 4)])
|
| 291 |
+
True
|
| 292 |
+
>>> within_range_list(8.8, [(1, 4), (7, 15)])
|
| 293 |
+
True
|
| 294 |
+
>>> within_range_list(10, [(1, 4)])
|
| 295 |
+
False
|
| 296 |
+
>>> within_range_list(10.5, [(1, 4), (20, 30)])
|
| 297 |
+
False
|
| 298 |
+
"""
|
| 299 |
+
return any(num >= min_ and num <= max_ for min_, max_ in range_list)
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
def cldr_modulo(a: float, b: float) -> float:
|
| 303 |
+
"""Javaish modulo. This modulo operator returns the value with the sign
|
| 304 |
+
of the dividend rather than the divisor like Python does:
|
| 305 |
+
|
| 306 |
+
>>> cldr_modulo(-3, 5)
|
| 307 |
+
-3
|
| 308 |
+
>>> cldr_modulo(-3, -5)
|
| 309 |
+
-3
|
| 310 |
+
>>> cldr_modulo(3, 5)
|
| 311 |
+
3
|
| 312 |
+
"""
|
| 313 |
+
reverse = 0
|
| 314 |
+
if a < 0:
|
| 315 |
+
a *= -1
|
| 316 |
+
reverse = 1
|
| 317 |
+
if b < 0:
|
| 318 |
+
b *= -1
|
| 319 |
+
rv = a % b
|
| 320 |
+
if reverse:
|
| 321 |
+
rv *= -1
|
| 322 |
+
return rv
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
class RuleError(Exception):
|
| 326 |
+
"""Raised if a rule is malformed."""
|
| 327 |
+
|
| 328 |
+
|
| 329 |
+
_VARS = {
|
| 330 |
+
'n', # absolute value of the source number.
|
| 331 |
+
'i', # integer digits of n.
|
| 332 |
+
'v', # number of visible fraction digits in n, with trailing zeros.*
|
| 333 |
+
'w', # number of visible fraction digits in n, without trailing zeros.*
|
| 334 |
+
'f', # visible fraction digits in n, with trailing zeros.*
|
| 335 |
+
't', # visible fraction digits in n, without trailing zeros.*
|
| 336 |
+
'c', # compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
|
| 337 |
+
'e', # currently, synonym for `c`. however, may be redefined in the future.
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
_RULES: list[tuple[str | None, re.Pattern[str]]] = [
|
| 341 |
+
(None, re.compile(r'\s+', re.UNICODE)),
|
| 342 |
+
('word', re.compile(fr'\b(and|or|is|(?:with)?in|not|mod|[{"".join(_VARS)}])\b')),
|
| 343 |
+
('value', re.compile(r'\d+')),
|
| 344 |
+
('symbol', re.compile(r'%|,|!=|=')),
|
| 345 |
+
('ellipsis', re.compile(r'\.{2,3}|\u2026', re.UNICODE)), # U+2026: ELLIPSIS
|
| 346 |
+
]
|
| 347 |
+
|
| 348 |
+
|
| 349 |
+
def tokenize_rule(s: str) -> list[tuple[str, str]]:
|
| 350 |
+
s = s.split('@')[0]
|
| 351 |
+
result: list[tuple[str, str]] = []
|
| 352 |
+
pos = 0
|
| 353 |
+
end = len(s)
|
| 354 |
+
while pos < end:
|
| 355 |
+
for tok, rule in _RULES:
|
| 356 |
+
match = rule.match(s, pos)
|
| 357 |
+
if match is not None:
|
| 358 |
+
pos = match.end()
|
| 359 |
+
if tok:
|
| 360 |
+
result.append((tok, match.group()))
|
| 361 |
+
break
|
| 362 |
+
else:
|
| 363 |
+
raise RuleError(f"malformed CLDR pluralization rule. Got unexpected {s[pos]!r}")
|
| 364 |
+
return result[::-1]
|
| 365 |
+
|
| 366 |
+
|
| 367 |
+
def test_next_token(
|
| 368 |
+
tokens: list[tuple[str, str]],
|
| 369 |
+
type_: str,
|
| 370 |
+
value: str | None = None,
|
| 371 |
+
) -> list[tuple[str, str]] | bool:
|
| 372 |
+
return tokens and tokens[-1][0] == type_ and \
|
| 373 |
+
(value is None or tokens[-1][1] == value)
|
| 374 |
+
|
| 375 |
+
|
| 376 |
+
def skip_token(tokens: list[tuple[str, str]], type_: str, value: str | None = None):
|
| 377 |
+
if test_next_token(tokens, type_, value):
|
| 378 |
+
return tokens.pop()
|
| 379 |
+
|
| 380 |
+
|
| 381 |
+
def value_node(value: int) -> tuple[Literal['value'], tuple[int]]:
|
| 382 |
+
return 'value', (value, )
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
def ident_node(name: str) -> tuple[str, tuple[()]]:
|
| 386 |
+
return name, ()
|
| 387 |
+
|
| 388 |
+
|
| 389 |
+
def range_list_node(
|
| 390 |
+
range_list: Iterable[Iterable[float | decimal.Decimal]],
|
| 391 |
+
) -> tuple[Literal['range_list'], Iterable[Iterable[float | decimal.Decimal]]]:
|
| 392 |
+
return 'range_list', range_list
|
| 393 |
+
|
| 394 |
+
|
| 395 |
+
def negate(rv: tuple[Any, ...]) -> tuple[Literal['not'], tuple[tuple[Any, ...]]]:
|
| 396 |
+
return 'not', (rv,)
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
class _Parser:
|
| 400 |
+
"""Internal parser. This class can translate a single rule into an abstract
|
| 401 |
+
tree of tuples. It implements the following grammar::
|
| 402 |
+
|
| 403 |
+
condition = and_condition ('or' and_condition)*
|
| 404 |
+
('@integer' samples)?
|
| 405 |
+
('@decimal' samples)?
|
| 406 |
+
and_condition = relation ('and' relation)*
|
| 407 |
+
relation = is_relation | in_relation | within_relation
|
| 408 |
+
is_relation = expr 'is' ('not')? value
|
| 409 |
+
in_relation = expr (('not')? 'in' | '=' | '!=') range_list
|
| 410 |
+
within_relation = expr ('not')? 'within' range_list
|
| 411 |
+
expr = operand (('mod' | '%') value)?
|
| 412 |
+
operand = 'n' | 'i' | 'f' | 't' | 'v' | 'w'
|
| 413 |
+
range_list = (range | value) (',' range_list)*
|
| 414 |
+
value = digit+
|
| 415 |
+
digit = 0|1|2|3|4|5|6|7|8|9
|
| 416 |
+
range = value'..'value
|
| 417 |
+
samples = sampleRange (',' sampleRange)* (',' ('…'|'...'))?
|
| 418 |
+
sampleRange = decimalValue '~' decimalValue
|
| 419 |
+
decimalValue = value ('.' value)?
|
| 420 |
+
|
| 421 |
+
- Whitespace can occur between or around any of the above tokens.
|
| 422 |
+
- Rules should be mutually exclusive; for a given numeric value, only one
|
| 423 |
+
rule should apply (i.e. the condition should only be true for one of
|
| 424 |
+
the plural rule elements).
|
| 425 |
+
- The in and within relations can take comma-separated lists, such as:
|
| 426 |
+
'n in 3,5,7..15'.
|
| 427 |
+
- Samples are ignored.
|
| 428 |
+
|
| 429 |
+
The translator parses the expression on instantiation into an attribute
|
| 430 |
+
called `ast`.
|
| 431 |
+
"""
|
| 432 |
+
|
| 433 |
+
def __init__(self, string):
|
| 434 |
+
self.tokens = tokenize_rule(string)
|
| 435 |
+
if not self.tokens:
|
| 436 |
+
# If the pattern is only samples, it's entirely possible
|
| 437 |
+
# no stream of tokens whatsoever is generated.
|
| 438 |
+
self.ast = None
|
| 439 |
+
return
|
| 440 |
+
self.ast = self.condition()
|
| 441 |
+
if self.tokens:
|
| 442 |
+
raise RuleError(f"Expected end of rule, got {self.tokens[-1][1]!r}")
|
| 443 |
+
|
| 444 |
+
def expect(self, type_, value=None, term=None):
|
| 445 |
+
token = skip_token(self.tokens, type_, value)
|
| 446 |
+
if token is not None:
|
| 447 |
+
return token
|
| 448 |
+
if term is None:
|
| 449 |
+
term = repr(value is None and type_ or value)
|
| 450 |
+
if not self.tokens:
|
| 451 |
+
raise RuleError(f"expected {term} but end of rule reached")
|
| 452 |
+
raise RuleError(f"expected {term} but got {self.tokens[-1][1]!r}")
|
| 453 |
+
|
| 454 |
+
def condition(self):
|
| 455 |
+
op = self.and_condition()
|
| 456 |
+
while skip_token(self.tokens, 'word', 'or'):
|
| 457 |
+
op = 'or', (op, self.and_condition())
|
| 458 |
+
return op
|
| 459 |
+
|
| 460 |
+
def and_condition(self):
|
| 461 |
+
op = self.relation()
|
| 462 |
+
while skip_token(self.tokens, 'word', 'and'):
|
| 463 |
+
op = 'and', (op, self.relation())
|
| 464 |
+
return op
|
| 465 |
+
|
| 466 |
+
def relation(self):
|
| 467 |
+
left = self.expr()
|
| 468 |
+
if skip_token(self.tokens, 'word', 'is'):
|
| 469 |
+
return skip_token(self.tokens, 'word', 'not') and 'isnot' or 'is', \
|
| 470 |
+
(left, self.value())
|
| 471 |
+
negated = skip_token(self.tokens, 'word', 'not')
|
| 472 |
+
method = 'in'
|
| 473 |
+
if skip_token(self.tokens, 'word', 'within'):
|
| 474 |
+
method = 'within'
|
| 475 |
+
else:
|
| 476 |
+
if not skip_token(self.tokens, 'word', 'in'):
|
| 477 |
+
if negated:
|
| 478 |
+
raise RuleError('Cannot negate operator based rules.')
|
| 479 |
+
return self.newfangled_relation(left)
|
| 480 |
+
rv = 'relation', (method, left, self.range_list())
|
| 481 |
+
return negate(rv) if negated else rv
|
| 482 |
+
|
| 483 |
+
def newfangled_relation(self, left):
|
| 484 |
+
if skip_token(self.tokens, 'symbol', '='):
|
| 485 |
+
negated = False
|
| 486 |
+
elif skip_token(self.tokens, 'symbol', '!='):
|
| 487 |
+
negated = True
|
| 488 |
+
else:
|
| 489 |
+
raise RuleError('Expected "=" or "!=" or legacy relation')
|
| 490 |
+
rv = 'relation', ('in', left, self.range_list())
|
| 491 |
+
return negate(rv) if negated else rv
|
| 492 |
+
|
| 493 |
+
def range_or_value(self):
|
| 494 |
+
left = self.value()
|
| 495 |
+
if skip_token(self.tokens, 'ellipsis'):
|
| 496 |
+
return left, self.value()
|
| 497 |
+
else:
|
| 498 |
+
return left, left
|
| 499 |
+
|
| 500 |
+
def range_list(self):
|
| 501 |
+
range_list = [self.range_or_value()]
|
| 502 |
+
while skip_token(self.tokens, 'symbol', ','):
|
| 503 |
+
range_list.append(self.range_or_value())
|
| 504 |
+
return range_list_node(range_list)
|
| 505 |
+
|
| 506 |
+
def expr(self):
|
| 507 |
+
word = skip_token(self.tokens, 'word')
|
| 508 |
+
if word is None or word[1] not in _VARS:
|
| 509 |
+
raise RuleError('Expected identifier variable')
|
| 510 |
+
name = word[1]
|
| 511 |
+
if skip_token(self.tokens, 'word', 'mod'):
|
| 512 |
+
return 'mod', ((name, ()), self.value())
|
| 513 |
+
elif skip_token(self.tokens, 'symbol', '%'):
|
| 514 |
+
return 'mod', ((name, ()), self.value())
|
| 515 |
+
return ident_node(name)
|
| 516 |
+
|
| 517 |
+
def value(self):
|
| 518 |
+
return value_node(int(self.expect('value')[1]))
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
def _binary_compiler(tmpl):
|
| 522 |
+
"""Compiler factory for the `_Compiler`."""
|
| 523 |
+
return lambda self, left, right: tmpl % (self.compile(left), self.compile(right))
|
| 524 |
+
|
| 525 |
+
|
| 526 |
+
def _unary_compiler(tmpl):
|
| 527 |
+
"""Compiler factory for the `_Compiler`."""
|
| 528 |
+
return lambda self, x: tmpl % self.compile(x)
|
| 529 |
+
|
| 530 |
+
|
| 531 |
+
compile_zero = lambda x: '0'
|
| 532 |
+
|
| 533 |
+
|
| 534 |
+
class _Compiler:
|
| 535 |
+
"""The compilers are able to transform the expressions into multiple
|
| 536 |
+
output formats.
|
| 537 |
+
"""
|
| 538 |
+
|
| 539 |
+
def compile(self, arg):
|
| 540 |
+
op, args = arg
|
| 541 |
+
return getattr(self, f"compile_{op}")(*args)
|
| 542 |
+
|
| 543 |
+
compile_n = lambda x: 'n'
|
| 544 |
+
compile_i = lambda x: 'i'
|
| 545 |
+
compile_v = lambda x: 'v'
|
| 546 |
+
compile_w = lambda x: 'w'
|
| 547 |
+
compile_f = lambda x: 'f'
|
| 548 |
+
compile_t = lambda x: 't'
|
| 549 |
+
compile_c = lambda x: 'c'
|
| 550 |
+
compile_e = lambda x: 'e'
|
| 551 |
+
compile_value = lambda x, v: str(v)
|
| 552 |
+
compile_and = _binary_compiler('(%s && %s)')
|
| 553 |
+
compile_or = _binary_compiler('(%s || %s)')
|
| 554 |
+
compile_not = _unary_compiler('(!%s)')
|
| 555 |
+
compile_mod = _binary_compiler('(%s %% %s)')
|
| 556 |
+
compile_is = _binary_compiler('(%s == %s)')
|
| 557 |
+
compile_isnot = _binary_compiler('(%s != %s)')
|
| 558 |
+
|
| 559 |
+
def compile_relation(self, method, expr, range_list):
|
| 560 |
+
raise NotImplementedError()
|
| 561 |
+
|
| 562 |
+
|
| 563 |
+
class _PythonCompiler(_Compiler):
|
| 564 |
+
"""Compiles an expression to Python."""
|
| 565 |
+
|
| 566 |
+
compile_and = _binary_compiler('(%s and %s)')
|
| 567 |
+
compile_or = _binary_compiler('(%s or %s)')
|
| 568 |
+
compile_not = _unary_compiler('(not %s)')
|
| 569 |
+
compile_mod = _binary_compiler('MOD(%s, %s)')
|
| 570 |
+
|
| 571 |
+
def compile_relation(self, method, expr, range_list):
|
| 572 |
+
ranges = ",".join([f"({self.compile(a)}, {self.compile(b)})" for (a, b) in range_list[1]])
|
| 573 |
+
return f"{method.upper()}({self.compile(expr)}, [{ranges}])"
|
| 574 |
+
|
| 575 |
+
|
| 576 |
+
class _GettextCompiler(_Compiler):
|
| 577 |
+
"""Compile into a gettext plural expression."""
|
| 578 |
+
|
| 579 |
+
compile_i = _Compiler.compile_n
|
| 580 |
+
compile_v = compile_zero
|
| 581 |
+
compile_w = compile_zero
|
| 582 |
+
compile_f = compile_zero
|
| 583 |
+
compile_t = compile_zero
|
| 584 |
+
|
| 585 |
+
def compile_relation(self, method, expr, range_list):
|
| 586 |
+
rv = []
|
| 587 |
+
expr = self.compile(expr)
|
| 588 |
+
for item in range_list[1]:
|
| 589 |
+
if item[0] == item[1]:
|
| 590 |
+
rv.append(f"({expr} == {self.compile(item[0])})")
|
| 591 |
+
else:
|
| 592 |
+
min, max = map(self.compile, item)
|
| 593 |
+
rv.append(f"({expr} >= {min} && {expr} <= {max})")
|
| 594 |
+
return f"({' || '.join(rv)})"
|
| 595 |
+
|
| 596 |
+
|
| 597 |
+
class _JavaScriptCompiler(_GettextCompiler):
|
| 598 |
+
"""Compiles the expression to plain of JavaScript."""
|
| 599 |
+
|
| 600 |
+
# XXX: presently javascript does not support any of the
|
| 601 |
+
# fraction support and basically only deals with integers.
|
| 602 |
+
compile_i = lambda x: 'parseInt(n, 10)'
|
| 603 |
+
compile_v = compile_zero
|
| 604 |
+
compile_w = compile_zero
|
| 605 |
+
compile_f = compile_zero
|
| 606 |
+
compile_t = compile_zero
|
| 607 |
+
|
| 608 |
+
def compile_relation(self, method, expr, range_list):
|
| 609 |
+
code = _GettextCompiler.compile_relation(
|
| 610 |
+
self, method, expr, range_list)
|
| 611 |
+
if method == 'in':
|
| 612 |
+
expr = self.compile(expr)
|
| 613 |
+
code = f"(parseInt({expr}, 10) == {expr} && {code})"
|
| 614 |
+
return code
|
| 615 |
+
|
| 616 |
+
|
| 617 |
+
class _UnicodeCompiler(_Compiler):
|
| 618 |
+
"""Returns a unicode pluralization rule again."""
|
| 619 |
+
|
| 620 |
+
# XXX: this currently spits out the old syntax instead of the new
|
| 621 |
+
# one. We can change that, but it will break a whole bunch of stuff
|
| 622 |
+
# for users I suppose.
|
| 623 |
+
|
| 624 |
+
compile_is = _binary_compiler('%s is %s')
|
| 625 |
+
compile_isnot = _binary_compiler('%s is not %s')
|
| 626 |
+
compile_and = _binary_compiler('%s and %s')
|
| 627 |
+
compile_or = _binary_compiler('%s or %s')
|
| 628 |
+
compile_mod = _binary_compiler('%s mod %s')
|
| 629 |
+
|
| 630 |
+
def compile_not(self, relation):
|
| 631 |
+
return self.compile_relation(*relation[1], negated=True)
|
| 632 |
+
|
| 633 |
+
def compile_relation(self, method, expr, range_list, negated=False):
|
| 634 |
+
ranges = []
|
| 635 |
+
for item in range_list[1]:
|
| 636 |
+
if item[0] == item[1]:
|
| 637 |
+
ranges.append(self.compile(item[0]))
|
| 638 |
+
else:
|
| 639 |
+
ranges.append(f"{self.compile(item[0])}..{self.compile(item[1])}")
|
| 640 |
+
return f"{self.compile(expr)}{' not' if negated else ''} {method} {','.join(ranges)}"
|
SPFsmartGATE/LIVE/TMP/babel/babel/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Marker file for PEP 561. This package uses inline types.
|
SPFsmartGATE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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.support
|
| 3 |
+
~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Several classes and functions that help with integrating and using Babel
|
| 6 |
+
in applications.
|
| 7 |
+
|
| 8 |
+
.. note: the code in this module is not used by Babel itself
|
| 9 |
+
|
| 10 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 11 |
+
:license: BSD, see LICENSE for more details.
|
| 12 |
+
"""
|
| 13 |
+
from __future__ import annotations
|
| 14 |
+
|
| 15 |
+
import decimal
|
| 16 |
+
import gettext
|
| 17 |
+
import locale
|
| 18 |
+
import os
|
| 19 |
+
from collections.abc import Iterator
|
| 20 |
+
from typing import TYPE_CHECKING, Any, Callable, Iterable
|
| 21 |
+
|
| 22 |
+
from babel.core import Locale
|
| 23 |
+
from babel.dates import format_date, format_datetime, format_time, format_timedelta
|
| 24 |
+
from babel.numbers import (
|
| 25 |
+
format_compact_currency,
|
| 26 |
+
format_compact_decimal,
|
| 27 |
+
format_currency,
|
| 28 |
+
format_decimal,
|
| 29 |
+
format_percent,
|
| 30 |
+
format_scientific,
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
if TYPE_CHECKING:
|
| 34 |
+
from typing_extensions import Literal
|
| 35 |
+
|
| 36 |
+
from babel.dates import _PredefinedTimeFormat
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
class Format:
|
| 40 |
+
"""Wrapper class providing the various date and number formatting functions
|
| 41 |
+
bound to a specific locale and time-zone.
|
| 42 |
+
|
| 43 |
+
>>> from babel.util import UTC
|
| 44 |
+
>>> from datetime import date
|
| 45 |
+
>>> fmt = Format('en_US', UTC)
|
| 46 |
+
>>> fmt.date(date(2007, 4, 1))
|
| 47 |
+
u'Apr 1, 2007'
|
| 48 |
+
>>> fmt.decimal(1.2345)
|
| 49 |
+
u'1.234'
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
def __init__(
|
| 53 |
+
self,
|
| 54 |
+
locale: Locale | str,
|
| 55 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 56 |
+
*,
|
| 57 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 58 |
+
) -> None:
|
| 59 |
+
"""Initialize the formatter.
|
| 60 |
+
|
| 61 |
+
:param locale: the locale identifier or `Locale` instance
|
| 62 |
+
:param tzinfo: the time-zone info (a `tzinfo` instance or `None`)
|
| 63 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 64 |
+
The special value "default" will use the default numbering system of the locale.
|
| 65 |
+
"""
|
| 66 |
+
self.locale = Locale.parse(locale)
|
| 67 |
+
self.tzinfo = tzinfo
|
| 68 |
+
self.numbering_system = numbering_system
|
| 69 |
+
|
| 70 |
+
def date(
|
| 71 |
+
self,
|
| 72 |
+
date: datetime.date | None = None,
|
| 73 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 74 |
+
) -> str:
|
| 75 |
+
"""Return a date formatted according to the given pattern.
|
| 76 |
+
|
| 77 |
+
>>> from datetime import date
|
| 78 |
+
>>> fmt = Format('en_US')
|
| 79 |
+
>>> fmt.date(date(2007, 4, 1))
|
| 80 |
+
u'Apr 1, 2007'
|
| 81 |
+
"""
|
| 82 |
+
return format_date(date, format, locale=self.locale)
|
| 83 |
+
|
| 84 |
+
def datetime(
|
| 85 |
+
self,
|
| 86 |
+
datetime: datetime.date | None = None,
|
| 87 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 88 |
+
) -> str:
|
| 89 |
+
"""Return a date and time formatted according to the given pattern.
|
| 90 |
+
|
| 91 |
+
>>> from datetime import datetime
|
| 92 |
+
>>> from babel.dates import get_timezone
|
| 93 |
+
>>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern'))
|
| 94 |
+
>>> fmt.datetime(datetime(2007, 4, 1, 15, 30))
|
| 95 |
+
u'Apr 1, 2007, 11:30:00\u202fAM'
|
| 96 |
+
"""
|
| 97 |
+
return format_datetime(datetime, format, tzinfo=self.tzinfo, locale=self.locale)
|
| 98 |
+
|
| 99 |
+
def time(
|
| 100 |
+
self,
|
| 101 |
+
time: datetime.time | datetime.datetime | None = None,
|
| 102 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 103 |
+
) -> str:
|
| 104 |
+
"""Return a time formatted according to the given pattern.
|
| 105 |
+
|
| 106 |
+
>>> from datetime import datetime
|
| 107 |
+
>>> from babel.dates import get_timezone
|
| 108 |
+
>>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern'))
|
| 109 |
+
>>> fmt.time(datetime(2007, 4, 1, 15, 30))
|
| 110 |
+
u'11:30:00\u202fAM'
|
| 111 |
+
"""
|
| 112 |
+
return format_time(time, format, tzinfo=self.tzinfo, locale=self.locale)
|
| 113 |
+
|
| 114 |
+
def timedelta(
|
| 115 |
+
self,
|
| 116 |
+
delta: datetime.timedelta | int,
|
| 117 |
+
granularity: Literal["year", "month", "week", "day", "hour", "minute", "second"] = "second",
|
| 118 |
+
threshold: float = 0.85,
|
| 119 |
+
format: Literal["narrow", "short", "medium", "long"] = "long",
|
| 120 |
+
add_direction: bool = False,
|
| 121 |
+
) -> str:
|
| 122 |
+
"""Return a time delta according to the rules of the given locale.
|
| 123 |
+
|
| 124 |
+
>>> from datetime import timedelta
|
| 125 |
+
>>> fmt = Format('en_US')
|
| 126 |
+
>>> fmt.timedelta(timedelta(weeks=11))
|
| 127 |
+
u'3 months'
|
| 128 |
+
"""
|
| 129 |
+
return format_timedelta(delta, granularity=granularity,
|
| 130 |
+
threshold=threshold,
|
| 131 |
+
format=format, add_direction=add_direction,
|
| 132 |
+
locale=self.locale)
|
| 133 |
+
|
| 134 |
+
def number(self, number: float | decimal.Decimal | str) -> str:
|
| 135 |
+
"""Return an integer number formatted for the locale.
|
| 136 |
+
|
| 137 |
+
>>> fmt = Format('en_US')
|
| 138 |
+
>>> fmt.number(1099)
|
| 139 |
+
u'1,099'
|
| 140 |
+
"""
|
| 141 |
+
return format_decimal(number, locale=self.locale, numbering_system=self.numbering_system)
|
| 142 |
+
|
| 143 |
+
def decimal(self, number: float | decimal.Decimal | str, format: str | None = None) -> str:
|
| 144 |
+
"""Return a decimal number formatted for the locale.
|
| 145 |
+
|
| 146 |
+
>>> fmt = Format('en_US')
|
| 147 |
+
>>> fmt.decimal(1.2345)
|
| 148 |
+
u'1.234'
|
| 149 |
+
"""
|
| 150 |
+
return format_decimal(number, format, locale=self.locale, numbering_system=self.numbering_system)
|
| 151 |
+
|
| 152 |
+
def compact_decimal(
|
| 153 |
+
self,
|
| 154 |
+
number: float | decimal.Decimal | str,
|
| 155 |
+
format_type: Literal['short', 'long'] = 'short',
|
| 156 |
+
fraction_digits: int = 0,
|
| 157 |
+
) -> str:
|
| 158 |
+
"""Return a number formatted in compact form for the locale.
|
| 159 |
+
|
| 160 |
+
>>> fmt = Format('en_US')
|
| 161 |
+
>>> fmt.compact_decimal(123456789)
|
| 162 |
+
u'123M'
|
| 163 |
+
>>> fmt.compact_decimal(1234567, format_type='long', fraction_digits=2)
|
| 164 |
+
'1.23 million'
|
| 165 |
+
"""
|
| 166 |
+
return format_compact_decimal(
|
| 167 |
+
number,
|
| 168 |
+
format_type=format_type,
|
| 169 |
+
fraction_digits=fraction_digits,
|
| 170 |
+
locale=self.locale,
|
| 171 |
+
numbering_system=self.numbering_system,
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
def currency(self, number: float | decimal.Decimal | str, currency: str) -> str:
|
| 175 |
+
"""Return a number in the given currency formatted for the locale.
|
| 176 |
+
"""
|
| 177 |
+
return format_currency(number, currency, locale=self.locale, numbering_system=self.numbering_system)
|
| 178 |
+
|
| 179 |
+
def compact_currency(
|
| 180 |
+
self,
|
| 181 |
+
number: float | decimal.Decimal | str,
|
| 182 |
+
currency: str,
|
| 183 |
+
format_type: Literal['short'] = 'short',
|
| 184 |
+
fraction_digits: int = 0,
|
| 185 |
+
) -> str:
|
| 186 |
+
"""Return a number in the given currency formatted for the locale
|
| 187 |
+
using the compact number format.
|
| 188 |
+
|
| 189 |
+
>>> Format('en_US').compact_currency(1234567, "USD", format_type='short', fraction_digits=2)
|
| 190 |
+
'$1.23M'
|
| 191 |
+
"""
|
| 192 |
+
return format_compact_currency(number, currency, format_type=format_type, fraction_digits=fraction_digits,
|
| 193 |
+
locale=self.locale, numbering_system=self.numbering_system)
|
| 194 |
+
|
| 195 |
+
def percent(self, number: float | decimal.Decimal | str, format: str | None = None) -> str:
|
| 196 |
+
"""Return a number formatted as percentage for the locale.
|
| 197 |
+
|
| 198 |
+
>>> fmt = Format('en_US')
|
| 199 |
+
>>> fmt.percent(0.34)
|
| 200 |
+
u'34%'
|
| 201 |
+
"""
|
| 202 |
+
return format_percent(number, format, locale=self.locale, numbering_system=self.numbering_system)
|
| 203 |
+
|
| 204 |
+
def scientific(self, number: float | decimal.Decimal | str) -> str:
|
| 205 |
+
"""Return a number formatted using scientific notation for the locale.
|
| 206 |
+
"""
|
| 207 |
+
return format_scientific(number, locale=self.locale, numbering_system=self.numbering_system)
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
class LazyProxy:
|
| 211 |
+
"""Class for proxy objects that delegate to a specified function to evaluate
|
| 212 |
+
the actual object.
|
| 213 |
+
|
| 214 |
+
>>> def greeting(name='world'):
|
| 215 |
+
... return 'Hello, %s!' % name
|
| 216 |
+
>>> lazy_greeting = LazyProxy(greeting, name='Joe')
|
| 217 |
+
>>> print(lazy_greeting)
|
| 218 |
+
Hello, Joe!
|
| 219 |
+
>>> u' ' + lazy_greeting
|
| 220 |
+
u' Hello, Joe!'
|
| 221 |
+
>>> u'(%s)' % lazy_greeting
|
| 222 |
+
u'(Hello, Joe!)'
|
| 223 |
+
|
| 224 |
+
This can be used, for example, to implement lazy translation functions that
|
| 225 |
+
delay the actual translation until the string is actually used. The
|
| 226 |
+
rationale for such behavior is that the locale of the user may not always
|
| 227 |
+
be available. In web applications, you only know the locale when processing
|
| 228 |
+
a request.
|
| 229 |
+
|
| 230 |
+
The proxy implementation attempts to be as complete as possible, so that
|
| 231 |
+
the lazy objects should mostly work as expected, for example for sorting:
|
| 232 |
+
|
| 233 |
+
>>> greetings = [
|
| 234 |
+
... LazyProxy(greeting, 'world'),
|
| 235 |
+
... LazyProxy(greeting, 'Joe'),
|
| 236 |
+
... LazyProxy(greeting, 'universe'),
|
| 237 |
+
... ]
|
| 238 |
+
>>> greetings.sort()
|
| 239 |
+
>>> for greeting in greetings:
|
| 240 |
+
... print(greeting)
|
| 241 |
+
Hello, Joe!
|
| 242 |
+
Hello, universe!
|
| 243 |
+
Hello, world!
|
| 244 |
+
"""
|
| 245 |
+
__slots__ = ['_func', '_args', '_kwargs', '_value', '_is_cache_enabled', '_attribute_error']
|
| 246 |
+
|
| 247 |
+
if TYPE_CHECKING:
|
| 248 |
+
_func: Callable[..., Any]
|
| 249 |
+
_args: tuple[Any, ...]
|
| 250 |
+
_kwargs: dict[str, Any]
|
| 251 |
+
_is_cache_enabled: bool
|
| 252 |
+
_value: Any
|
| 253 |
+
_attribute_error: AttributeError | None
|
| 254 |
+
|
| 255 |
+
def __init__(self, func: Callable[..., Any], *args: Any, enable_cache: bool = True, **kwargs: Any) -> None:
|
| 256 |
+
# Avoid triggering our own __setattr__ implementation
|
| 257 |
+
object.__setattr__(self, '_func', func)
|
| 258 |
+
object.__setattr__(self, '_args', args)
|
| 259 |
+
object.__setattr__(self, '_kwargs', kwargs)
|
| 260 |
+
object.__setattr__(self, '_is_cache_enabled', enable_cache)
|
| 261 |
+
object.__setattr__(self, '_value', None)
|
| 262 |
+
object.__setattr__(self, '_attribute_error', None)
|
| 263 |
+
|
| 264 |
+
@property
|
| 265 |
+
def value(self) -> Any:
|
| 266 |
+
if self._value is None:
|
| 267 |
+
try:
|
| 268 |
+
value = self._func(*self._args, **self._kwargs)
|
| 269 |
+
except AttributeError as error:
|
| 270 |
+
object.__setattr__(self, '_attribute_error', error)
|
| 271 |
+
raise
|
| 272 |
+
|
| 273 |
+
if not self._is_cache_enabled:
|
| 274 |
+
return value
|
| 275 |
+
object.__setattr__(self, '_value', value)
|
| 276 |
+
return self._value
|
| 277 |
+
|
| 278 |
+
def __contains__(self, key: object) -> bool:
|
| 279 |
+
return key in self.value
|
| 280 |
+
|
| 281 |
+
def __bool__(self) -> bool:
|
| 282 |
+
return bool(self.value)
|
| 283 |
+
|
| 284 |
+
def __dir__(self) -> list[str]:
|
| 285 |
+
return dir(self.value)
|
| 286 |
+
|
| 287 |
+
def __iter__(self) -> Iterator[Any]:
|
| 288 |
+
return iter(self.value)
|
| 289 |
+
|
| 290 |
+
def __len__(self) -> int:
|
| 291 |
+
return len(self.value)
|
| 292 |
+
|
| 293 |
+
def __str__(self) -> str:
|
| 294 |
+
return str(self.value)
|
| 295 |
+
|
| 296 |
+
def __add__(self, other: object) -> Any:
|
| 297 |
+
return self.value + other
|
| 298 |
+
|
| 299 |
+
def __radd__(self, other: object) -> Any:
|
| 300 |
+
return other + self.value
|
| 301 |
+
|
| 302 |
+
def __mod__(self, other: object) -> Any:
|
| 303 |
+
return self.value % other
|
| 304 |
+
|
| 305 |
+
def __rmod__(self, other: object) -> Any:
|
| 306 |
+
return other % self.value
|
| 307 |
+
|
| 308 |
+
def __mul__(self, other: object) -> Any:
|
| 309 |
+
return self.value * other
|
| 310 |
+
|
| 311 |
+
def __rmul__(self, other: object) -> Any:
|
| 312 |
+
return other * self.value
|
| 313 |
+
|
| 314 |
+
def __call__(self, *args: Any, **kwargs: Any) -> Any:
|
| 315 |
+
return self.value(*args, **kwargs)
|
| 316 |
+
|
| 317 |
+
def __lt__(self, other: object) -> bool:
|
| 318 |
+
return self.value < other
|
| 319 |
+
|
| 320 |
+
def __le__(self, other: object) -> bool:
|
| 321 |
+
return self.value <= other
|
| 322 |
+
|
| 323 |
+
def __eq__(self, other: object) -> bool:
|
| 324 |
+
return self.value == other
|
| 325 |
+
|
| 326 |
+
def __ne__(self, other: object) -> bool:
|
| 327 |
+
return self.value != other
|
| 328 |
+
|
| 329 |
+
def __gt__(self, other: object) -> bool:
|
| 330 |
+
return self.value > other
|
| 331 |
+
|
| 332 |
+
def __ge__(self, other: object) -> bool:
|
| 333 |
+
return self.value >= other
|
| 334 |
+
|
| 335 |
+
def __delattr__(self, name: str) -> None:
|
| 336 |
+
delattr(self.value, name)
|
| 337 |
+
|
| 338 |
+
def __getattr__(self, name: str) -> Any:
|
| 339 |
+
if self._attribute_error is not None:
|
| 340 |
+
raise self._attribute_error
|
| 341 |
+
return getattr(self.value, name)
|
| 342 |
+
|
| 343 |
+
def __setattr__(self, name: str, value: Any) -> None:
|
| 344 |
+
setattr(self.value, name, value)
|
| 345 |
+
|
| 346 |
+
def __delitem__(self, key: Any) -> None:
|
| 347 |
+
del self.value[key]
|
| 348 |
+
|
| 349 |
+
def __getitem__(self, key: Any) -> Any:
|
| 350 |
+
return self.value[key]
|
| 351 |
+
|
| 352 |
+
def __setitem__(self, key: Any, value: Any) -> None:
|
| 353 |
+
self.value[key] = value
|
| 354 |
+
|
| 355 |
+
def __copy__(self) -> LazyProxy:
|
| 356 |
+
return LazyProxy(
|
| 357 |
+
self._func,
|
| 358 |
+
enable_cache=self._is_cache_enabled,
|
| 359 |
+
*self._args, # noqa: B026
|
| 360 |
+
**self._kwargs,
|
| 361 |
+
)
|
| 362 |
+
|
| 363 |
+
def __deepcopy__(self, memo: Any) -> LazyProxy:
|
| 364 |
+
from copy import deepcopy
|
| 365 |
+
return LazyProxy(
|
| 366 |
+
deepcopy(self._func, memo),
|
| 367 |
+
enable_cache=deepcopy(self._is_cache_enabled, memo),
|
| 368 |
+
*deepcopy(self._args, memo), # noqa: B026
|
| 369 |
+
**deepcopy(self._kwargs, memo),
|
| 370 |
+
)
|
| 371 |
+
|
| 372 |
+
|
| 373 |
+
class NullTranslations(gettext.NullTranslations):
|
| 374 |
+
|
| 375 |
+
if TYPE_CHECKING:
|
| 376 |
+
_info: dict[str, str]
|
| 377 |
+
_fallback: NullTranslations | None
|
| 378 |
+
|
| 379 |
+
DEFAULT_DOMAIN = None
|
| 380 |
+
|
| 381 |
+
def __init__(self, fp: gettext._TranslationsReader | None = None) -> None:
|
| 382 |
+
"""Initialize a simple translations class which is not backed by a
|
| 383 |
+
real catalog. Behaves similar to gettext.NullTranslations but also
|
| 384 |
+
offers Babel's on *gettext methods (e.g. 'dgettext()').
|
| 385 |
+
|
| 386 |
+
:param fp: a file-like object (ignored in this class)
|
| 387 |
+
"""
|
| 388 |
+
# These attributes are set by gettext.NullTranslations when a catalog
|
| 389 |
+
# is parsed (fp != None). Ensure that they are always present because
|
| 390 |
+
# some *gettext methods (including '.gettext()') rely on the attributes.
|
| 391 |
+
self._catalog: dict[tuple[str, Any] | str, str] = {}
|
| 392 |
+
self.plural: Callable[[float | decimal.Decimal], int] = lambda n: int(n != 1)
|
| 393 |
+
super().__init__(fp=fp)
|
| 394 |
+
self.files = list(filter(None, [getattr(fp, 'name', None)]))
|
| 395 |
+
self.domain = self.DEFAULT_DOMAIN
|
| 396 |
+
self._domains: dict[str, NullTranslations] = {}
|
| 397 |
+
|
| 398 |
+
def dgettext(self, domain: str, message: str) -> str:
|
| 399 |
+
"""Like ``gettext()``, but look the message up in the specified
|
| 400 |
+
domain.
|
| 401 |
+
"""
|
| 402 |
+
return self._domains.get(domain, self).gettext(message)
|
| 403 |
+
|
| 404 |
+
def ldgettext(self, domain: str, message: str) -> str:
|
| 405 |
+
"""Like ``lgettext()``, but look the message up in the specified
|
| 406 |
+
domain.
|
| 407 |
+
"""
|
| 408 |
+
import warnings
|
| 409 |
+
warnings.warn(
|
| 410 |
+
'ldgettext() is deprecated, use dgettext() instead',
|
| 411 |
+
DeprecationWarning,
|
| 412 |
+
stacklevel=2,
|
| 413 |
+
)
|
| 414 |
+
return self._domains.get(domain, self).lgettext(message)
|
| 415 |
+
|
| 416 |
+
def udgettext(self, domain: str, message: str) -> str:
|
| 417 |
+
"""Like ``ugettext()``, but look the message up in the specified
|
| 418 |
+
domain.
|
| 419 |
+
"""
|
| 420 |
+
return self._domains.get(domain, self).ugettext(message)
|
| 421 |
+
# backward compatibility with 0.9
|
| 422 |
+
dugettext = udgettext
|
| 423 |
+
|
| 424 |
+
def dngettext(self, domain: str, singular: str, plural: str, num: int) -> str:
|
| 425 |
+
"""Like ``ngettext()``, but look the message up in the specified
|
| 426 |
+
domain.
|
| 427 |
+
"""
|
| 428 |
+
return self._domains.get(domain, self).ngettext(singular, plural, num)
|
| 429 |
+
|
| 430 |
+
def ldngettext(self, domain: str, singular: str, plural: str, num: int) -> str:
|
| 431 |
+
"""Like ``lngettext()``, but look the message up in the specified
|
| 432 |
+
domain.
|
| 433 |
+
"""
|
| 434 |
+
import warnings
|
| 435 |
+
warnings.warn(
|
| 436 |
+
'ldngettext() is deprecated, use dngettext() instead',
|
| 437 |
+
DeprecationWarning,
|
| 438 |
+
stacklevel=2,
|
| 439 |
+
)
|
| 440 |
+
return self._domains.get(domain, self).lngettext(singular, plural, num)
|
| 441 |
+
|
| 442 |
+
def udngettext(self, domain: str, singular: str, plural: str, num: int) -> str:
|
| 443 |
+
"""Like ``ungettext()`` but look the message up in the specified
|
| 444 |
+
domain.
|
| 445 |
+
"""
|
| 446 |
+
return self._domains.get(domain, self).ungettext(singular, plural, num)
|
| 447 |
+
# backward compatibility with 0.9
|
| 448 |
+
dungettext = udngettext
|
| 449 |
+
|
| 450 |
+
# Most of the downwards code, until it gets included in stdlib, from:
|
| 451 |
+
# https://bugs.python.org/file10036/gettext-pgettext.patch
|
| 452 |
+
#
|
| 453 |
+
# The encoding of a msgctxt and a msgid in a .mo file is
|
| 454 |
+
# msgctxt + "\x04" + msgid (gettext version >= 0.15)
|
| 455 |
+
CONTEXT_ENCODING = '%s\x04%s'
|
| 456 |
+
|
| 457 |
+
def pgettext(self, context: str, message: str) -> str | object:
|
| 458 |
+
"""Look up the `context` and `message` id in the catalog and return the
|
| 459 |
+
corresponding message string, as an 8-bit string encoded with the
|
| 460 |
+
catalog's charset encoding, if known. If there is no entry in the
|
| 461 |
+
catalog for the `message` id and `context` , and a fallback has been
|
| 462 |
+
set, the look up is forwarded to the fallback's ``pgettext()``
|
| 463 |
+
method. Otherwise, the `message` id is returned.
|
| 464 |
+
"""
|
| 465 |
+
ctxt_msg_id = self.CONTEXT_ENCODING % (context, message)
|
| 466 |
+
missing = object()
|
| 467 |
+
tmsg = self._catalog.get(ctxt_msg_id, missing)
|
| 468 |
+
if tmsg is missing:
|
| 469 |
+
tmsg = self._catalog.get((ctxt_msg_id, self.plural(1)), missing)
|
| 470 |
+
if tmsg is not missing:
|
| 471 |
+
return tmsg
|
| 472 |
+
if self._fallback:
|
| 473 |
+
return self._fallback.pgettext(context, message)
|
| 474 |
+
return message
|
| 475 |
+
|
| 476 |
+
def lpgettext(self, context: str, message: str) -> str | bytes | object:
|
| 477 |
+
"""Equivalent to ``pgettext()``, but the translation is returned in the
|
| 478 |
+
preferred system encoding, if no other encoding was explicitly set with
|
| 479 |
+
``bind_textdomain_codeset()``.
|
| 480 |
+
"""
|
| 481 |
+
import warnings
|
| 482 |
+
warnings.warn(
|
| 483 |
+
'lpgettext() is deprecated, use pgettext() instead',
|
| 484 |
+
DeprecationWarning,
|
| 485 |
+
stacklevel=2,
|
| 486 |
+
)
|
| 487 |
+
tmsg = self.pgettext(context, message)
|
| 488 |
+
encoding = getattr(self, "_output_charset", None) or locale.getpreferredencoding()
|
| 489 |
+
return tmsg.encode(encoding) if isinstance(tmsg, str) else tmsg
|
| 490 |
+
|
| 491 |
+
def npgettext(self, context: str, singular: str, plural: str, num: int) -> str:
|
| 492 |
+
"""Do a plural-forms lookup of a message id. `singular` is used as the
|
| 493 |
+
message id for purposes of lookup in the catalog, while `num` is used to
|
| 494 |
+
determine which plural form to use. The returned message string is an
|
| 495 |
+
8-bit string encoded with the catalog's charset encoding, if known.
|
| 496 |
+
|
| 497 |
+
If the message id for `context` is not found in the catalog, and a
|
| 498 |
+
fallback is specified, the request is forwarded to the fallback's
|
| 499 |
+
``npgettext()`` method. Otherwise, when ``num`` is 1 ``singular`` is
|
| 500 |
+
returned, and ``plural`` is returned in all other cases.
|
| 501 |
+
"""
|
| 502 |
+
ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular)
|
| 503 |
+
try:
|
| 504 |
+
tmsg = self._catalog[(ctxt_msg_id, self.plural(num))]
|
| 505 |
+
return tmsg
|
| 506 |
+
except KeyError:
|
| 507 |
+
if self._fallback:
|
| 508 |
+
return self._fallback.npgettext(context, singular, plural, num)
|
| 509 |
+
if num == 1:
|
| 510 |
+
return singular
|
| 511 |
+
else:
|
| 512 |
+
return plural
|
| 513 |
+
|
| 514 |
+
def lnpgettext(self, context: str, singular: str, plural: str, num: int) -> str | bytes:
|
| 515 |
+
"""Equivalent to ``npgettext()``, but the translation is returned in the
|
| 516 |
+
preferred system encoding, if no other encoding was explicitly set with
|
| 517 |
+
``bind_textdomain_codeset()``.
|
| 518 |
+
"""
|
| 519 |
+
import warnings
|
| 520 |
+
warnings.warn(
|
| 521 |
+
'lnpgettext() is deprecated, use npgettext() instead',
|
| 522 |
+
DeprecationWarning,
|
| 523 |
+
stacklevel=2,
|
| 524 |
+
)
|
| 525 |
+
ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular)
|
| 526 |
+
try:
|
| 527 |
+
tmsg = self._catalog[(ctxt_msg_id, self.plural(num))]
|
| 528 |
+
encoding = getattr(self, "_output_charset", None) or locale.getpreferredencoding()
|
| 529 |
+
return tmsg.encode(encoding)
|
| 530 |
+
except KeyError:
|
| 531 |
+
if self._fallback:
|
| 532 |
+
return self._fallback.lnpgettext(context, singular, plural, num)
|
| 533 |
+
if num == 1:
|
| 534 |
+
return singular
|
| 535 |
+
else:
|
| 536 |
+
return plural
|
| 537 |
+
|
| 538 |
+
def upgettext(self, context: str, message: str) -> str:
|
| 539 |
+
"""Look up the `context` and `message` id in the catalog and return the
|
| 540 |
+
corresponding message string, as a Unicode string. If there is no entry
|
| 541 |
+
in the catalog for the `message` id and `context`, and a fallback has
|
| 542 |
+
been set, the look up is forwarded to the fallback's ``upgettext()``
|
| 543 |
+
method. Otherwise, the `message` id is returned.
|
| 544 |
+
"""
|
| 545 |
+
ctxt_message_id = self.CONTEXT_ENCODING % (context, message)
|
| 546 |
+
missing = object()
|
| 547 |
+
tmsg = self._catalog.get(ctxt_message_id, missing)
|
| 548 |
+
if tmsg is missing:
|
| 549 |
+
if self._fallback:
|
| 550 |
+
return self._fallback.upgettext(context, message)
|
| 551 |
+
return str(message)
|
| 552 |
+
assert isinstance(tmsg, str)
|
| 553 |
+
return tmsg
|
| 554 |
+
|
| 555 |
+
def unpgettext(self, context: str, singular: str, plural: str, num: int) -> str:
|
| 556 |
+
"""Do a plural-forms lookup of a message id. `singular` is used as the
|
| 557 |
+
message id for purposes of lookup in the catalog, while `num` is used to
|
| 558 |
+
determine which plural form to use. The returned message string is a
|
| 559 |
+
Unicode string.
|
| 560 |
+
|
| 561 |
+
If the message id for `context` is not found in the catalog, and a
|
| 562 |
+
fallback is specified, the request is forwarded to the fallback's
|
| 563 |
+
``unpgettext()`` method. Otherwise, when `num` is 1 `singular` is
|
| 564 |
+
returned, and `plural` is returned in all other cases.
|
| 565 |
+
"""
|
| 566 |
+
ctxt_message_id = self.CONTEXT_ENCODING % (context, singular)
|
| 567 |
+
try:
|
| 568 |
+
tmsg = self._catalog[(ctxt_message_id, self.plural(num))]
|
| 569 |
+
except KeyError:
|
| 570 |
+
if self._fallback:
|
| 571 |
+
return self._fallback.unpgettext(context, singular, plural, num)
|
| 572 |
+
tmsg = str(singular) if num == 1 else str(plural)
|
| 573 |
+
return tmsg
|
| 574 |
+
|
| 575 |
+
def dpgettext(self, domain: str, context: str, message: str) -> str | object:
|
| 576 |
+
"""Like `pgettext()`, but look the message up in the specified
|
| 577 |
+
`domain`.
|
| 578 |
+
"""
|
| 579 |
+
return self._domains.get(domain, self).pgettext(context, message)
|
| 580 |
+
|
| 581 |
+
def udpgettext(self, domain: str, context: str, message: str) -> str:
|
| 582 |
+
"""Like `upgettext()`, but look the message up in the specified
|
| 583 |
+
`domain`.
|
| 584 |
+
"""
|
| 585 |
+
return self._domains.get(domain, self).upgettext(context, message)
|
| 586 |
+
# backward compatibility with 0.9
|
| 587 |
+
dupgettext = udpgettext
|
| 588 |
+
|
| 589 |
+
def ldpgettext(self, domain: str, context: str, message: str) -> str | bytes | object:
|
| 590 |
+
"""Equivalent to ``dpgettext()``, but the translation is returned in the
|
| 591 |
+
preferred system encoding, if no other encoding was explicitly set with
|
| 592 |
+
``bind_textdomain_codeset()``.
|
| 593 |
+
"""
|
| 594 |
+
return self._domains.get(domain, self).lpgettext(context, message)
|
| 595 |
+
|
| 596 |
+
def dnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str:
|
| 597 |
+
"""Like ``npgettext``, but look the message up in the specified
|
| 598 |
+
`domain`.
|
| 599 |
+
"""
|
| 600 |
+
return self._domains.get(domain, self).npgettext(context, singular,
|
| 601 |
+
plural, num)
|
| 602 |
+
|
| 603 |
+
def udnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str:
|
| 604 |
+
"""Like ``unpgettext``, but look the message up in the specified
|
| 605 |
+
`domain`.
|
| 606 |
+
"""
|
| 607 |
+
return self._domains.get(domain, self).unpgettext(context, singular,
|
| 608 |
+
plural, num)
|
| 609 |
+
# backward compatibility with 0.9
|
| 610 |
+
dunpgettext = udnpgettext
|
| 611 |
+
|
| 612 |
+
def ldnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str | bytes:
|
| 613 |
+
"""Equivalent to ``dnpgettext()``, but the translation is returned in
|
| 614 |
+
the preferred system encoding, if no other encoding was explicitly set
|
| 615 |
+
with ``bind_textdomain_codeset()``.
|
| 616 |
+
"""
|
| 617 |
+
return self._domains.get(domain, self).lnpgettext(context, singular,
|
| 618 |
+
plural, num)
|
| 619 |
+
|
| 620 |
+
ugettext = gettext.NullTranslations.gettext
|
| 621 |
+
ungettext = gettext.NullTranslations.ngettext
|
| 622 |
+
|
| 623 |
+
|
| 624 |
+
class Translations(NullTranslations, gettext.GNUTranslations):
|
| 625 |
+
"""An extended translation catalog class."""
|
| 626 |
+
|
| 627 |
+
DEFAULT_DOMAIN = 'messages'
|
| 628 |
+
|
| 629 |
+
def __init__(self, fp: gettext._TranslationsReader | None = None, domain: str | None = None):
|
| 630 |
+
"""Initialize the translations catalog.
|
| 631 |
+
|
| 632 |
+
:param fp: the file-like object the translation should be read from
|
| 633 |
+
:param domain: the message domain (default: 'messages')
|
| 634 |
+
"""
|
| 635 |
+
super().__init__(fp=fp)
|
| 636 |
+
self.domain = domain or self.DEFAULT_DOMAIN
|
| 637 |
+
|
| 638 |
+
ugettext = gettext.GNUTranslations.gettext
|
| 639 |
+
ungettext = gettext.GNUTranslations.ngettext
|
| 640 |
+
|
| 641 |
+
@classmethod
|
| 642 |
+
def load(
|
| 643 |
+
cls,
|
| 644 |
+
dirname: str | os.PathLike[str] | None = None,
|
| 645 |
+
locales: Iterable[str | Locale] | str | Locale | None = None,
|
| 646 |
+
domain: str | None = None,
|
| 647 |
+
) -> NullTranslations:
|
| 648 |
+
"""Load translations from the given directory.
|
| 649 |
+
|
| 650 |
+
:param dirname: the directory containing the ``MO`` files
|
| 651 |
+
:param locales: the list of locales in order of preference (items in
|
| 652 |
+
this list can be either `Locale` objects or locale
|
| 653 |
+
strings)
|
| 654 |
+
:param domain: the message domain (default: 'messages')
|
| 655 |
+
"""
|
| 656 |
+
if not domain:
|
| 657 |
+
domain = cls.DEFAULT_DOMAIN
|
| 658 |
+
filename = gettext.find(domain, dirname, _locales_to_names(locales))
|
| 659 |
+
if not filename:
|
| 660 |
+
return NullTranslations()
|
| 661 |
+
with open(filename, 'rb') as fp:
|
| 662 |
+
return cls(fp=fp, domain=domain)
|
| 663 |
+
|
| 664 |
+
def __repr__(self) -> str:
|
| 665 |
+
version = self._info.get('project-id-version')
|
| 666 |
+
return f'<{type(self).__name__}: "{version}">'
|
| 667 |
+
|
| 668 |
+
def add(self, translations: Translations, merge: bool = True):
|
| 669 |
+
"""Add the given translations to the catalog.
|
| 670 |
+
|
| 671 |
+
If the domain of the translations is different than that of the
|
| 672 |
+
current catalog, they are added as a catalog that is only accessible
|
| 673 |
+
by the various ``d*gettext`` functions.
|
| 674 |
+
|
| 675 |
+
:param translations: the `Translations` instance with the messages to
|
| 676 |
+
add
|
| 677 |
+
:param merge: whether translations for message domains that have
|
| 678 |
+
already been added should be merged with the existing
|
| 679 |
+
translations
|
| 680 |
+
"""
|
| 681 |
+
domain = getattr(translations, 'domain', self.DEFAULT_DOMAIN)
|
| 682 |
+
if merge and domain == self.domain:
|
| 683 |
+
return self.merge(translations)
|
| 684 |
+
|
| 685 |
+
existing = self._domains.get(domain)
|
| 686 |
+
if merge and isinstance(existing, Translations):
|
| 687 |
+
existing.merge(translations)
|
| 688 |
+
else:
|
| 689 |
+
translations.add_fallback(self)
|
| 690 |
+
self._domains[domain] = translations
|
| 691 |
+
|
| 692 |
+
return self
|
| 693 |
+
|
| 694 |
+
def merge(self, translations: Translations):
|
| 695 |
+
"""Merge the given translations into the catalog.
|
| 696 |
+
|
| 697 |
+
Message translations in the specified catalog override any messages
|
| 698 |
+
with the same identifier in the existing catalog.
|
| 699 |
+
|
| 700 |
+
:param translations: the `Translations` instance with the messages to
|
| 701 |
+
merge
|
| 702 |
+
"""
|
| 703 |
+
if isinstance(translations, gettext.GNUTranslations):
|
| 704 |
+
self._catalog.update(translations._catalog)
|
| 705 |
+
if isinstance(translations, Translations):
|
| 706 |
+
self.files.extend(translations.files)
|
| 707 |
+
|
| 708 |
+
return self
|
| 709 |
+
|
| 710 |
+
|
| 711 |
+
def _locales_to_names(
|
| 712 |
+
locales: Iterable[str | Locale] | str | Locale | None,
|
| 713 |
+
) -> list[str] | None:
|
| 714 |
+
"""Normalize a `locales` argument to a list of locale names.
|
| 715 |
+
|
| 716 |
+
:param locales: the list of locales in order of preference (items in
|
| 717 |
+
this list can be either `Locale` objects or locale
|
| 718 |
+
strings)
|
| 719 |
+
"""
|
| 720 |
+
if locales is None:
|
| 721 |
+
return None
|
| 722 |
+
if isinstance(locales, Locale):
|
| 723 |
+
return [str(locales)]
|
| 724 |
+
if isinstance(locales, str):
|
| 725 |
+
return [locales]
|
| 726 |
+
return [str(locale) for locale in locales]
|
SPFsmartGATE/LIVE/TMP/babel/babel/units.py
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import decimal
|
| 4 |
+
from typing import TYPE_CHECKING
|
| 5 |
+
|
| 6 |
+
from babel.core import Locale
|
| 7 |
+
from babel.numbers import LC_NUMERIC, format_decimal
|
| 8 |
+
|
| 9 |
+
if TYPE_CHECKING:
|
| 10 |
+
from typing_extensions import Literal
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class UnknownUnitError(ValueError):
|
| 14 |
+
def __init__(self, unit: str, locale: Locale) -> None:
|
| 15 |
+
ValueError.__init__(self, f"{unit} is not a known unit in {locale}")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def get_unit_name(
|
| 19 |
+
measurement_unit: str,
|
| 20 |
+
length: Literal['short', 'long', 'narrow'] = 'long',
|
| 21 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 22 |
+
) -> str | None:
|
| 23 |
+
"""
|
| 24 |
+
Get the display name for a measurement unit in the given locale.
|
| 25 |
+
|
| 26 |
+
>>> get_unit_name("radian", locale="en")
|
| 27 |
+
'radians'
|
| 28 |
+
|
| 29 |
+
Unknown units will raise exceptions:
|
| 30 |
+
|
| 31 |
+
>>> get_unit_name("battery", locale="fi")
|
| 32 |
+
Traceback (most recent call last):
|
| 33 |
+
...
|
| 34 |
+
UnknownUnitError: battery/long is not a known unit/length in fi
|
| 35 |
+
|
| 36 |
+
:param measurement_unit: the code of a measurement unit.
|
| 37 |
+
Known units can be found in the CLDR Unit Validity XML file:
|
| 38 |
+
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
|
| 39 |
+
|
| 40 |
+
:param length: "short", "long" or "narrow"
|
| 41 |
+
:param locale: the `Locale` object or locale identifier
|
| 42 |
+
:return: The unit display name, or None.
|
| 43 |
+
"""
|
| 44 |
+
locale = Locale.parse(locale)
|
| 45 |
+
unit = _find_unit_pattern(measurement_unit, locale=locale)
|
| 46 |
+
if not unit:
|
| 47 |
+
raise UnknownUnitError(unit=measurement_unit, locale=locale)
|
| 48 |
+
return locale.unit_display_names.get(unit, {}).get(length)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def _find_unit_pattern(unit_id: str, locale: Locale | str | None = LC_NUMERIC) -> str | None:
|
| 52 |
+
"""
|
| 53 |
+
Expand a unit into a qualified form.
|
| 54 |
+
|
| 55 |
+
Known units can be found in the CLDR Unit Validity XML file:
|
| 56 |
+
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
|
| 57 |
+
|
| 58 |
+
>>> _find_unit_pattern("radian", locale="en")
|
| 59 |
+
'angle-radian'
|
| 60 |
+
|
| 61 |
+
Unknown values will return None.
|
| 62 |
+
|
| 63 |
+
>>> _find_unit_pattern("horse", locale="en")
|
| 64 |
+
|
| 65 |
+
:param unit_id: the code of a measurement unit.
|
| 66 |
+
:return: A key to the `unit_patterns` mapping, or None.
|
| 67 |
+
"""
|
| 68 |
+
locale = Locale.parse(locale)
|
| 69 |
+
unit_patterns = locale._data["unit_patterns"]
|
| 70 |
+
if unit_id in unit_patterns:
|
| 71 |
+
return unit_id
|
| 72 |
+
for unit_pattern in sorted(unit_patterns, key=len):
|
| 73 |
+
if unit_pattern.endswith(unit_id):
|
| 74 |
+
return unit_pattern
|
| 75 |
+
return None
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def format_unit(
|
| 79 |
+
value: str | float | decimal.Decimal,
|
| 80 |
+
measurement_unit: str,
|
| 81 |
+
length: Literal['short', 'long', 'narrow'] = 'long',
|
| 82 |
+
format: str | None = None,
|
| 83 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 84 |
+
*,
|
| 85 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 86 |
+
) -> str:
|
| 87 |
+
"""Format a value of a given unit.
|
| 88 |
+
|
| 89 |
+
Values are formatted according to the locale's usual pluralization rules
|
| 90 |
+
and number formats.
|
| 91 |
+
|
| 92 |
+
>>> format_unit(12, 'length-meter', locale='ro_RO')
|
| 93 |
+
u'12 metri'
|
| 94 |
+
>>> format_unit(15.5, 'length-mile', locale='fi_FI')
|
| 95 |
+
u'15,5 mailia'
|
| 96 |
+
>>> format_unit(1200, 'pressure-millimeter-ofhg', locale='nb')
|
| 97 |
+
u'1\\xa0200 millimeter kvikks\\xf8lv'
|
| 98 |
+
>>> format_unit(270, 'ton', locale='en')
|
| 99 |
+
u'270 tons'
|
| 100 |
+
>>> format_unit(1234.5, 'kilogram', locale='ar_EG', numbering_system='default')
|
| 101 |
+
u'1٬234٫5 كيلوغرام'
|
| 102 |
+
|
| 103 |
+
Number formats may be overridden with the ``format`` parameter.
|
| 104 |
+
|
| 105 |
+
>>> import decimal
|
| 106 |
+
>>> format_unit(decimal.Decimal("-42.774"), 'temperature-celsius', 'short', format='#.0', locale='fr')
|
| 107 |
+
u'-42,8\\u202f\\xb0C'
|
| 108 |
+
|
| 109 |
+
The locale's usual pluralization rules are respected.
|
| 110 |
+
|
| 111 |
+
>>> format_unit(1, 'length-meter', locale='ro_RO')
|
| 112 |
+
u'1 metru'
|
| 113 |
+
>>> format_unit(0, 'length-mile', locale='cy')
|
| 114 |
+
u'0 mi'
|
| 115 |
+
>>> format_unit(1, 'length-mile', locale='cy')
|
| 116 |
+
u'1 filltir'
|
| 117 |
+
>>> format_unit(3, 'length-mile', locale='cy')
|
| 118 |
+
u'3 milltir'
|
| 119 |
+
|
| 120 |
+
>>> format_unit(15, 'length-horse', locale='fi')
|
| 121 |
+
Traceback (most recent call last):
|
| 122 |
+
...
|
| 123 |
+
UnknownUnitError: length-horse is not a known unit in fi
|
| 124 |
+
|
| 125 |
+
.. versionadded:: 2.2.0
|
| 126 |
+
|
| 127 |
+
:param value: the value to format. If this is a string, no number formatting will be attempted.
|
| 128 |
+
:param measurement_unit: the code of a measurement unit.
|
| 129 |
+
Known units can be found in the CLDR Unit Validity XML file:
|
| 130 |
+
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
|
| 131 |
+
:param length: "short", "long" or "narrow"
|
| 132 |
+
:param format: An optional format, as accepted by `format_decimal`.
|
| 133 |
+
:param locale: the `Locale` object or locale identifier
|
| 134 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 135 |
+
The special value "default" will use the default numbering system of the locale.
|
| 136 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 137 |
+
"""
|
| 138 |
+
locale = Locale.parse(locale)
|
| 139 |
+
|
| 140 |
+
q_unit = _find_unit_pattern(measurement_unit, locale=locale)
|
| 141 |
+
if not q_unit:
|
| 142 |
+
raise UnknownUnitError(unit=measurement_unit, locale=locale)
|
| 143 |
+
unit_patterns = locale._data["unit_patterns"][q_unit].get(length, {})
|
| 144 |
+
|
| 145 |
+
if isinstance(value, str): # Assume the value is a preformatted singular.
|
| 146 |
+
formatted_value = value
|
| 147 |
+
plural_form = "one"
|
| 148 |
+
else:
|
| 149 |
+
formatted_value = format_decimal(value, format, locale, numbering_system=numbering_system)
|
| 150 |
+
plural_form = locale.plural_form(value)
|
| 151 |
+
|
| 152 |
+
if plural_form in unit_patterns:
|
| 153 |
+
return unit_patterns[plural_form].format(formatted_value)
|
| 154 |
+
|
| 155 |
+
# Fall back to a somewhat bad representation.
|
| 156 |
+
# nb: This is marked as no-cover, as the current CLDR seemingly has no way for this to happen.
|
| 157 |
+
fallback_name = get_unit_name(measurement_unit, length=length, locale=locale) # pragma: no cover
|
| 158 |
+
return f"{formatted_value} {fallback_name or measurement_unit}" # pragma: no cover
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
def _find_compound_unit(
|
| 162 |
+
numerator_unit: str,
|
| 163 |
+
denominator_unit: str,
|
| 164 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 165 |
+
) -> str | None:
|
| 166 |
+
"""
|
| 167 |
+
Find a predefined compound unit pattern.
|
| 168 |
+
|
| 169 |
+
Used internally by format_compound_unit.
|
| 170 |
+
|
| 171 |
+
>>> _find_compound_unit("kilometer", "hour", locale="en")
|
| 172 |
+
'speed-kilometer-per-hour'
|
| 173 |
+
|
| 174 |
+
>>> _find_compound_unit("mile", "gallon", locale="en")
|
| 175 |
+
'consumption-mile-per-gallon'
|
| 176 |
+
|
| 177 |
+
If no predefined compound pattern can be found, `None` is returned.
|
| 178 |
+
|
| 179 |
+
>>> _find_compound_unit("gallon", "mile", locale="en")
|
| 180 |
+
|
| 181 |
+
>>> _find_compound_unit("horse", "purple", locale="en")
|
| 182 |
+
|
| 183 |
+
:param numerator_unit: The numerator unit's identifier
|
| 184 |
+
:param denominator_unit: The denominator unit's identifier
|
| 185 |
+
:param locale: the `Locale` object or locale identifier
|
| 186 |
+
:return: A key to the `unit_patterns` mapping, or None.
|
| 187 |
+
:rtype: str|None
|
| 188 |
+
"""
|
| 189 |
+
locale = Locale.parse(locale)
|
| 190 |
+
|
| 191 |
+
# Qualify the numerator and denominator units. This will turn possibly partial
|
| 192 |
+
# units like "kilometer" or "hour" into actual units like "length-kilometer" and
|
| 193 |
+
# "duration-hour".
|
| 194 |
+
|
| 195 |
+
resolved_numerator_unit = _find_unit_pattern(numerator_unit, locale=locale)
|
| 196 |
+
resolved_denominator_unit = _find_unit_pattern(denominator_unit, locale=locale)
|
| 197 |
+
|
| 198 |
+
# If either was not found, we can't possibly build a suitable compound unit either.
|
| 199 |
+
if not (resolved_numerator_unit and resolved_denominator_unit):
|
| 200 |
+
return None
|
| 201 |
+
|
| 202 |
+
# Since compound units are named "speed-kilometer-per-hour", we'll have to slice off
|
| 203 |
+
# the quantities (i.e. "length", "duration") from both qualified units.
|
| 204 |
+
|
| 205 |
+
bare_numerator_unit = resolved_numerator_unit.split("-", 1)[-1]
|
| 206 |
+
bare_denominator_unit = resolved_denominator_unit.split("-", 1)[-1]
|
| 207 |
+
|
| 208 |
+
# Now we can try and rebuild a compound unit specifier, then qualify it:
|
| 209 |
+
|
| 210 |
+
return _find_unit_pattern(f"{bare_numerator_unit}-per-{bare_denominator_unit}", locale=locale)
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
def format_compound_unit(
|
| 214 |
+
numerator_value: str | float | decimal.Decimal,
|
| 215 |
+
numerator_unit: str | None = None,
|
| 216 |
+
denominator_value: str | float | decimal.Decimal = 1,
|
| 217 |
+
denominator_unit: str | None = None,
|
| 218 |
+
length: Literal["short", "long", "narrow"] = "long",
|
| 219 |
+
format: str | None = None,
|
| 220 |
+
locale: Locale | str | None = LC_NUMERIC,
|
| 221 |
+
*,
|
| 222 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 223 |
+
) -> str | None:
|
| 224 |
+
"""
|
| 225 |
+
Format a compound number value, i.e. "kilometers per hour" or similar.
|
| 226 |
+
|
| 227 |
+
Both unit specifiers are optional to allow for formatting of arbitrary values still according
|
| 228 |
+
to the locale's general "per" formatting specifier.
|
| 229 |
+
|
| 230 |
+
>>> format_compound_unit(7, denominator_value=11, length="short", locale="pt")
|
| 231 |
+
'7/11'
|
| 232 |
+
|
| 233 |
+
>>> format_compound_unit(150, "kilometer", denominator_unit="hour", locale="sv")
|
| 234 |
+
'150 kilometer per timme'
|
| 235 |
+
|
| 236 |
+
>>> format_compound_unit(150, "kilowatt", denominator_unit="year", locale="fi")
|
| 237 |
+
'150 kilowattia / vuosi'
|
| 238 |
+
|
| 239 |
+
>>> format_compound_unit(32.5, "ton", 15, denominator_unit="hour", locale="en")
|
| 240 |
+
'32.5 tons per 15 hours'
|
| 241 |
+
|
| 242 |
+
>>> format_compound_unit(1234.5, "ton", 15, denominator_unit="hour", locale="ar_EG", numbering_system="arab")
|
| 243 |
+
'1٬234٫5 طن لكل 15 ساعة'
|
| 244 |
+
|
| 245 |
+
>>> format_compound_unit(160, denominator_unit="square-meter", locale="fr")
|
| 246 |
+
'160 par m\\xe8tre carr\\xe9'
|
| 247 |
+
|
| 248 |
+
>>> format_compound_unit(4, "meter", "ratakisko", length="short", locale="fi")
|
| 249 |
+
'4 m/ratakisko'
|
| 250 |
+
|
| 251 |
+
>>> format_compound_unit(35, "minute", denominator_unit="nautical-mile", locale="sv")
|
| 252 |
+
'35 minuter per nautisk mil'
|
| 253 |
+
|
| 254 |
+
>>> from babel.numbers import format_currency
|
| 255 |
+
>>> format_compound_unit(format_currency(35, "JPY", locale="de"), denominator_unit="liter", locale="de")
|
| 256 |
+
'35\\xa0\\xa5 pro Liter'
|
| 257 |
+
|
| 258 |
+
See https://www.unicode.org/reports/tr35/tr35-general.html#perUnitPatterns
|
| 259 |
+
|
| 260 |
+
:param numerator_value: The numerator value. This may be a string,
|
| 261 |
+
in which case it is considered preformatted and the unit is ignored.
|
| 262 |
+
:param numerator_unit: The numerator unit. See `format_unit`.
|
| 263 |
+
:param denominator_value: The denominator value. This may be a string,
|
| 264 |
+
in which case it is considered preformatted and the unit is ignored.
|
| 265 |
+
:param denominator_unit: The denominator unit. See `format_unit`.
|
| 266 |
+
:param length: The formatting length. "short", "long" or "narrow"
|
| 267 |
+
:param format: An optional format, as accepted by `format_decimal`.
|
| 268 |
+
:param locale: the `Locale` object or locale identifier
|
| 269 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 270 |
+
The special value "default" will use the default numbering system of the locale.
|
| 271 |
+
:return: A formatted compound value.
|
| 272 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 273 |
+
"""
|
| 274 |
+
locale = Locale.parse(locale)
|
| 275 |
+
|
| 276 |
+
# Look for a specific compound unit first...
|
| 277 |
+
|
| 278 |
+
if numerator_unit and denominator_unit and denominator_value == 1:
|
| 279 |
+
compound_unit = _find_compound_unit(numerator_unit, denominator_unit, locale=locale)
|
| 280 |
+
if compound_unit:
|
| 281 |
+
return format_unit(
|
| 282 |
+
numerator_value,
|
| 283 |
+
compound_unit,
|
| 284 |
+
length=length,
|
| 285 |
+
format=format,
|
| 286 |
+
locale=locale,
|
| 287 |
+
numbering_system=numbering_system,
|
| 288 |
+
)
|
| 289 |
+
|
| 290 |
+
# ... failing that, construct one "by hand".
|
| 291 |
+
|
| 292 |
+
if isinstance(numerator_value, str): # Numerator is preformatted
|
| 293 |
+
formatted_numerator = numerator_value
|
| 294 |
+
elif numerator_unit: # Numerator has unit
|
| 295 |
+
formatted_numerator = format_unit(
|
| 296 |
+
numerator_value,
|
| 297 |
+
numerator_unit,
|
| 298 |
+
length=length,
|
| 299 |
+
format=format,
|
| 300 |
+
locale=locale,
|
| 301 |
+
numbering_system=numbering_system,
|
| 302 |
+
)
|
| 303 |
+
else: # Unitless numerator
|
| 304 |
+
formatted_numerator = format_decimal(
|
| 305 |
+
numerator_value,
|
| 306 |
+
format=format,
|
| 307 |
+
locale=locale,
|
| 308 |
+
numbering_system=numbering_system,
|
| 309 |
+
)
|
| 310 |
+
|
| 311 |
+
if isinstance(denominator_value, str): # Denominator is preformatted
|
| 312 |
+
formatted_denominator = denominator_value
|
| 313 |
+
elif denominator_unit: # Denominator has unit
|
| 314 |
+
if denominator_value == 1: # support perUnitPatterns when the denominator is 1
|
| 315 |
+
denominator_unit = _find_unit_pattern(denominator_unit, locale=locale)
|
| 316 |
+
per_pattern = locale._data["unit_patterns"].get(denominator_unit, {}).get(length, {}).get("per")
|
| 317 |
+
if per_pattern:
|
| 318 |
+
return per_pattern.format(formatted_numerator)
|
| 319 |
+
# See TR-35's per-unit pattern algorithm, point 3.2.
|
| 320 |
+
# For denominator 1, we replace the value to be formatted with the empty string;
|
| 321 |
+
# this will make `format_unit` return " second" instead of "1 second".
|
| 322 |
+
denominator_value = ""
|
| 323 |
+
|
| 324 |
+
formatted_denominator = format_unit(
|
| 325 |
+
denominator_value,
|
| 326 |
+
measurement_unit=(denominator_unit or ""),
|
| 327 |
+
length=length,
|
| 328 |
+
format=format,
|
| 329 |
+
locale=locale,
|
| 330 |
+
numbering_system=numbering_system,
|
| 331 |
+
).strip()
|
| 332 |
+
else: # Bare denominator
|
| 333 |
+
formatted_denominator = format_decimal(
|
| 334 |
+
denominator_value,
|
| 335 |
+
format=format,
|
| 336 |
+
locale=locale,
|
| 337 |
+
numbering_system=numbering_system,
|
| 338 |
+
)
|
| 339 |
+
|
| 340 |
+
# TODO: this doesn't support "compound_variations" (or "prefix"), and will fall back to the "x/y" representation
|
| 341 |
+
per_pattern = locale._data["compound_unit_patterns"].get("per", {}).get(length, {}).get("compound", "{0}/{1}")
|
| 342 |
+
|
| 343 |
+
return per_pattern.format(formatted_numerator, formatted_denominator)
|
SPFsmartGATE/LIVE/TMP/babel/babel/util.py
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.util
|
| 3 |
+
~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Various utility classes and functions.
|
| 6 |
+
|
| 7 |
+
:copyright: (c) 2013-2024 by the Babel Team.
|
| 8 |
+
:license: BSD, see LICENSE for more details.
|
| 9 |
+
"""
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import codecs
|
| 13 |
+
import collections
|
| 14 |
+
import datetime
|
| 15 |
+
import os
|
| 16 |
+
import re
|
| 17 |
+
import textwrap
|
| 18 |
+
from collections.abc import Generator, Iterable
|
| 19 |
+
from typing import IO, Any, TypeVar
|
| 20 |
+
|
| 21 |
+
from babel import dates, localtime
|
| 22 |
+
|
| 23 |
+
missing = object()
|
| 24 |
+
|
| 25 |
+
_T = TypeVar("_T")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def distinct(iterable: Iterable[_T]) -> Generator[_T, None, None]:
|
| 29 |
+
"""Yield all items in an iterable collection that are distinct.
|
| 30 |
+
|
| 31 |
+
Unlike when using sets for a similar effect, the original ordering of the
|
| 32 |
+
items in the collection is preserved by this function.
|
| 33 |
+
|
| 34 |
+
>>> print(list(distinct([1, 2, 1, 3, 4, 4])))
|
| 35 |
+
[1, 2, 3, 4]
|
| 36 |
+
>>> print(list(distinct('foobar')))
|
| 37 |
+
['f', 'o', 'b', 'a', 'r']
|
| 38 |
+
|
| 39 |
+
:param iterable: the iterable collection providing the data
|
| 40 |
+
"""
|
| 41 |
+
seen = set()
|
| 42 |
+
for item in iter(iterable):
|
| 43 |
+
if item not in seen:
|
| 44 |
+
yield item
|
| 45 |
+
seen.add(item)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
# Regexp to match python magic encoding line
|
| 49 |
+
PYTHON_MAGIC_COMMENT_re = re.compile(
|
| 50 |
+
br'[ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)', re.VERBOSE)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def parse_encoding(fp: IO[bytes]) -> str | None:
|
| 54 |
+
"""Deduce the encoding of a source file from magic comment.
|
| 55 |
+
|
| 56 |
+
It does this in the same way as the `Python interpreter`__
|
| 57 |
+
|
| 58 |
+
.. __: https://docs.python.org/3.4/reference/lexical_analysis.html#encoding-declarations
|
| 59 |
+
|
| 60 |
+
The ``fp`` argument should be a seekable file object.
|
| 61 |
+
|
| 62 |
+
(From Jeff Dairiki)
|
| 63 |
+
"""
|
| 64 |
+
pos = fp.tell()
|
| 65 |
+
fp.seek(0)
|
| 66 |
+
try:
|
| 67 |
+
line1 = fp.readline()
|
| 68 |
+
has_bom = line1.startswith(codecs.BOM_UTF8)
|
| 69 |
+
if has_bom:
|
| 70 |
+
line1 = line1[len(codecs.BOM_UTF8):]
|
| 71 |
+
|
| 72 |
+
m = PYTHON_MAGIC_COMMENT_re.match(line1)
|
| 73 |
+
if not m:
|
| 74 |
+
try:
|
| 75 |
+
import ast
|
| 76 |
+
ast.parse(line1.decode('latin-1'))
|
| 77 |
+
except (ImportError, SyntaxError, UnicodeEncodeError):
|
| 78 |
+
# Either it's a real syntax error, in which case the source is
|
| 79 |
+
# not valid python source, or line2 is a continuation of line1,
|
| 80 |
+
# in which case we don't want to scan line2 for a magic
|
| 81 |
+
# comment.
|
| 82 |
+
pass
|
| 83 |
+
else:
|
| 84 |
+
line2 = fp.readline()
|
| 85 |
+
m = PYTHON_MAGIC_COMMENT_re.match(line2)
|
| 86 |
+
|
| 87 |
+
if has_bom:
|
| 88 |
+
if m:
|
| 89 |
+
magic_comment_encoding = m.group(1).decode('latin-1')
|
| 90 |
+
if magic_comment_encoding != 'utf-8':
|
| 91 |
+
raise SyntaxError(f"encoding problem: {magic_comment_encoding} with BOM")
|
| 92 |
+
return 'utf-8'
|
| 93 |
+
elif m:
|
| 94 |
+
return m.group(1).decode('latin-1')
|
| 95 |
+
else:
|
| 96 |
+
return None
|
| 97 |
+
finally:
|
| 98 |
+
fp.seek(pos)
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
PYTHON_FUTURE_IMPORT_re = re.compile(
|
| 102 |
+
r'from\s+__future__\s+import\s+\(*(.+)\)*')
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def parse_future_flags(fp: IO[bytes], encoding: str = 'latin-1') -> int:
|
| 106 |
+
"""Parse the compiler flags by :mod:`__future__` from the given Python
|
| 107 |
+
code.
|
| 108 |
+
"""
|
| 109 |
+
import __future__
|
| 110 |
+
pos = fp.tell()
|
| 111 |
+
fp.seek(0)
|
| 112 |
+
flags = 0
|
| 113 |
+
try:
|
| 114 |
+
body = fp.read().decode(encoding)
|
| 115 |
+
|
| 116 |
+
# Fix up the source to be (hopefully) parsable by regexpen.
|
| 117 |
+
# This will likely do untoward things if the source code itself is broken.
|
| 118 |
+
|
| 119 |
+
# (1) Fix `import (\n...` to be `import (...`.
|
| 120 |
+
body = re.sub(r'import\s*\([\r\n]+', 'import (', body)
|
| 121 |
+
# (2) Join line-ending commas with the next line.
|
| 122 |
+
body = re.sub(r',\s*[\r\n]+', ', ', body)
|
| 123 |
+
# (3) Remove backslash line continuations.
|
| 124 |
+
body = re.sub(r'\\\s*[\r\n]+', ' ', body)
|
| 125 |
+
|
| 126 |
+
for m in PYTHON_FUTURE_IMPORT_re.finditer(body):
|
| 127 |
+
names = [x.strip().strip('()') for x in m.group(1).split(',')]
|
| 128 |
+
for name in names:
|
| 129 |
+
feature = getattr(__future__, name, None)
|
| 130 |
+
if feature:
|
| 131 |
+
flags |= feature.compiler_flag
|
| 132 |
+
finally:
|
| 133 |
+
fp.seek(pos)
|
| 134 |
+
return flags
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def pathmatch(pattern: str, filename: str) -> bool:
|
| 138 |
+
"""Extended pathname pattern matching.
|
| 139 |
+
|
| 140 |
+
This function is similar to what is provided by the ``fnmatch`` module in
|
| 141 |
+
the Python standard library, but:
|
| 142 |
+
|
| 143 |
+
* can match complete (relative or absolute) path names, and not just file
|
| 144 |
+
names, and
|
| 145 |
+
* also supports a convenience pattern ("**") to match files at any
|
| 146 |
+
directory level.
|
| 147 |
+
|
| 148 |
+
Examples:
|
| 149 |
+
|
| 150 |
+
>>> pathmatch('**.py', 'bar.py')
|
| 151 |
+
True
|
| 152 |
+
>>> pathmatch('**.py', 'foo/bar/baz.py')
|
| 153 |
+
True
|
| 154 |
+
>>> pathmatch('**.py', 'templates/index.html')
|
| 155 |
+
False
|
| 156 |
+
|
| 157 |
+
>>> pathmatch('./foo/**.py', 'foo/bar/baz.py')
|
| 158 |
+
True
|
| 159 |
+
>>> pathmatch('./foo/**.py', 'bar/baz.py')
|
| 160 |
+
False
|
| 161 |
+
|
| 162 |
+
>>> pathmatch('^foo/**.py', 'foo/bar/baz.py')
|
| 163 |
+
True
|
| 164 |
+
>>> pathmatch('^foo/**.py', 'bar/baz.py')
|
| 165 |
+
False
|
| 166 |
+
|
| 167 |
+
>>> pathmatch('**/templates/*.html', 'templates/index.html')
|
| 168 |
+
True
|
| 169 |
+
>>> pathmatch('**/templates/*.html', 'templates/foo/bar.html')
|
| 170 |
+
False
|
| 171 |
+
|
| 172 |
+
:param pattern: the glob pattern
|
| 173 |
+
:param filename: the path name of the file to match against
|
| 174 |
+
"""
|
| 175 |
+
symbols = {
|
| 176 |
+
'?': '[^/]',
|
| 177 |
+
'?/': '[^/]/',
|
| 178 |
+
'*': '[^/]+',
|
| 179 |
+
'*/': '[^/]+/',
|
| 180 |
+
'**/': '(?:.+/)*?',
|
| 181 |
+
'**': '(?:.+/)*?[^/]+',
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
if pattern.startswith('^'):
|
| 185 |
+
buf = ['^']
|
| 186 |
+
pattern = pattern[1:]
|
| 187 |
+
elif pattern.startswith('./'):
|
| 188 |
+
buf = ['^']
|
| 189 |
+
pattern = pattern[2:]
|
| 190 |
+
else:
|
| 191 |
+
buf = []
|
| 192 |
+
|
| 193 |
+
for idx, part in enumerate(re.split('([?*]+/?)', pattern)):
|
| 194 |
+
if idx % 2:
|
| 195 |
+
buf.append(symbols[part])
|
| 196 |
+
elif part:
|
| 197 |
+
buf.append(re.escape(part))
|
| 198 |
+
match = re.match(f"{''.join(buf)}$", filename.replace(os.sep, "/"))
|
| 199 |
+
return match is not None
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
class TextWrapper(textwrap.TextWrapper):
|
| 203 |
+
wordsep_re = re.compile(
|
| 204 |
+
r'(\s+|' # any whitespace
|
| 205 |
+
r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))', # em-dash
|
| 206 |
+
)
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
def wraptext(text: str, width: int = 70, initial_indent: str = '', subsequent_indent: str = '') -> list[str]:
|
| 210 |
+
"""Simple wrapper around the ``textwrap.wrap`` function in the standard
|
| 211 |
+
library. This version does not wrap lines on hyphens in words.
|
| 212 |
+
|
| 213 |
+
:param text: the text to wrap
|
| 214 |
+
:param width: the maximum line width
|
| 215 |
+
:param initial_indent: string that will be prepended to the first line of
|
| 216 |
+
wrapped output
|
| 217 |
+
:param subsequent_indent: string that will be prepended to all lines save
|
| 218 |
+
the first of wrapped output
|
| 219 |
+
"""
|
| 220 |
+
wrapper = TextWrapper(width=width, initial_indent=initial_indent,
|
| 221 |
+
subsequent_indent=subsequent_indent,
|
| 222 |
+
break_long_words=False)
|
| 223 |
+
return wrapper.wrap(text)
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
# TODO (Babel 3.x): Remove this re-export
|
| 227 |
+
odict = collections.OrderedDict
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
class FixedOffsetTimezone(datetime.tzinfo):
|
| 231 |
+
"""Fixed offset in minutes east from UTC."""
|
| 232 |
+
|
| 233 |
+
def __init__(self, offset: float, name: str | None = None) -> None:
|
| 234 |
+
|
| 235 |
+
self._offset = datetime.timedelta(minutes=offset)
|
| 236 |
+
if name is None:
|
| 237 |
+
name = 'Etc/GMT%+d' % offset
|
| 238 |
+
self.zone = name
|
| 239 |
+
|
| 240 |
+
def __str__(self) -> str:
|
| 241 |
+
return self.zone
|
| 242 |
+
|
| 243 |
+
def __repr__(self) -> str:
|
| 244 |
+
return f'<FixedOffset "{self.zone}" {self._offset}>'
|
| 245 |
+
|
| 246 |
+
def utcoffset(self, dt: datetime.datetime) -> datetime.timedelta:
|
| 247 |
+
return self._offset
|
| 248 |
+
|
| 249 |
+
def tzname(self, dt: datetime.datetime) -> str:
|
| 250 |
+
return self.zone
|
| 251 |
+
|
| 252 |
+
def dst(self, dt: datetime.datetime) -> datetime.timedelta:
|
| 253 |
+
return ZERO
|
| 254 |
+
|
| 255 |
+
|
| 256 |
+
# Export the localtime functionality here because that's
|
| 257 |
+
# where it was in the past.
|
| 258 |
+
# TODO(3.0): remove these aliases
|
| 259 |
+
UTC = dates.UTC
|
| 260 |
+
LOCALTZ = dates.LOCALTZ
|
| 261 |
+
get_localzone = localtime.get_localzone
|
| 262 |
+
STDOFFSET = localtime.STDOFFSET
|
| 263 |
+
DSTOFFSET = localtime.DSTOFFSET
|
| 264 |
+
DSTDIFF = localtime.DSTDIFF
|
| 265 |
+
ZERO = localtime.ZERO
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
def _cmp(a: Any, b: Any):
|
| 269 |
+
return (a > b) - (a < b)
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/LICENSE
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
UNICODE LICENSE V3
|
| 2 |
+
|
| 3 |
+
COPYRIGHT AND PERMISSION NOTICE
|
| 4 |
+
|
| 5 |
+
Copyright © 1991-2024 Unicode, Inc.
|
| 6 |
+
|
| 7 |
+
NOTICE TO USER: Carefully read the following legal agreement. BY
|
| 8 |
+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
| 9 |
+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
| 10 |
+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
| 11 |
+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
| 12 |
+
|
| 13 |
+
Permission is hereby granted, free of charge, to any person obtaining a
|
| 14 |
+
copy of data files and any associated documentation (the "Data Files") or
|
| 15 |
+
software and any associated documentation (the "Software") to deal in the
|
| 16 |
+
Data Files or Software without restriction, including without limitation
|
| 17 |
+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
| 18 |
+
copies of the Data Files or Software, and to permit persons to whom the
|
| 19 |
+
Data Files or Software are furnished to do so, provided that either (a)
|
| 20 |
+
this copyright and permission notice appear with all copies of the Data
|
| 21 |
+
Files or Software, or (b) this copyright and permission notice appear in
|
| 22 |
+
associated Documentation.
|
| 23 |
+
|
| 24 |
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
| 25 |
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 26 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 27 |
+
THIRD PARTY RIGHTS.
|
| 28 |
+
|
| 29 |
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
| 30 |
+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
| 31 |
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 32 |
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
| 33 |
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
| 34 |
+
FILES OR SOFTWARE.
|
| 35 |
+
|
| 36 |
+
Except as contained in this notice, the name of a copyright holder shall
|
| 37 |
+
not be used in advertising or otherwise to promote the sale, use or other
|
| 38 |
+
dealings in these Data Files or Software without prior written
|
| 39 |
+
authorization of the copyright holder.
|
| 40 |
+
|
| 41 |
+
SPDX-License-Identifier: Unicode-3.0
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/README-common.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CLDR Common Data
|
| 2 |
+
|
| 3 |
+
This zipfile contains [CLDR](http://cldr.unicode.org) Common Data.
|
| 4 |
+
|
| 5 |
+
## LICENSE
|
| 6 |
+
|
| 7 |
+
See [LICENSE.txt](./LICENSE.txt)
|
| 8 |
+
|
| 9 |
+
>Copyright © 2019-2022 Unicode, Inc. All rights reserved.
|
| 10 |
+
>Distributed under the Terms of Use in https://www.unicode.org/copyright.html
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/af.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/am.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ar.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ar_SA.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="ar"/>
|
| 12 |
+
<territory type="SA"/>
|
| 13 |
+
</identity>
|
| 14 |
+
<annotations>
|
| 15 |
+
<annotation cp="🍷" draft="contributed">كأس عصير</annotation>
|
| 16 |
+
<annotation cp="🍷" type="tts">كأس عصير</annotation>
|
| 17 |
+
</annotations>
|
| 18 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/as.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ast.xml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="ast"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="🤣">cara | risa | rodando | rodando pel suelu de risa | suelu</annotation>
|
| 15 |
+
<annotation cp="🤣" type="tts">rodando pel suelu de risa</annotation>
|
| 16 |
+
<annotation cp="😂">allegría | cara | cara llorando d’allegría | llárima | risa</annotation>
|
| 17 |
+
<annotation cp="😂" type="tts">cara llorando d’allegría</annotation>
|
| 18 |
+
<annotation cp="😘">besu | cara | cara tirando un besu</annotation>
|
| 19 |
+
<annotation cp="😘" type="tts">cara tirando un besu</annotation>
|
| 20 |
+
<annotation cp="😗">besu | cara | cara besando</annotation>
|
| 21 |
+
<annotation cp="😗" type="tts">cara besando</annotation>
|
| 22 |
+
<annotation cp="☺">cara sorriendo</annotation>
|
| 23 |
+
<annotation cp="☺" type="tts">cara sorriendo</annotation>
|
| 24 |
+
<annotation cp="🤳">selfie</annotation>
|
| 25 |
+
<annotation cp="🤳" type="tts">selfie</annotation>
|
| 26 |
+
<annotation cp="👅">cuerpu | llingua</annotation>
|
| 27 |
+
<annotation cp="👅" type="tts">llingua</annotation>
|
| 28 |
+
<annotation cp="👄">boca | llabios</annotation>
|
| 29 |
+
<annotation cp="👄" type="tts">boca</annotation>
|
| 30 |
+
<annotation cp="💏">besu</annotation>
|
| 31 |
+
<annotation cp="💏" type="tts">besu</annotation>
|
| 32 |
+
<annotation cp="👪">familia</annotation>
|
| 33 |
+
<annotation cp="👪" type="tts">familia</annotation>
|
| 34 |
+
<annotation cp="💍">aniellu | diamante</annotation>
|
| 35 |
+
<annotation cp="💍" type="tts">aniellu</annotation>
|
| 36 |
+
<annotation cp="💎">diamante | piedra preciosa | xema | xoya</annotation>
|
| 37 |
+
<annotation cp="💎" type="tts">piedra preciosa</annotation>
|
| 38 |
+
</annotations>
|
| 39 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/az.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/be.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bew.xml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="bew"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="😀" draft="unconfirmed">girang | muka | nyengir | seneng</annotation>
|
| 15 |
+
<annotation cp="😀" type="tts" draft="unconfirmed">muka girang</annotation>
|
| 16 |
+
<annotation cp="😃" draft="unconfirmed">lèbar | muka | nyengir | seneng | sumringah</annotation>
|
| 17 |
+
<annotation cp="😃" type="tts" draft="unconfirmed">muka nyengir lèbar</annotation>
|
| 18 |
+
<annotation cp="😄" draft="unconfirmed">girang | ketawa | mata ketutup | muka | muka girang mata ketutup | seneng</annotation>
|
| 19 |
+
<annotation cp="😄" type="tts" draft="unconfirmed">muka girang mata ketutup</annotation>
|
| 20 |
+
<annotation cp="😁" draft="unconfirmed">gigi | ketawa | mata seneng | muka | nyengir</annotation>
|
| 21 |
+
<annotation cp="😁" type="tts" draft="unconfirmed">muka nyengir</annotation>
|
| 22 |
+
<annotation cp="😆" draft="unconfirmed">ketawa | muka | muka ketawa merem | ngakak | nglèdèk | seneng</annotation>
|
| 23 |
+
<annotation cp="😆" type="tts" draft="unconfirmed">muka ketawa merem</annotation>
|
| 24 |
+
<annotation cp="😅" draft="unconfirmed">girang | keringetan | ketawa | muka | seneng | senyum lèbar</annotation>
|
| 25 |
+
<annotation cp="😅" type="tts" draft="unconfirmed">muka girang keringetan</annotation>
|
| 26 |
+
<annotation cp="🤣" draft="unconfirmed">bodor | guling-guling | ketawa | ketawa ampé nangis | kocak | lucu | muka | ngakak</annotation>
|
| 27 |
+
<annotation cp="🤣" type="tts" draft="unconfirmed">ngakak</annotation>
|
| 28 |
+
<annotation cp="😂" draft="unconfirmed">aèr mata | girang | ketawa | muka | muka nangis seneng | nangis seneng | seneng | senyum lèbar</annotation>
|
| 29 |
+
<annotation cp="😂" type="tts" draft="unconfirmed">muka nangis seneng</annotation>
|
| 30 |
+
<annotation cp="🙂" draft="unconfirmed">mèsem | muka | muka mèsem biasa | senyum | senyum biasa</annotation>
|
| 31 |
+
<annotation cp="🙂" type="tts" draft="unconfirmed">muka mèsem biasa</annotation>
|
| 32 |
+
<annotation cp="🙃" draft="unconfirmed">kebalik | muka | senyum</annotation>
|
| 33 |
+
<annotation cp="🙃" type="tts" draft="unconfirmed">muka kebalik</annotation>
|
| 34 |
+
<annotation cp="🫠" draft="unconfirmed">caèran | ilang | larut | melèlèh | muka | senyum</annotation>
|
| 35 |
+
<annotation cp="🫠" type="tts" draft="unconfirmed">muka melèlèh</annotation>
|
| 36 |
+
<annotation cp="😉" draft="unconfirmed">genit | kedip | muka | ngedip | ngegoda</annotation>
|
| 37 |
+
<annotation cp="😉" type="tts" draft="unconfirmed">muka ngedip</annotation>
|
| 38 |
+
<annotation cp="😊" draft="unconfirmed">bebunga-bunga | girang | kesenengan | malu | mèrah | muka | muka nahan malu girang | nahan malu | seneng</annotation>
|
| 39 |
+
<annotation cp="😊" type="tts" draft="unconfirmed">muka nahan malu girang</annotation>
|
| 40 |
+
<annotation cp="😇" draft="unconfirmed">baè’ | baè’ ati | baèk | iklas | lugu | malaèkat | malaikat | mèsem | muka | polos | senyum</annotation>
|
| 41 |
+
<annotation cp="😇" type="tts" draft="unconfirmed">muka malaèkat</annotation>
|
| 42 |
+
<annotation cp="🥰" draft="unconfirmed">ati | cinta | demen | kedemean | muka senyum cinta | muka senyum kedemenan | seneng | senyum</annotation>
|
| 43 |
+
<annotation cp="🥰" type="tts" draft="unconfirmed">muka senyum kedemenan</annotation>
|
| 44 |
+
<annotation cp="😍" draft="unconfirmed">ati | cinta | mata | muka cinta | muka cinta mata ati | senyum</annotation>
|
| 45 |
+
<annotation cp="😍" type="tts" draft="unconfirmed">muka cinta</annotation>
|
| 46 |
+
<annotation cp="🤩" draft="unconfirmed">bintang | girang | mata | mèsem | muka seneng | muka seneng mata bintang | seneng | senyum</annotation>
|
| 47 |
+
<annotation cp="🤩" type="tts" draft="unconfirmed">muka seneng mata bintang</annotation>
|
| 48 |
+
<annotation cp="😘" draft="unconfirmed">cium | demen | kecup | muka niupin sun | mulut niup | seneng | suka | sun</annotation>
|
| 49 |
+
<annotation cp="😘" type="tts" draft="unconfirmed">muka niupin sun</annotation>
|
| 50 |
+
<annotation cp="😗" draft="unconfirmed">cium | monyong | muka ngesun | mulut | ngesun | nyium | nyosor | sun</annotation>
|
| 51 |
+
<annotation cp="😗" type="tts" draft="unconfirmed">muka ngesun</annotation>
|
| 52 |
+
<annotation cp="☺" draft="unconfirmed">baè’ | baèk | iklas | mèsem | muka | seneng | senyum</annotation>
|
| 53 |
+
<annotation cp="☺" type="tts" draft="unconfirmed">muka mèsem seneng</annotation>
|
| 54 |
+
<annotation cp="😚" draft="unconfirmed">cinta | cium | demen | monyong | muka | muka ngesun merem pipi mèra | ngesun | nyium | nyosor | pipi mèra | seneng | suka | sun</annotation>
|
| 55 |
+
<annotation cp="😚" type="tts" draft="unconfirmed">muka ngesun merem pipi mèra</annotation>
|
| 56 |
+
<annotation cp="😙" draft="unconfirmed">cinta | cium | demen | monyong | muka | muka ngesun merem | ngesun | nyium | nyosor | seneng | suka | sun</annotation>
|
| 57 |
+
<annotation cp="😙" type="tts" draft="unconfirmed">muka ngesun merem</annotation>
|
| 58 |
+
<annotation cp="🥲" draft="unconfirmed">aèr mata | bangga | besukur | haru | kesentu | lega | mèsem | muka haru | muka seneng | muka senyum | plong | senyum | sukur</annotation>
|
| 59 |
+
<annotation cp="🥲" type="tts" draft="unconfirmed">muka haru</annotation>
|
| 60 |
+
<annotation cp="😋" draft="unconfirmed">ènak | gurih | lejat | muka | nyicipin makanan</annotation>
|
| 61 |
+
<annotation cp="😋" type="tts" draft="unconfirmed">muka lejat</annotation>
|
| 62 |
+
<annotation cp="😛" draft="unconfirmed">lida | lidah | mèlèd | muka | nglèdèk</annotation>
|
| 63 |
+
<annotation cp="😛" type="tts" draft="unconfirmed">muka mèlèd</annotation>
|
| 64 |
+
<annotation cp="😜" draft="unconfirmed">kedip | lida | lidah | mèlèd | muka | ngedip | nglèdèk</annotation>
|
| 65 |
+
<annotation cp="😜" type="tts" draft="unconfirmed">muka mèlèd ngedip</annotation>
|
| 66 |
+
<annotation cp="🤪" draft="unconfirmed">bègo | konyol | mèlèd | muka | nglèdèk | pè’a | sarap | sèdèng | songong</annotation>
|
| 67 |
+
<annotation cp="🤪" type="tts" draft="unconfirmed">muka pè’a</annotation>
|
| 68 |
+
<annotation cp="😝" draft="unconfirmed">jiji’ | ketawa | mèlèd | merem | muka | songong</annotation>
|
| 69 |
+
<annotation cp="😝" type="tts" draft="unconfirmed">muka mèlèd merem</annotation>
|
| 70 |
+
<annotation cp="🤑" draft="unconfirmed">duit | mata duitan | muka | napsu</annotation>
|
| 71 |
+
<annotation cp="🤑" type="tts" draft="unconfirmed">muka napsu duit</annotation>
|
| 72 |
+
</annotations>
|
| 73 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bg.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bgn.xml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="bgn"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="👶">گوونڈک | ورنائوک</annotation>
|
| 15 |
+
<annotation cp="👶" type="tts">گوونڈک</annotation>
|
| 16 |
+
<annotation cp="👦">چوریکه</annotation>
|
| 17 |
+
<annotation cp="👦" type="tts">چوریکه</annotation>
|
| 18 |
+
<annotation cp="👧">جينيکو</annotation>
|
| 19 |
+
<annotation cp="👧" type="tts">جينيکو</annotation>
|
| 20 |
+
<annotation cp="👨">مردینزاگ</annotation>
|
| 21 |
+
<annotation cp="👨" type="tts">مردینزاگ</annotation>
|
| 22 |
+
<annotation cp="👩">جنینزاگ</annotation>
|
| 23 |
+
<annotation cp="👩" type="tts">جنینزاگ</annotation>
|
| 24 |
+
<annotation cp="🧓">پیرین</annotation>
|
| 25 |
+
<annotation cp="🧓" type="tts">پیرین</annotation>
|
| 26 |
+
<annotation cp="👴">پیره مرد</annotation>
|
| 27 |
+
<annotation cp="👴" type="tts">پیره مرد</annotation>
|
| 28 |
+
<annotation cp="👵">پیره زال</annotation>
|
| 29 |
+
<annotation cp="👵" type="tts">پیره زال</annotation>
|
| 30 |
+
<annotation cp="🏁">شطرنجی | شطرنجین بیرغ | مسابقه</annotation>
|
| 31 |
+
<annotation cp="🏁" type="tts">شطرنجین بیرغ</annotation>
|
| 32 |
+
<annotation cp="🚩">پوسٹ | سه کونجین بیرغ</annotation>
|
| 33 |
+
<annotation cp="🚩" type="tts">سه کونجین بیرغ</annotation>
|
| 34 |
+
</annotations>
|
| 35 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bn.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/br.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/bs.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ca.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ccp.xml
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="ccp"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="😀" draft="unconfirmed">𑄞𑄬𑄁𑄌𑄨 𑄟𑄪</annotation>
|
| 15 |
+
<annotation cp="😀" type="tts" draft="unconfirmed">𑄞𑄬𑄁𑄌𑄨 𑄟𑄪</annotation>
|
| 16 |
+
<annotation cp="😃" draft="unconfirmed">𑄞𑄧𑄢𑄴 𑄌𑄮𑄉𑄧 𑄉𑄎𑄧𑄌𑄬 𑄞𑄬𑄁𑄌𑄨 𑄟𑄪</annotation>
|
| 17 |
+
<annotation cp="😃" type="tts" draft="unconfirmed">𑄞𑄧𑄢𑄴 𑄌𑄮𑄉𑄧 𑄉𑄎𑄧𑄌𑄬 𑄞𑄬𑄁𑄌𑄨 𑄟𑄪</annotation>
|
| 18 |
+
<annotation cp="😁" draft="unconfirmed">𑄎𑄧𑄣𑄴𑄎𑄧𑄣𑄳𑄣𑄬 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄦𑄎𑄳𑄎𑄬 𑄦𑄎𑄳𑄎𑄬 𑄌𑄮𑄉𑄧</annotation>
|
| 19 |
+
<annotation cp="😁" type="tts" draft="unconfirmed">𑄎𑄧𑄣𑄴𑄎𑄧𑄣𑄳𑄣𑄬 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄦𑄎𑄳𑄎𑄬 𑄦𑄎𑄳𑄎𑄬 𑄌𑄮𑄉𑄧</annotation>
|
| 20 |
+
<annotation cp="🤣" draft="unconfirmed">𑄦𑄎𑄧𑄘𑄬 𑄦𑄎𑄧𑄘𑄬 𑄟𑄘𑄨𑄖𑄴 𑄉𑄪𑄌𑄴𑄎𑄚</annotation>
|
| 21 |
+
<annotation cp="🤣" type="tts" draft="unconfirmed">𑄦𑄎𑄧𑄘𑄬 𑄦𑄎𑄧𑄘𑄬 𑄟𑄘𑄨𑄖𑄴 𑄉𑄪𑄌𑄴𑄎𑄚</annotation>
|
| 22 |
+
<annotation cp="😂" draft="unconfirmed">𑄟𑄪 𑄦𑄚𑄴𑄖𑄴 𑄦𑄪𑄎𑄨𑄢𑄴 𑄌𑄮𑄉𑄮 𑄛𑄚𑄨</annotation>
|
| 23 |
+
<annotation cp="😂" type="tts" draft="unconfirmed">𑄟𑄪 𑄦𑄚𑄴𑄖𑄴 𑄦𑄪𑄎𑄨𑄢𑄴 𑄌𑄮𑄉𑄮 𑄛𑄚𑄨</annotation>
|
| 24 |
+
<annotation cp="🙂" draft="unconfirmed">𑄃𑄬𑄇𑄳𑄦𑄴 𑄃𑄬𑄇𑄳𑄦𑄴 𑄦𑄏𑄧𑄁 𑄦𑄏𑄧𑄁 𑄟𑄪</annotation>
|
| 25 |
+
<annotation cp="🙂" type="tts" draft="unconfirmed">𑄃𑄬𑄇𑄳𑄦𑄴 𑄃𑄬𑄇𑄳𑄦𑄴 𑄦𑄏𑄧𑄁 𑄦𑄏𑄧𑄁 𑄟𑄪</annotation>
|
| 26 |
+
<annotation cp="😍" draft="unconfirmed">𑄦𑄏𑄨 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄛𑄧𑄢𑄚𑄴 𑄊𑄧𑄢𑄧 𑄌𑄮𑄇𑄴</annotation>
|
| 27 |
+
<annotation cp="😍" type="tts" draft="unconfirmed">𑄦𑄏𑄨 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄛𑄧𑄢𑄚𑄴 𑄊𑄧𑄢𑄧 𑄌𑄮𑄇𑄴</annotation>
|
| 28 |
+
<annotation cp="😘" draft="unconfirmed">𑄌𑄪𑄟𑄬𑄢𑄴 𑄟𑄪 𑄍𑄪𑄌𑄬𑄋𑄴 𑄉𑄧𑄢𑄨</annotation>
|
| 29 |
+
<annotation cp="😘" type="tts" draft="unconfirmed">𑄌𑄪𑄟𑄬𑄢𑄴 𑄟𑄪 𑄍𑄪𑄌𑄬𑄋𑄴 𑄉𑄧𑄢𑄨</annotation>
|
| 30 |
+
<annotation cp="😗" draft="unconfirmed">𑄌𑄪𑄟𑄮 𑄥𑄪𑄟𑄨 𑄟𑄪</annotation>
|
| 31 |
+
<annotation cp="😗" type="tts" draft="unconfirmed">𑄌𑄪𑄟𑄮 𑄥𑄪𑄟𑄨 𑄟𑄪</annotation>
|
| 32 |
+
<annotation cp="😚" draft="unconfirmed">𑄌𑄮𑄇𑄴 𑄦𑄖𑄳𑄠𑄬 𑄥𑄪𑄟𑄮 𑄥𑄪𑄟𑄨 𑄟𑄪</annotation>
|
| 33 |
+
<annotation cp="😚" type="tts" draft="unconfirmed">𑄌𑄮𑄇𑄴 𑄦𑄖𑄳𑄠𑄬 𑄥𑄪𑄟𑄮 𑄥𑄪𑄟𑄨 𑄟𑄪</annotation>
|
| 34 |
+
<annotation cp="😙" draft="unconfirmed">𑄥𑄪𑄟𑄮 𑄥𑄪𑄟𑄨 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄦𑄏𑄨 𑄌𑄮𑄇𑄴</annotation>
|
| 35 |
+
<annotation cp="😙" type="tts" draft="unconfirmed">𑄥𑄪𑄟𑄮 𑄥𑄪𑄟𑄨 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄦𑄏𑄨 𑄌𑄮𑄇𑄴</annotation>
|
| 36 |
+
<annotation cp="😛" draft="unconfirmed">𑄎𑄨𑄣𑄴 𑄚𑄨𑄉𑄬𑄣𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 37 |
+
<annotation cp="😛" type="tts" draft="unconfirmed">𑄎𑄨𑄣𑄴 𑄚𑄨𑄉𑄬𑄣𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 38 |
+
<annotation cp="🤔" draft="unconfirmed">𑄥𑄨𑄘𑄳𑄠𑄬𑄉𑄮𑄌𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 39 |
+
<annotation cp="🤔" type="tts" draft="unconfirmed">𑄥𑄨𑄘𑄳𑄠𑄬𑄉𑄮𑄌𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 40 |
+
<annotation cp="😪" draft="unconfirmed">𑄊𑄪𑄟𑄴 𑄡𑄬𑄠𑄬 𑄟𑄪</annotation>
|
| 41 |
+
<annotation cp="😪" type="tts" draft="unconfirmed">𑄊𑄪𑄟𑄴 𑄡𑄬𑄠𑄬 𑄟𑄪</annotation>
|
| 42 |
+
<annotation cp="😎" draft="unconfirmed">𑄦𑄏𑄨 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄌𑄮𑄇𑄴𑄥𑄟𑄘𑄳𑄠𑄬</annotation>
|
| 43 |
+
<annotation cp="😎" type="tts" draft="unconfirmed">𑄦𑄏𑄨 𑄟𑄪 𑄣𑄧𑄉𑄬 𑄌𑄮𑄇𑄴𑄥𑄟𑄘𑄳𑄠𑄬</annotation>
|
| 44 |
+
<annotation cp="😢" draft="unconfirmed">𑄇𑄚𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 45 |
+
<annotation cp="😢" type="tts" draft="unconfirmed">𑄇𑄚𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 46 |
+
<annotation cp="😭" draft="unconfirmed">𑄎𑄮𑄢𑄬 𑄎𑄮𑄢𑄬 𑄇𑄚𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 47 |
+
<annotation cp="😭" type="tts" draft="unconfirmed">𑄎𑄮𑄢𑄬 𑄎𑄮𑄢𑄬 𑄇𑄚𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 48 |
+
<annotation cp="😠" draft="unconfirmed">𑄢𑄉𑄴𑄅𑄪𑄖𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 49 |
+
<annotation cp="😠" type="tts" draft="unconfirmed">𑄢𑄉𑄴𑄅𑄪𑄖𑄳𑄠𑄬 𑄟𑄪</annotation>
|
| 50 |
+
<annotation cp="👶" draft="unconfirmed">𑄇𑄪𑄏𑄨 𑄌𑄨𑄌𑄴𑄨𑄇𑄴</annotation>
|
| 51 |
+
<annotation cp="👶" type="tts" draft="unconfirmed">𑄇𑄪𑄏𑄨 𑄌𑄨𑄌𑄴𑄨𑄇𑄴</annotation>
|
| 52 |
+
<annotation cp="🧒" draft="unconfirmed">𑄌𑄨𑄉𑄮𑄚𑄴 𑄉𑄪𑄢𑄮</annotation>
|
| 53 |
+
<annotation cp="🧒" type="tts" draft="unconfirmed">𑄌𑄨𑄉𑄮𑄚𑄴 𑄉𑄪𑄢𑄮</annotation>
|
| 54 |
+
<annotation cp="👦" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄛𑄱</annotation>
|
| 55 |
+
<annotation cp="👦" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄛𑄱</annotation>
|
| 56 |
+
<annotation cp="👧" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄛𑄱</annotation>
|
| 57 |
+
<annotation cp="👧" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄛𑄱</annotation>
|
| 58 |
+
<annotation cp="👨" draft="unconfirmed">𑄟𑄚𑄪𑄌𑄴</annotation>
|
| 59 |
+
<annotation cp="👨" type="tts" draft="unconfirmed">𑄟𑄚𑄪𑄌𑄴</annotation>
|
| 60 |
+
<annotation cp="👩" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄟𑄚𑄪𑄌𑄴</annotation>
|
| 61 |
+
<annotation cp="👩" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄟𑄚𑄪𑄌𑄴</annotation>
|
| 62 |
+
<annotation cp="🧓" draft="unconfirmed">𑄝𑄪𑄢𑄮 𑄉𑄝𑄪𑄢𑄴</annotation>
|
| 63 |
+
<annotation cp="🧓" type="tts" draft="unconfirmed">𑄝𑄪𑄢𑄮 𑄉𑄝𑄪𑄢𑄴</annotation>
|
| 64 |
+
<annotation cp="👴" draft="unconfirmed">𑄝𑄪𑄢𑄮 𑄟𑄚𑄪𑄌𑄴</annotation>
|
| 65 |
+
<annotation cp="👴" type="tts" draft="unconfirmed">𑄝𑄪𑄢𑄮 𑄟𑄚𑄪𑄌𑄴</annotation>
|
| 66 |
+
<annotation cp="👵" draft="unconfirmed">𑄝𑄪𑄢𑄮 𑄟𑄨𑄣𑄬</annotation>
|
| 67 |
+
<annotation cp="👵" type="tts" draft="unconfirmed">𑄝𑄪𑄢𑄮 𑄟𑄨𑄣𑄬</annotation>
|
| 68 |
+
<annotation cp="👨🎓" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄍𑄖𑄳𑄢𑄧𑄴</annotation>
|
| 69 |
+
<annotation cp="👨🎓" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄍𑄖𑄳𑄢𑄧𑄴</annotation>
|
| 70 |
+
<annotation cp="👩🎓" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄍𑄖𑄳𑄢𑄧𑄴</annotation>
|
| 71 |
+
<annotation cp="👩🎓" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄍𑄖𑄳𑄢𑄧𑄴</annotation>
|
| 72 |
+
<annotation cp="👨🏫" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄟𑄌𑄴𑄑𑄧𑄢𑄴</annotation>
|
| 73 |
+
<annotation cp="👨🏫" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄟𑄌𑄴𑄑𑄧𑄢𑄴</annotation>
|
| 74 |
+
<annotation cp="👩🏫" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄟𑄌𑄴𑄑𑄧𑄢𑄴</annotation>
|
| 75 |
+
<annotation cp="👩🏫" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄟𑄌𑄴𑄑𑄧𑄢𑄴</annotation>
|
| 76 |
+
<annotation cp="👨🌾" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄦𑄣𑄴𑄌𑄪𑄠𑄬</annotation>
|
| 77 |
+
<annotation cp="👨🌾" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄦𑄣𑄴𑄌𑄪𑄠𑄬</annotation>
|
| 78 |
+
<annotation cp="👩🌾" draft="unconfirmed">𑄦𑄣𑄴𑄣𑄮 𑄟𑄨𑄣𑄬</annotation>
|
| 79 |
+
<annotation cp="👩🌾" type="tts" draft="unconfirmed">𑄦𑄣𑄴𑄣𑄮 𑄟𑄨𑄣𑄬</annotation>
|
| 80 |
+
<annotation cp="👨🍳" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄝𑄉𑄮𑄌𑄴𑄨</annotation>
|
| 81 |
+
<annotation cp="👨🍳" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄝𑄉𑄮𑄌𑄴𑄨</annotation>
|
| 82 |
+
<annotation cp="👩🍳" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄝𑄉𑄮𑄌𑄴𑄨</annotation>
|
| 83 |
+
<annotation cp="👩🍳" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄝𑄉𑄮𑄌𑄴𑄨</annotation>
|
| 84 |
+
<annotation cp="👨🔧" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄇𑄣𑄨𑄉𑄧𑄢𑄴</annotation>
|
| 85 |
+
<annotation cp="👨🔧" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄇𑄣𑄨𑄉𑄧𑄢𑄴</annotation>
|
| 86 |
+
<annotation cp="👩🔧" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄇𑄣𑄨𑄉𑄧𑄢𑄴</annotation>
|
| 87 |
+
<annotation cp="👩🔧" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄇𑄣𑄨𑄉𑄧𑄢𑄴</annotation>
|
| 88 |
+
<annotation cp="👨🏭" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄑𑄮𑄢𑄨𑄖𑄴 𑄇𑄟𑄴 𑄉𑄧𑄢𑄨𑄠𑄬 𑄟𑄧𑄢𑄧𑄘𑄴</annotation>
|
| 89 |
+
<annotation cp="👨🏭" type="tts" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄑𑄮𑄢𑄨𑄖𑄴 𑄇𑄟𑄴 𑄉𑄧𑄢𑄨𑄠𑄬 𑄟𑄧𑄢𑄧𑄘𑄴</annotation>
|
| 90 |
+
<annotation cp="👩🏭" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄑𑄮𑄢𑄨𑄖𑄴 𑄇𑄟𑄴 𑄉𑄧𑄢𑄨𑄠𑄬 𑄟𑄨𑄣𑄬</annotation>
|
| 91 |
+
<annotation cp="👩🏭" type="tts" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄑𑄮𑄢𑄨𑄖𑄴 𑄇𑄟𑄴 𑄉𑄧𑄢𑄨𑄠𑄬 𑄟𑄨𑄣𑄬</annotation>
|
| 92 |
+
<annotation cp="👨🔬" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄝𑄨𑄉𑄳𑄠𑄴����𑄨</annotation>
|
| 93 |
+
<annotation cp="👨🔬" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄝𑄨𑄉𑄳𑄠𑄴𑄚𑄨</annotation>
|
| 94 |
+
<annotation cp="👩🔬" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄝𑄨𑄉𑄳𑄠𑄴𑄚𑄨</annotation>
|
| 95 |
+
<annotation cp="👩🔬" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄝𑄨𑄉𑄳𑄠𑄴𑄚𑄨</annotation>
|
| 96 |
+
<annotation cp="👨✈" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄝𑄨𑄟𑄚𑄴 𑄌𑄣𑄬𑄠𑄳𑄠</annotation>
|
| 97 |
+
<annotation cp="👨✈" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄝𑄨𑄟𑄚𑄴 𑄌𑄣𑄬𑄠𑄳𑄠</annotation>
|
| 98 |
+
<annotation cp="👩✈" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄝𑄨𑄟𑄚𑄴 𑄌𑄣𑄬𑄠𑄳𑄠</annotation>
|
| 99 |
+
<annotation cp="👩✈" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄝𑄨𑄟𑄚𑄴 𑄌𑄣𑄬𑄠𑄳𑄠</annotation>
|
| 100 |
+
<annotation cp="👮" draft="unconfirmed">𑄛𑄪𑄣𑄨𑄌𑄴 𑄃𑄧𑄜𑄨𑄥𑄢𑄴</annotation>
|
| 101 |
+
<annotation cp="👮" type="tts" draft="unconfirmed">𑄛𑄪𑄣𑄨𑄌𑄴 𑄃𑄧𑄜𑄨𑄥𑄢𑄴</annotation>
|
| 102 |
+
<annotation cp="👮♂" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄛𑄪𑄣𑄨𑄌𑄴 𑄃𑄧𑄜𑄨𑄥𑄢𑄴</annotation>
|
| 103 |
+
<annotation cp="👮♂" type="tts" draft="unconfirmed">𑄟𑄧𑄢𑄧𑄘𑄴 𑄛𑄪𑄣𑄨𑄌𑄴 𑄃𑄧𑄜𑄨𑄥𑄢𑄴</annotation>
|
| 104 |
+
<annotation cp="👮♀" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄛𑄪𑄣𑄨𑄌𑄴 𑄃𑄧𑄜𑄨𑄥𑄢𑄴</annotation>
|
| 105 |
+
<annotation cp="👮♀" type="tts" draft="unconfirmed">𑄟𑄨𑄣𑄬 𑄛𑄪𑄣𑄨𑄌𑄴 𑄃𑄧𑄜𑄨𑄥𑄢𑄴</annotation>
|
| 106 |
+
<annotation cp="🤴" draft="unconfirmed">𑄢𑄎 𑄛𑄱</annotation>
|
| 107 |
+
<annotation cp="🤴" type="tts" draft="unconfirmed">𑄢𑄎 𑄛𑄱</annotation>
|
| 108 |
+
<annotation cp="👸" draft="unconfirmed">𑄎𑄢 𑄏𑄨</annotation>
|
| 109 |
+
<annotation cp="👸" type="tts" draft="unconfirmed">𑄎𑄢 𑄏𑄨</annotation>
|
| 110 |
+
<annotation cp="🐵" draft="unconfirmed">𑄝𑄚𑄴𑄘𑄧𑄢𑄴 𑄟𑄪</annotation>
|
| 111 |
+
<annotation cp="🐵" type="tts" draft="unconfirmed">𑄝𑄚𑄴𑄘𑄧𑄢𑄴 𑄟𑄪</annotation>
|
| 112 |
+
<annotation cp="🐒" draft="unconfirmed">𑄝𑄚𑄴𑄘𑄧𑄢𑄴</annotation>
|
| 113 |
+
<annotation cp="🐒" type="tts" draft="unconfirmed">𑄝𑄚𑄴𑄘𑄧𑄢𑄴</annotation>
|
| 114 |
+
<annotation cp="🦍" draft="unconfirmed">𑄉𑄬𑄢𑄨𑄣</annotation>
|
| 115 |
+
<annotation cp="🦍" type="tts" draft="unconfirmed">𑄉𑄬𑄢𑄨𑄣</annotation>
|
| 116 |
+
<annotation cp="🐶" draft="unconfirmed">𑄇𑄪𑄉𑄪𑄢𑄴 𑄟𑄱</annotation>
|
| 117 |
+
<annotation cp="🐶" type="tts" draft="unconfirmed">𑄇𑄪𑄉𑄪𑄢𑄴 𑄟𑄱</annotation>
|
| 118 |
+
<annotation cp="🐕" draft="unconfirmed">𑄇𑄪𑄉𑄪𑄢𑄴</annotation>
|
| 119 |
+
<annotation cp="🐕" type="tts" draft="unconfirmed">𑄇𑄪𑄉𑄪𑄢𑄴</annotation>
|
| 120 |
+
<annotation cp="🐩" draft="unconfirmed">𑄛𑄪𑄖𑄴𑄣𑄨</annotation>
|
| 121 |
+
<annotation cp="🐩" type="tts" draft="unconfirmed">𑄛𑄪𑄖𑄴𑄣𑄨</annotation>
|
| 122 |
+
<annotation cp="🐺" draft="unconfirmed">𑄜𑄬𑄝𑄮 𑄟𑄱</annotation>
|
| 123 |
+
<annotation cp="🐺" type="tts" draft="unconfirmed">𑄜𑄬𑄝𑄮 𑄟𑄱</annotation>
|
| 124 |
+
<annotation cp="🦊" draft="unconfirmed">𑄥𑄨𑄠𑄬𑄣𑄳𑄠 𑄟𑄱</annotation>
|
| 125 |
+
<annotation cp="🦊" type="tts" draft="unconfirmed">𑄥𑄨𑄠𑄬𑄣𑄳𑄠 𑄟𑄱</annotation>
|
| 126 |
+
<annotation cp="🐱" draft="unconfirmed">𑄝𑄨𑄣𑄬𑄭 𑄟𑄱</annotation>
|
| 127 |
+
<annotation cp="🐱" type="tts" draft="unconfirmed">𑄝𑄨𑄣𑄬𑄭 𑄟𑄱</annotation>
|
| 128 |
+
<annotation cp="🐈" draft="unconfirmed">𑄝𑄨𑄣𑄬𑄭</annotation>
|
| 129 |
+
<annotation cp="🐈" type="tts" draft="unconfirmed">𑄝𑄨𑄣𑄬𑄭</annotation>
|
| 130 |
+
<annotation cp="🦁" draft="unconfirmed">𑄥𑄨𑄁𑄦𑄧 𑄟𑄱</annotation>
|
| 131 |
+
<annotation cp="🦁" type="tts" draft="unconfirmed">𑄥𑄨𑄁𑄦𑄧 𑄟𑄱</annotation>
|
| 132 |
+
<annotation cp="🐯" draft="unconfirmed">𑄝𑄊𑄧 𑄟𑄱</annotation>
|
| 133 |
+
<annotation cp="🐯" type="tts" draft="unconfirmed">𑄝𑄊𑄧 𑄟𑄱</annotation>
|
| 134 |
+
<annotation cp="🐅" draft="unconfirmed">𑄝𑄊𑄴</annotation>
|
| 135 |
+
<annotation cp="🐅" type="tts" draft="unconfirmed">𑄝𑄊𑄴</annotation>
|
| 136 |
+
<annotation cp="🐆">𑄌𑄨𑄘𑄨𑄢𑄬 𑄝𑄇𑄴</annotation>
|
| 137 |
+
<annotation cp="🐆" type="tts" draft="unconfirmed">𑄌𑄨𑄘𑄨𑄢𑄬 𑄝𑄇𑄴</annotation>
|
| 138 |
+
<annotation cp="🐴" draft="unconfirmed">𑄊𑄮𑄢 𑄟𑄱</annotation>
|
| 139 |
+
<annotation cp="🐴" type="tts" draft="unconfirmed">𑄊𑄮𑄢 𑄟𑄱</annotation>
|
| 140 |
+
<annotation cp="🐎" draft="unconfirmed">𑄊𑄮𑄢</annotation>
|
| 141 |
+
<annotation cp="🐎" type="tts" draft="unconfirmed">𑄊𑄮𑄢</annotation>
|
| 142 |
+
<annotation cp="🦓" draft="unconfirmed">𑄎𑄬𑄝𑄳𑄢𑄴</annotation>
|
| 143 |
+
<annotation cp="🦓" type="tts" draft="unconfirmed">𑄎𑄬𑄝𑄳𑄢𑄴</annotation>
|
| 144 |
+
<annotation cp="🦌">𑄅𑄢𑄨𑄁</annotation>
|
| 145 |
+
<annotation cp="🦌" type="tts" draft="unconfirmed">𑄅𑄢𑄨𑄁</annotation>
|
| 146 |
+
<annotation cp="🐮" draft="unconfirmed">𑄉𑄧𑄢𑄪 𑄟𑄱</annotation>
|
| 147 |
+
<annotation cp="🐮" type="tts" draft="unconfirmed">𑄉𑄧𑄢𑄪 𑄟𑄱</annotation>
|
| 148 |
+
<annotation cp="🐂" draft="unconfirmed">𑄘𑄟𑄳𑄢𑄴 𑄉𑄧𑄢𑄪</annotation>
|
| 149 |
+
<annotation cp="🐂" type="tts" draft="unconfirmed">𑄘𑄟𑄳𑄢𑄴 𑄉𑄧𑄢𑄪</annotation>
|
| 150 |
+
<annotation cp="🐃" draft="unconfirmed">𑄛𑄚𑄨 𑄦𑄳𑄆𑄬𑄖𑄴</annotation>
|
| 151 |
+
<annotation cp="🐃" type="tts" draft="unconfirmed">𑄛𑄚𑄨 𑄦𑄳𑄆𑄬𑄖𑄴</annotation>
|
| 152 |
+
<annotation cp="🐄">𑄉𑄧𑄢𑄪</annotation>
|
| 153 |
+
<annotation cp="🐄" type="tts" draft="unconfirmed">𑄉𑄧𑄢𑄪</annotation>
|
| 154 |
+
<annotation cp="🐷" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄴 𑄟𑄱</annotation>
|
| 155 |
+
<annotation cp="🐷" type="tts" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄴 𑄟𑄱</annotation>
|
| 156 |
+
<annotation cp="🐖" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄨</annotation>
|
| 157 |
+
<annotation cp="🐖" type="tts" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄨</annotation>
|
| 158 |
+
<annotation cp="🐗" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄴</annotation>
|
| 159 |
+
<annotation cp="🐗" type="tts" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄴</annotation>
|
| 160 |
+
<annotation cp="🐽" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄴 𑄚𑄇𑄴</annotation>
|
| 161 |
+
<annotation cp="🐽" type="tts" draft="unconfirmed">𑄥𑄪𑄉𑄮𑄢𑄴 𑄚𑄇𑄴</annotation>
|
| 162 |
+
<annotation cp="🐏" draft="unconfirmed">𑄞𑄬𑄢</annotation>
|
| 163 |
+
<annotation cp="🐏" type="tts" draft="unconfirmed">𑄞𑄬𑄢</annotation>
|
| 164 |
+
<annotation cp="🐑" draft="unconfirmed">𑄞𑄬𑄢𑄨</annotation>
|
| 165 |
+
<annotation cp="🐑" type="tts" draft="unconfirmed">𑄞𑄬𑄢𑄨</annotation>
|
| 166 |
+
<annotation cp="🐐" draft="unconfirmed">𑄍𑄉𑄧𑄣𑄴</annotation>
|
| 167 |
+
<annotation cp="🐐" type="tts" draft="unconfirmed">𑄍𑄉𑄧𑄣𑄴</annotation>
|
| 168 |
+
<annotation cp="🐪" draft="unconfirmed">𑄅𑄖𑄴</annotation>
|
| 169 |
+
<annotation cp="🐪" type="tts" draft="unconfirmed">𑄅𑄖𑄴</annotation>
|
| 170 |
+
<annotation cp="🦒" draft="unconfirmed">𑄎𑄨𑄢𑄬𑄛𑄴</annotation>
|
| 171 |
+
<annotation cp="🦒" type="tts" draft="unconfirmed">𑄎𑄨𑄢𑄬𑄛𑄴</annotation>
|
| 172 |
+
<annotation cp="🐘">𑄦𑄳𑄆𑄬𑄖𑄴</annotation>
|
| 173 |
+
<annotation cp="🐘" type="tts" draft="unconfirmed">𑄦𑄳𑄆𑄬𑄖𑄴</annotation>
|
| 174 |
+
<annotation cp="🐭" draft="unconfirmed">𑄅𑄚𑄴𑄘𑄪𑄢𑄴 𑄟𑄱</annotation>
|
| 175 |
+
<annotation cp="🐭" type="tts" draft="unconfirmed">𑄅𑄚𑄴𑄘𑄪𑄢𑄴 𑄟𑄱</annotation>
|
| 176 |
+
<annotation cp="🐁">𑄅𑄚𑄴𑄘𑄪𑄢𑄴</annotation>
|
| 177 |
+
<annotation cp="🐁" type="tts" draft="unconfirmed">𑄅𑄚𑄴𑄘𑄪𑄢𑄴</annotation>
|
| 178 |
+
<annotation cp="🐀" draft="unconfirmed">𑄝𑄌𑄴 𑄅𑄚𑄴𑄘𑄪𑄢𑄴</annotation>
|
| 179 |
+
<annotation cp="🐀" type="tts" draft="unconfirmed">𑄝𑄌𑄴 𑄅𑄚𑄴𑄘𑄪𑄢𑄴</annotation>
|
| 180 |
+
<annotation cp="🐰" draft="unconfirmed">𑄈𑄧𑄢𑄴𑄉𑄧𑄌𑄴 𑄟𑄱</annotation>
|
| 181 |
+
<annotation cp="🐰" type="tts" draft="unconfirmed">𑄈𑄧𑄢𑄴𑄉𑄧𑄌𑄴 𑄟𑄱</annotation>
|
| 182 |
+
<annotation cp="🐇" draft="unconfirmed">𑄈𑄧𑄢𑄴𑄉𑄧𑄌𑄴</annotation>
|
| 183 |
+
<annotation cp="🐇" type="tts" draft="unconfirmed">𑄈𑄧𑄢𑄴𑄉𑄧𑄌𑄴</annotation>
|
| 184 |
+
<annotation cp="🦇" draft="unconfirmed">𑄝𑄘𑄮𑄣𑄴</annotation>
|
| 185 |
+
<annotation cp="🦇" type="tts" draft="unconfirmed">𑄝𑄘𑄮𑄣𑄴</annotation>
|
| 186 |
+
<annotation cp="🐻" draft="unconfirmed">𑄞𑄣𑄪𑄇𑄴 𑄟𑄱</annotation>
|
| 187 |
+
<annotation cp="🐻" type="tts" draft="unconfirmed">𑄞𑄣𑄪𑄇𑄴 𑄟𑄱</annotation>
|
| 188 |
+
<annotation cp="🐨" draft="unconfirmed">𑄇𑄮𑄠𑄣</annotation>
|
| 189 |
+
<annotation cp="🐨" type="tts" draft="unconfirmed">𑄇𑄮𑄠𑄣</annotation>
|
| 190 |
+
<annotation cp="🐼" draft="unconfirmed">𑄛𑄚𑄴𑄘 𑄟𑄱</annotation>
|
| 191 |
+
<annotation cp="🐼" type="tts" draft="unconfirmed">𑄛𑄚𑄴𑄘 𑄟𑄱</annotation>
|
| 192 |
+
<annotation cp="🦃" draft="unconfirmed">𑄑𑄢𑄴𑄇𑄨 𑄛𑄪𑄢𑄯</annotation>
|
| 193 |
+
<annotation cp="🦃" type="tts" draft="unconfirmed">𑄑𑄢𑄴𑄇𑄨 𑄛𑄪𑄢𑄯</annotation>
|
| 194 |
+
<annotation cp="🐔" draft="unconfirmed">𑄛𑄪𑄢𑄯 𑄌𑄧</annotation>
|
| 195 |
+
<annotation cp="🐔" type="tts" draft="unconfirmed">𑄛𑄪𑄢𑄯 𑄌𑄧</annotation>
|
| 196 |
+
<annotation cp="🐤" draft="unconfirmed">𑄌𑄨𑄉𑄮𑄚𑄴 𑄛𑄪𑄢𑄯 𑄌𑄧</annotation>
|
| 197 |
+
<annotation cp="🐤" type="tts" draft="unconfirmed">𑄌𑄨𑄉𑄮𑄚𑄴 𑄛𑄪𑄢𑄯 𑄌𑄧</annotation>
|
| 198 |
+
<annotation cp="🐥" draft="unconfirmed">𑄟𑄪𑄎𑄪𑄁𑄠𑄬 𑄟𑄱 𑄌𑄨𑄉𑄮𑄚𑄴 𑄛𑄪𑄢𑄯 𑄌𑄧</annotation>
|
| 199 |
+
<annotation cp="🐥" type="tts" draft="unconfirmed">𑄟𑄪𑄎𑄪𑄁𑄠𑄬 𑄟𑄱 𑄌𑄨𑄉𑄮𑄚𑄴 𑄛𑄪𑄢𑄯 𑄌𑄧</annotation>
|
| 200 |
+
<annotation cp="🐦">𑄛𑄳𑄆𑄬𑄇𑄴</annotation>
|
| 201 |
+
<annotation cp="🐦" type="tts" draft="unconfirmed">𑄛𑄳𑄆𑄬𑄇𑄴</annotation>
|
| 202 |
+
<annotation cp="🐧" draft="unconfirmed">𑄛𑄬𑄁𑄉𑄪𑄄𑄚𑄴</annotation>
|
| 203 |
+
<annotation cp="🐧" type="tts" draft="unconfirmed">𑄛𑄬𑄁𑄉𑄪𑄄𑄚𑄴</annotation>
|
| 204 |
+
<annotation cp="🕊" draft="unconfirmed">𑄇𑄧</annotation>
|
| 205 |
+
<annotation cp="🕊" type="tts" draft="unconfirmed">𑄇𑄧</annotation>
|
| 206 |
+
<annotation cp="🦅" draft="unconfirmed">𑄄𑄉𑄧𑄣𑄴</annotation>
|
| 207 |
+
<annotation cp="🦅" type="tts" draft="unconfirmed">𑄄𑄉𑄧𑄣𑄴</annotation>
|
| 208 |
+
<annotation cp="🦆" draft="unconfirmed">𑄃𑄏 𑄦𑄌𑄴</annotation>
|
| 209 |
+
<annotation cp="🦆" type="tts" draft="unconfirmed">𑄃𑄏 𑄦𑄌𑄴</annotation>
|
| 210 |
+
<annotation cp="🦉" draft="unconfirmed">𑄛𑄬𑄎</annotation>
|
| 211 |
+
<annotation cp="🦉" type="tts" draft="unconfirmed">𑄛𑄬𑄎</annotation>
|
| 212 |
+
<annotation cp="🐸" draft="unconfirmed">𑄝𑄬𑄋𑄧 𑄟𑄱</annotation>
|
| 213 |
+
<annotation cp="🐸" type="tts" draft="unconfirmed">𑄝𑄬𑄋𑄧 𑄟𑄱</annotation>
|
| 214 |
+
<annotation cp="🐊">𑄇𑄪𑄟𑄮𑄢𑄴</annotation>
|
| 215 |
+
<annotation cp="🐊" type="tts" draft="unconfirmed">𑄇𑄪𑄟𑄮𑄢𑄴</annotation>
|
| 216 |
+
<annotation cp="🐢" draft="unconfirmed">𑄘𑄪𑄢𑄴</annotation>
|
| 217 |
+
<annotation cp="🐢" type="tts" draft="unconfirmed">𑄘𑄪𑄢𑄴</annotation>
|
| 218 |
+
<annotation cp="🦎" draft="unconfirmed">𑄑𑄪𑄖𑄴𑄑𑄪𑄝𑄨</annotation>
|
| 219 |
+
<annotation cp="🦎" type="tts" draft="unconfirmed">𑄑𑄪𑄖𑄴𑄑𑄪𑄝𑄨</annotation>
|
| 220 |
+
<annotation cp="🐍" draft="unconfirmed">𑄥𑄛𑄴</annotation>
|
| 221 |
+
<annotation cp="🐍" type="tts" draft="unconfirmed">𑄥𑄛𑄴</annotation>
|
| 222 |
+
<annotation cp="🐲" draft="unconfirmed">𑄓𑄳𑄢𑄉𑄧𑄚𑄴 𑄟𑄱</annotation>
|
| 223 |
+
<annotation cp="🐲" type="tts" draft="unconfirmed">𑄓𑄳𑄢𑄉𑄧𑄚𑄴 𑄟𑄱</annotation>
|
| 224 |
+
<annotation cp="🐉" draft="unconfirmed">𑄓𑄳𑄢𑄉𑄧𑄚𑄴</annotation>
|
| 225 |
+
<annotation cp="🐉" type="tts" draft="unconfirmed">𑄓𑄳𑄢𑄉𑄧𑄚𑄴</annotation>
|
| 226 |
+
<annotation cp="🐋">𑄖𑄨𑄟𑄨 𑄟𑄌𑄴</annotation>
|
| 227 |
+
<annotation cp="🐋" type="tts" draft="unconfirmed">𑄖𑄨𑄟𑄨 𑄟𑄌𑄴</annotation>
|
| 228 |
+
<annotation cp="🐬" draft="unconfirmed">𑄓𑄧𑄣𑄴𑄜𑄨𑄚𑄴</annotation>
|
| 229 |
+
<annotation cp="🐬" type="tts" draft="unconfirmed">𑄓𑄧𑄣𑄴𑄜𑄨𑄚𑄴</annotation>
|
| 230 |
+
<annotation cp="🐟" draft="unconfirmed">𑄟𑄌𑄴</annotation>
|
| 231 |
+
<annotation cp="🐟" type="tts" draft="unconfirmed">𑄟𑄌𑄴</annotation>
|
| 232 |
+
<annotation cp="🦈" draft="unconfirmed">𑄦𑄋𑄮𑄢𑄴 𑄟𑄌𑄴</annotation>
|
| 233 |
+
<annotation cp="🦈" type="tts" draft="unconfirmed">𑄦𑄋𑄮𑄢𑄴 𑄟𑄌𑄴</annotation>
|
| 234 |
+
<annotation cp="🐙">𑄃𑄧𑄇𑄴𑄑𑄮𑄛𑄌𑄴</annotation>
|
| 235 |
+
<annotation cp="🐙" type="tts" draft="unconfirmed">𑄃𑄧𑄇𑄴𑄑𑄮𑄛𑄌𑄴</annotation>
|
| 236 |
+
<annotation cp="🐌">𑄥𑄟𑄪𑄇𑄴</annotation>
|
| 237 |
+
<annotation cp="🐌" type="tts" draft="unconfirmed">𑄥𑄟𑄪𑄇𑄴</annotation>
|
| 238 |
+
<annotation cp="🦋" draft="unconfirmed">𑄛𑄖𑄳𑄦𑄴𑄛𑄧𑄖𑄴𑄨</annotation>
|
| 239 |
+
<annotation cp="🦋" type="tts" draft="unconfirmed">𑄛𑄖𑄳𑄦𑄴𑄛𑄧𑄖𑄴𑄨</annotation>
|
| 240 |
+
<annotation cp="🐛" draft="unconfirmed">𑄇𑄧𑄢𑄧𑄢𑄴 𑄛𑄪𑄇𑄴</annotation>
|
| 241 |
+
<annotation cp="🐛" type="tts" draft="unconfirmed">𑄇𑄧𑄢𑄧𑄢𑄴 𑄛𑄪𑄇𑄴</annotation>
|
| 242 |
+
<annotation cp="🐝" draft="unconfirmed">𑄟𑄪 𑄛𑄪𑄇𑄴</annotation>
|
| 243 |
+
<annotation cp="🐝" type="tts" draft="unconfirmed">𑄟𑄪 𑄛𑄪𑄇𑄴</annotation>
|
| 244 |
+
<annotation cp="🐞" draft="unconfirmed">𑄛𑄪𑄇𑄴</annotation>
|
| 245 |
+
<annotation cp="🐞" type="tts" draft="unconfirmed">𑄛𑄪𑄇𑄴</annotation>
|
| 246 |
+
<annotation cp="🦗" draft="unconfirmed">𑄉𑄪𑄟𑄪𑄢𑄯</annotation>
|
| 247 |
+
<annotation cp="🦗" type="tts" draft="unconfirmed">𑄉𑄪𑄟𑄪𑄢𑄯</annotation>
|
| 248 |
+
<annotation cp="🕷" draft="unconfirmed">𑄟𑄉𑄧𑄢𑄧𑄇𑄴</annotation>
|
| 249 |
+
<annotation cp="🕷" type="tts" draft="unconfirmed">𑄟𑄉𑄧𑄢𑄧𑄇𑄴</annotation>
|
| 250 |
+
<annotation cp="🕸" draft="unconfirmed">𑄟𑄉𑄧𑄢𑄧𑄇𑄴 𑄎𑄣𑄴</annotation>
|
| 251 |
+
<annotation cp="🕸" type="tts" draft="unconfirmed">𑄟𑄉𑄧𑄢𑄧𑄇𑄴 𑄎𑄣𑄴</annotation>
|
| 252 |
+
<annotation cp="🦂" draft="unconfirmed">𑄝𑄨𑄎𑄳𑄠</annotation>
|
| 253 |
+
<annotation cp="🦂" type="tts" draft="unconfirmed">𑄝𑄨𑄎𑄳𑄠</annotation>
|
| 254 |
+
<annotation cp="💮" draft="unconfirmed">𑄘𑄪𑄛𑄴 𑄜𑄪𑄣𑄴</annotation>
|
| 255 |
+
<annotation cp="💮" type="tts" draft="unconfirmed">𑄘𑄪𑄛𑄴 𑄜𑄪𑄣𑄴</annotation>
|
| 256 |
+
<annotation cp="🌹" draft="unconfirmed">𑄉𑄮𑄣𑄛𑄴 𑄜𑄪𑄣𑄴</annotation>
|
| 257 |
+
<annotation cp="🌹" type="tts" draft="unconfirmed">𑄉𑄮𑄣𑄛𑄴 𑄜𑄪𑄣𑄴</annotation>
|
| 258 |
+
<annotation cp="🌱">𑄉𑄎𑄧 𑄍𑄢</annotation>
|
| 259 |
+
<annotation cp="🌱" type="tts" draft="unconfirmed">𑄉𑄎𑄧 𑄍𑄢</annotation>
|
| 260 |
+
<annotation cp="🌲" draft="unconfirmed">𑄦𑄬𑄣𑄴 𑄉𑄌𑄴</annotation>
|
| 261 |
+
<annotation cp="🌲" type="tts" draft="unconfirmed">𑄦𑄬𑄣𑄴 𑄉𑄌𑄴</annotation>
|
| 262 |
+
<annotation cp="🌳" draft="unconfirmed">𑄎𑄮𑄝𑄪𑄢𑄴 𑄉𑄌𑄴</annotation>
|
| 263 |
+
<annotation cp="🌳" type="tts" draft="unconfirmed">𑄎𑄮𑄝𑄪𑄢𑄴 𑄉𑄌𑄴</annotation>
|
| 264 |
+
<annotation cp="🌴" draft="unconfirmed">𑄖𑄣𑄴 𑄉𑄌𑄴</annotation>
|
| 265 |
+
<annotation cp="🌴" type="tts" draft="unconfirmed">𑄖𑄣𑄴 𑄉𑄌𑄴</annotation>
|
| 266 |
+
<annotation cp="🌵" draft="unconfirmed">𑄇𑄳𑄠𑄇𑄴𑄑𑄌𑄴</annotation>
|
| 267 |
+
<annotation cp="🌵" type="tts" draft="unconfirmed">𑄇𑄳𑄠𑄇𑄴𑄑𑄌𑄴</annotation>
|
| 268 |
+
<annotation cp="🍁" draft="unconfirmed">𑄟𑄳𑄠𑄛𑄧𑄣𑄴 𑄛𑄘</annotation>
|
| 269 |
+
<annotation cp="🍁" type="tts" draft="unconfirmed">𑄟𑄳𑄠𑄛𑄧𑄣𑄴 𑄛𑄘</annotation>
|
| 270 |
+
<annotation cp="🍂" draft="unconfirmed">𑄛𑄧𑄢𑄬𑄖𑄳𑄠𑄴 𑄛𑄘</annotation>
|
| 271 |
+
<annotation cp="🍂" type="tts" draft="unconfirmed">𑄛𑄧𑄢𑄬𑄖𑄳𑄠𑄴 𑄛𑄘</annotation>
|
| 272 |
+
<annotation cp="🍄" draft="unconfirmed">𑄥𑄟𑄴𑄮𑄅𑄣𑄴</annotation>
|
| 273 |
+
<annotation cp="🍄" type="tts" draft="unconfirmed">𑄥𑄟𑄴𑄮𑄅𑄣𑄴</annotation>
|
| 274 |
+
<annotation cp="🍇" draft="unconfirmed">𑄃𑄋𑄴𑄉𑄪𑄢𑄴</annotation>
|
| 275 |
+
<annotation cp="🍇" type="tts" draft="unconfirmed">𑄃𑄋𑄴𑄉𑄪𑄢𑄴</annotation>
|
| 276 |
+
<annotation cp="🍈" draft="unconfirmed">𑄖𑄮𑄢𑄴𑄟𑄮𑄌𑄴</annotation>
|
| 277 |
+
<annotation cp="🍈" type="tts" draft="unconfirmed">𑄖𑄮𑄢𑄴𑄟𑄮𑄌𑄴</annotation>
|
| 278 |
+
<annotation cp="🍉" draft="unconfirmed">𑄛𑄚𑄳𑄠𑄴 𑄖𑄮𑄢𑄴𑄟𑄮𑄌𑄴</annotation>
|
| 279 |
+
<annotation cp="🍉" type="tts" draft="unconfirmed">𑄛𑄚𑄳𑄠𑄴 𑄖𑄮𑄢𑄴𑄟𑄮𑄌𑄴</annotation>
|
| 280 |
+
<annotation cp="🍊" draft="unconfirmed">𑄖𑄁𑄉𑄬𑄢𑄭𑄚𑄴</annotation>
|
| 281 |
+
<annotation cp="🍊" type="tts" draft="unconfirmed">𑄖𑄁𑄉𑄬𑄢𑄭𑄚𑄴</annotation>
|
| 282 |
+
<annotation cp="🍋" draft="unconfirmed">𑄇𑄉𑄮𑄎𑄨</annotation>
|
| 283 |
+
<annotation cp="🍋" type="tts" draft="unconfirmed">𑄇𑄉𑄮𑄎𑄨</annotation>
|
| 284 |
+
<annotation cp="🍌" draft="unconfirmed">𑄇𑄧𑄣</annotation>
|
| 285 |
+
<annotation cp="🍌" type="tts" draft="unconfirmed">𑄇𑄧𑄣</annotation>
|
| 286 |
+
<annotation cp="🍍" draft="unconfirmed">𑄃𑅅𑄚𑄌𑄴</annotation>
|
| 287 |
+
<annotation cp="🍍" type="tts" draft="unconfirmed">𑄃𑅅𑄚𑄌𑄴</annotation>
|
| 288 |
+
<annotation cp="🥭" draft="unconfirmed">𑄃𑄟𑄴</annotation>
|
| 289 |
+
<annotation cp="🥭" type="tts" draft="unconfirmed">𑄃𑄟𑄴</annotation>
|
| 290 |
+
<annotation cp="🍎" draft="unconfirmed">𑄢𑄋 𑄃𑄛𑄬𑄣𑄴</annotation>
|
| 291 |
+
<annotation cp="🍎" type="tts" draft="unconfirmed">𑄢𑄋 𑄃𑄛𑄬𑄣𑄴</annotation>
|
| 292 |
+
<annotation cp="🍏" draft="unconfirmed">𑄥𑄮𑄌𑄴 𑄃𑄛𑄬𑄣𑄴</annotation>
|
| 293 |
+
<annotation cp="🍏" type="tts" draft="unconfirmed">𑄥𑄮𑄌𑄴 𑄃𑄛𑄬𑄣𑄴</annotation>
|
| 294 |
+
<annotation cp="🍐" draft="unconfirmed">𑄛𑄨𑄠𑄢𑄴</annotation>
|
| 295 |
+
<annotation cp="🍐" type="tts" draft="unconfirmed">𑄛𑄨𑄠𑄢𑄴</annotation>
|
| 296 |
+
<annotation cp="🍑" draft="unconfirmed">𑄛𑄨𑄌𑄴</annotation>
|
| 297 |
+
<annotation cp="🍑" type="tts" draft="unconfirmed">𑄛𑄨𑄌𑄴</annotation>
|
| 298 |
+
<annotation cp="🍒" draft="unconfirmed">𑄌𑄬𑄢𑄨</annotation>
|
| 299 |
+
<annotation cp="🍒" type="tts" draft="unconfirmed">𑄌𑄬𑄢𑄨</annotation>
|
| 300 |
+
<annotation cp="🍓" draft="unconfirmed">𑄆𑄌𑄴𑄖𑄳𑄢𑄧𑄝𑄬𑄢𑄨</annotation>
|
| 301 |
+
<annotation cp="🍓" type="tts" draft="unconfirmed">𑄆𑄌𑄴𑄖𑄳𑄢𑄧𑄝𑄬𑄢𑄨</annotation>
|
| 302 |
+
<annotation cp="🥝" draft="unconfirmed">𑄇𑄪𑄄 𑄜𑄧𑄣𑄴</annotation>
|
| 303 |
+
<annotation cp="🥝" type="tts" draft="unconfirmed">𑄇𑄪𑄄 𑄜𑄧𑄣𑄴</annotation>
|
| 304 |
+
<annotation cp="🍅" draft="unconfirmed">𑄈𑄧𑄢𑄧 𑄝𑄨𑄉𑄪𑄚𑄴</annotation>
|
| 305 |
+
<annotation cp="🍅" type="tts" draft="unconfirmed">𑄈𑄧𑄢𑄧 𑄝𑄨𑄉𑄪𑄚𑄴</annotation>
|
| 306 |
+
<annotation cp="🥥" draft="unconfirmed">𑄚𑄢𑄬𑄇𑄪𑄣𑄴</annotation>
|
| 307 |
+
<annotation cp="🥥" type="tts" draft="unconfirmed">𑄚𑄢𑄬𑄇𑄪𑄣𑄴</annotation>
|
| 308 |
+
<annotation cp="🥑" draft="unconfirmed">𑄆𑄝𑄇𑄘𑄮</annotation>
|
| 309 |
+
<annotation cp="🥑" type="tts" draft="unconfirmed">𑄆𑄝𑄇𑄘𑄮</annotation>
|
| 310 |
+
<annotation cp="🍆" draft="unconfirmed">𑄝𑄢𑄳𑄦𑄧 𑄟𑄌𑄳𑄠𑄴 𑄝𑄨𑄉𑄪𑄚𑄴</annotation>
|
| 311 |
+
<annotation cp="🍆" type="tts" draft="unconfirmed">𑄝𑄢𑄳𑄦𑄧 𑄟����𑄳𑄠𑄴 𑄝𑄨𑄉𑄪𑄚𑄴</annotation>
|
| 312 |
+
<annotation cp="🥔" draft="unconfirmed">𑄃𑄣𑄪</annotation>
|
| 313 |
+
<annotation cp="🥔" type="tts" draft="unconfirmed">𑄃𑄣𑄪</annotation>
|
| 314 |
+
<annotation cp="🥕" draft="unconfirmed">𑄉𑄎𑄧𑄢𑄴</annotation>
|
| 315 |
+
<annotation cp="🥕" type="tts" draft="unconfirmed">𑄉𑄎𑄧𑄢𑄴</annotation>
|
| 316 |
+
<annotation cp="🌽" draft="unconfirmed">𑄟𑄮𑄇𑄳𑄠𑄴 𑄌𑄮𑄉𑄮𑄣</annotation>
|
| 317 |
+
<annotation cp="🌽" type="tts" draft="unconfirmed">𑄟𑄮𑄇𑄳𑄠𑄴 𑄌𑄮𑄉𑄮𑄣</annotation>
|
| 318 |
+
<annotation cp="🌶" draft="unconfirmed">𑄏𑄣𑄴 𑄟𑄧𑄢𑄨𑄌𑄴</annotation>
|
| 319 |
+
<annotation cp="🌶" type="tts" draft="unconfirmed">𑄏𑄣𑄴 𑄟𑄧𑄢𑄨𑄌𑄴</annotation>
|
| 320 |
+
<annotation cp="🥒" draft="unconfirmed">𑄜𑄧𑄣𑄴</annotation>
|
| 321 |
+
<annotation cp="🥒" type="tts" draft="unconfirmed">𑄜𑄧𑄣𑄴</annotation>
|
| 322 |
+
<annotation cp="🥬" draft="unconfirmed">𑄦𑄬𑄣𑄴 𑄛𑄘</annotation>
|
| 323 |
+
<annotation cp="🥬" type="tts" draft="unconfirmed">𑄦𑄬𑄣𑄴 𑄛𑄘</annotation>
|
| 324 |
+
<annotation cp="🥦" draft="unconfirmed">𑄝𑄳𑄢𑄧𑄪𑄇𑄴𑄧𑄣𑄨</annotation>
|
| 325 |
+
<annotation cp="🥦" type="tts" draft="unconfirmed">𑄝𑄳𑄢𑄧𑄪𑄇𑄴𑄧𑄣𑄨</annotation>
|
| 326 |
+
<annotation cp="🥜" draft="unconfirmed">𑄝𑄘𑄟𑄴</annotation>
|
| 327 |
+
<annotation cp="🥜" type="tts" draft="unconfirmed">𑄝𑄘𑄟𑄴</annotation>
|
| 328 |
+
<annotation cp="🍞" draft="unconfirmed">𑄢𑄪𑄖𑄨</annotation>
|
| 329 |
+
<annotation cp="🍞" type="tts" draft="unconfirmed">𑄢𑄪𑄖𑄨</annotation>
|
| 330 |
+
<annotation cp="🥞" draft="unconfirmed">𑄛𑄬𑄚𑄴𑄇𑄬𑄇𑄴</annotation>
|
| 331 |
+
<annotation cp="🥞" type="tts" draft="unconfirmed">𑄛𑄬𑄚𑄴𑄇𑄬𑄇𑄴</annotation>
|
| 332 |
+
<annotation cp="🍖" draft="unconfirmed">𑄃𑄢𑄧𑄢𑄧𑄢𑄴 𑄦𑄬𑄢 𑄥𑄌𑄴</annotation>
|
| 333 |
+
<annotation cp="🍖" type="tts" draft="unconfirmed">𑄃𑄢𑄧𑄢𑄧𑄢𑄴 𑄦𑄬𑄢 𑄥𑄌𑄴</annotation>
|
| 334 |
+
<annotation cp="🍗" draft="unconfirmed">𑄜𑄢𑄧𑄟𑄧 𑄛𑄪𑄢𑄯 𑄒𑄳𑄠𑄁</annotation>
|
| 335 |
+
<annotation cp="🍗" type="tts" draft="unconfirmed">𑄜𑄢𑄧𑄟𑄧 𑄛𑄪𑄢𑄯 𑄒𑄳𑄠𑄁</annotation>
|
| 336 |
+
<annotation cp="🥩" draft="unconfirmed">𑄦𑄬𑄢 𑄘𑄮𑄟</annotation>
|
| 337 |
+
<annotation cp="🥩" type="tts" draft="unconfirmed">𑄦𑄬𑄢 𑄘𑄮𑄟</annotation>
|
| 338 |
+
<annotation cp="🥓" draft="unconfirmed">𑄝𑄇𑄧𑄚𑄴</annotation>
|
| 339 |
+
<annotation cp="🥓" type="tts" draft="unconfirmed">𑄝𑄇𑄧𑄚𑄴</annotation>
|
| 340 |
+
<annotation cp="🍟" draft="unconfirmed">𑄜𑄳𑄢𑄬𑄚𑄴𑄌𑄴 𑄞𑄎</annotation>
|
| 341 |
+
<annotation cp="🍟" type="tts" draft="unconfirmed">𑄜𑄳𑄢𑄬𑄚𑄴𑄌𑄴 𑄞𑄎</annotation>
|
| 342 |
+
<annotation cp="🍕" draft="unconfirmed">𑄛𑄨𑄎</annotation>
|
| 343 |
+
<annotation cp="🍕" type="tts" draft="unconfirmed">𑄛𑄨𑄎</annotation>
|
| 344 |
+
<annotation cp="🌭" draft="unconfirmed">𑄦𑄧𑄖𑄴 𑄓𑄧𑄇𑄴</annotation>
|
| 345 |
+
<annotation cp="🌭" type="tts" draft="unconfirmed">𑄦𑄧𑄖𑄴 𑄓𑄧𑄇𑄴</annotation>
|
| 346 |
+
<annotation cp="🥪">𑄢𑄪𑄖𑄨 | 𑄥𑄳𑄠𑄚𑄴𑄅𑄄𑄌𑄴</annotation>
|
| 347 |
+
<annotation cp="🌮" draft="unconfirmed">𑄑𑄳𑄠𑄇𑄮</annotation>
|
| 348 |
+
<annotation cp="🌮" type="tts" draft="unconfirmed">𑄑𑄳𑄠𑄇𑄮</annotation>
|
| 349 |
+
<annotation cp="🌯" draft="unconfirmed">𑄝𑄪𑄢𑄨𑄖𑄮</annotation>
|
| 350 |
+
<annotation cp="🌯" type="tts" draft="unconfirmed">𑄝𑄪𑄢𑄨𑄖𑄮</annotation>
|
| 351 |
+
<annotation cp="🥚" draft="unconfirmed">𑄝𑄮𑄘</annotation>
|
| 352 |
+
<annotation cp="🥚" type="tts" draft="unconfirmed">𑄝𑄮𑄘</annotation>
|
| 353 |
+
<annotation cp="🍳" draft="unconfirmed">𑄢𑄚𑄚</annotation>
|
| 354 |
+
<annotation cp="🍳" type="tts" draft="unconfirmed">𑄢𑄚𑄚</annotation>
|
| 355 |
+
<annotation cp="🥗" draft="unconfirmed">𑄇𑄎 𑄣𑄘𑄖𑄴</annotation>
|
| 356 |
+
<annotation cp="🥗" type="tts" draft="unconfirmed">𑄇𑄎 𑄣𑄘𑄖𑄴</annotation>
|
| 357 |
+
<annotation cp="🍙" draft="unconfirmed">𑄞𑄖𑄴 𑄉𑄟𑄣</annotation>
|
| 358 |
+
<annotation cp="🍙" type="tts" draft="unconfirmed">𑄞𑄖𑄴 𑄉𑄟𑄣</annotation>
|
| 359 |
+
<annotation cp="🍚" draft="unconfirmed">𑄢𑄚𑄳𑄠𑄴 𑄞𑄖𑄴</annotation>
|
| 360 |
+
<annotation cp="🍚" type="tts" draft="unconfirmed">𑄢𑄚𑄳𑄠𑄴 𑄞𑄖𑄴</annotation>
|
| 361 |
+
<annotation cp="🦀" draft="unconfirmed">𑄇𑄋𑄢</annotation>
|
| 362 |
+
<annotation cp="🦀" type="tts" draft="unconfirmed">𑄇𑄋𑄢</annotation>
|
| 363 |
+
<annotation cp="🦐" draft="unconfirmed">𑄄𑄎𑄳𑄠</annotation>
|
| 364 |
+
<annotation cp="🦐" type="tts" draft="unconfirmed">𑄄𑄎𑄳𑄠</annotation>
|
| 365 |
+
<annotation cp="🍨" draft="unconfirmed">𑄃𑄌𑄴𑄇𑄳𑄢𑄨𑄟𑄴</annotation>
|
| 366 |
+
<annotation cp="🍨" type="tts" draft="unconfirmed">𑄃𑄌𑄴𑄇𑄳𑄢𑄨𑄟𑄴</annotation>
|
| 367 |
+
<annotation cp="🍯" draft="unconfirmed">𑄟𑄧𑄙𑄪 ����𑄧𑄖𑄴</annotation>
|
| 368 |
+
<annotation cp="🍯" type="tts" draft="unconfirmed">𑄟𑄧𑄙𑄪 𑄛𑄧𑄖𑄴</annotation>
|
| 369 |
+
<annotation cp="🍼" draft="unconfirmed">𑄇𑄪𑄏𑄨 𑄌𑄨𑄌𑄴𑄨𑄇𑄴𑄮𑄢𑄴 𑄝𑄧𑄘𑄧𑄣𑄴</annotation>
|
| 370 |
+
<annotation cp="🍼" type="tts" draft="unconfirmed">𑄇𑄪𑄏𑄨 𑄌𑄨𑄌𑄴𑄨𑄇𑄴𑄮𑄢𑄴 𑄝𑄧𑄘𑄧𑄣𑄴</annotation>
|
| 371 |
+
<annotation cp="🥛" draft="unconfirmed">𑄘𑄪𑄙𑄮 𑄉𑄧𑄣𑄧𑄌𑄴</annotation>
|
| 372 |
+
<annotation cp="🥛" type="tts" draft="unconfirmed">𑄘𑄪𑄙𑄮 𑄉𑄧𑄣𑄧𑄌𑄴</annotation>
|
| 373 |
+
<annotation cp="🍶" draft="unconfirmed">𑄟𑄪𑄉𑄪𑄎𑄮</annotation>
|
| 374 |
+
<annotation cp="🍶" type="tts" draft="unconfirmed">𑄟𑄪𑄉𑄪𑄎𑄮</annotation>
|
| 375 |
+
<annotation cp="🍷" draft="unconfirmed">𑄟𑄧𑄘𑄧 𑄉𑄧𑄣𑄧𑄌𑄴</annotation>
|
| 376 |
+
<annotation cp="🍷" type="tts" draft="unconfirmed">𑄟𑄧𑄘𑄧 𑄉𑄧𑄣𑄧𑄌𑄴</annotation>
|
| 377 |
+
<annotation cp="🥄" draft="unconfirmed">𑄌𑄟𑄬𑄌𑄴</annotation>
|
| 378 |
+
<annotation cp="🥄" type="tts" draft="unconfirmed">𑄌𑄟𑄬𑄌𑄴</annotation>
|
| 379 |
+
<annotation cp="🔪" draft="unconfirmed">𑄛𑄇𑄴𑄊𑄧𑄢𑄧𑄢𑄴 𑄌𑄪𑄢𑄨</annotation>
|
| 380 |
+
<annotation cp="🔪" type="tts" draft="unconfirmed">𑄛𑄇𑄴𑄊𑄧𑄢𑄧𑄢𑄴 𑄌𑄪𑄢𑄨</annotation>
|
| 381 |
+
<annotation cp="🗺" draft="unconfirmed">𑄛𑄨𑄖𑄴𑄨𑄟𑄨 𑄟𑄳𑄠𑄛𑄴</annotation>
|
| 382 |
+
<annotation cp="🗺" type="tts" draft="unconfirmed">𑄛𑄨𑄖𑄴𑄨𑄟𑄨 𑄟𑄳𑄠𑄛𑄴</annotation>
|
| 383 |
+
<annotation cp="🗾" draft="unconfirmed">𑄎𑄛𑄚𑄧𑄢𑄴 𑄟𑄳𑄠𑄛𑄴</annotation>
|
| 384 |
+
<annotation cp="🗾" type="tts" draft="unconfirmed">𑄎𑄛𑄚𑄧𑄢𑄴 𑄟𑄳𑄠𑄛𑄴</annotation>
|
| 385 |
+
<annotation cp="🌋" draft="unconfirmed">𑄃𑄉𑄪𑄚𑄮𑄢𑄴 𑄜𑄪𑄘𑄋𑄢𑄳𑄦</annotation>
|
| 386 |
+
<annotation cp="🌋" type="tts" draft="unconfirmed">𑄃𑄉𑄪𑄚𑄮𑄢𑄴 𑄜𑄪𑄘𑄋𑄢𑄳𑄦</annotation>
|
| 387 |
+
<annotation cp="🏘">𑄊𑄧𑄢𑄚𑄨</annotation>
|
| 388 |
+
<annotation cp="🏘" type="tts" draft="unconfirmed">𑄊𑄧𑄢𑄚𑄨</annotation>
|
| 389 |
+
<annotation cp="🏠" draft="unconfirmed">𑄊𑄧𑄢𑄴</annotation>
|
| 390 |
+
<annotation cp="🏠" type="tts" draft="unconfirmed">𑄊𑄧𑄢𑄴</annotation>
|
| 391 |
+
<annotation cp="🏫" draft="unconfirmed">𑄄𑄌𑄴𑄇𑄪𑄣𑄴</annotation>
|
| 392 |
+
<annotation cp="🏫" type="tts" draft="unconfirmed">𑄄𑄌𑄴𑄇𑄪𑄣𑄴</annotation>
|
| 393 |
+
<annotation cp="🏭" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄑𑄧𑄢𑄨</annotation>
|
| 394 |
+
<annotation cp="🏭" type="tts" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄑𑄧𑄢𑄨</annotation>
|
| 395 |
+
<annotation cp="🗼" draft="unconfirmed">𑄑𑄮𑄇𑄨𑄠𑄮 𑄑𑄅𑄠𑄢𑄴</annotation>
|
| 396 |
+
<annotation cp="🗼" type="tts" draft="unconfirmed">𑄑𑄮𑄇𑄨𑄠𑄮 𑄑𑄅𑄠𑄢𑄴</annotation>
|
| 397 |
+
<annotation cp="📣" draft="unconfirmed">𑄟𑄳𑄠𑄊𑄜𑄮𑄚𑄴</annotation>
|
| 398 |
+
<annotation cp="📣" type="tts" draft="unconfirmed">𑄟𑄳𑄠𑄊𑄜𑄮𑄚𑄴</annotation>
|
| 399 |
+
<annotation cp="🔔">𑄝𑄬𑄣𑄴</annotation>
|
| 400 |
+
<annotation cp="🔔" type="tts" draft="unconfirmed">𑄝𑄬𑄣𑄴</annotation>
|
| 401 |
+
<annotation cp="🎤" draft="unconfirmed">𑄟𑄭𑄇𑄳𑄢𑄮𑄜𑄮𑄚𑄴</annotation>
|
| 402 |
+
<annotation cp="🎤" type="tts" draft="unconfirmed">𑄟𑄭𑄇𑄳𑄢𑄮𑄜𑄮𑄚𑄴</annotation>
|
| 403 |
+
<annotation cp="🎧" draft="unconfirmed">𑄖𑄬𑄖𑄴𑄜𑄮𑄚𑄴</annotation>
|
| 404 |
+
<annotation cp="🎧" type="tts" draft="unconfirmed">𑄖𑄬𑄖𑄴𑄜𑄮𑄚𑄴</annotation>
|
| 405 |
+
<annotation cp="📻" draft="unconfirmed">𑄢𑄬𑄓𑄨𑄠𑄮</annotation>
|
| 406 |
+
<annotation cp="📻" type="tts" draft="unconfirmed">𑄢𑄬𑄓𑄨𑄠𑄮</annotation>
|
| 407 |
+
<annotation cp="🎸" draft="unconfirmed">𑄉𑄨𑄑𑄢𑄴</annotation>
|
| 408 |
+
<annotation cp="🎸" type="tts" draft="unconfirmed">𑄉𑄨𑄑𑄢𑄴</annotation>
|
| 409 |
+
<annotation cp="🥁" draft="unconfirmed">𑄓𑄳𑄢𑄟𑄴</annotation>
|
| 410 |
+
<annotation cp="🥁" type="tts" draft="unconfirmed">𑄓𑄳𑄢𑄟𑄴</annotation>
|
| 411 |
+
<annotation cp="📱" draft="unconfirmed">𑄟𑄮𑄝𑄭𑄣𑄴𑄜𑄮𑄚𑄴</annotation>
|
| 412 |
+
<annotation cp="📱" type="tts" draft="unconfirmed">𑄟𑄮𑄝𑄭𑄣𑄴𑄜𑄮𑄚𑄴</annotation>
|
| 413 |
+
<annotation cp="☎" draft="unconfirmed">𑄑𑄬𑄣𑄨𑄜𑄮𑄚𑄴</annotation>
|
| 414 |
+
<annotation cp="☎" type="tts" draft="unconfirmed">𑄑𑄬𑄣𑄨𑄜𑄮𑄚𑄴</annotation>
|
| 415 |
+
<annotation cp="📞" draft="unconfirmed">𑄑𑄬𑄣𑄨𑄜𑄮𑄚𑄴 𑄢𑄨𑄥𑄨𑄞𑄢𑄴</annotation>
|
| 416 |
+
<annotation cp="📞" type="tts" draft="unconfirmed">𑄑𑄬𑄣𑄨𑄜𑄮𑄚𑄴 𑄢𑄨𑄥𑄨𑄞𑄢𑄴</annotation>
|
| 417 |
+
<annotation cp="📠" draft="unconfirmed">𑄜𑄳𑄠𑄇𑄴𑄌𑄴 𑄟𑄨𑄥𑄨𑄚𑄴</annotation>
|
| 418 |
+
<annotation cp="📠" type="tts" draft="unconfirmed">𑄜𑄳𑄠𑄇���𑄌𑄴 𑄟𑄨𑄥𑄨𑄚𑄴</annotation>
|
| 419 |
+
<annotation cp="🔋">𑄝𑄬𑄑𑄢𑄨</annotation>
|
| 420 |
+
<annotation cp="🔋" type="tts" draft="unconfirmed">𑄝𑄬𑄑𑄢𑄨</annotation>
|
| 421 |
+
<annotation cp="💻" draft="unconfirmed">𑄣𑄳𑄠𑄛𑄴𑄑𑄧𑄛𑄴 𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴</annotation>
|
| 422 |
+
<annotation cp="💻" type="tts" draft="unconfirmed">𑄣𑄳𑄠𑄛𑄴𑄑𑄧𑄛𑄴 𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴</annotation>
|
| 423 |
+
<annotation cp="🖥" draft="unconfirmed">𑄓𑄬𑄌𑄴𑄇𑄴𑄑𑄧𑄛𑄴 𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴</annotation>
|
| 424 |
+
<annotation cp="🖥" type="tts" draft="unconfirmed">𑄓𑄬𑄌𑄴𑄇𑄴𑄑𑄧𑄛𑄴 𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴</annotation>
|
| 425 |
+
<annotation cp="🖨" draft="unconfirmed">𑄛𑄳𑄢𑄨𑄚𑄴𑄑𑄢𑄴</annotation>
|
| 426 |
+
<annotation cp="🖨" type="tts" draft="unconfirmed">𑄛𑄳𑄢𑄨𑄚𑄴𑄑𑄢𑄴</annotation>
|
| 427 |
+
<annotation cp="⌨" draft="unconfirmed">𑄇𑄨𑄝𑄮𑄖𑄴𑄢𑄴</annotation>
|
| 428 |
+
<annotation cp="⌨" type="tts" draft="unconfirmed">𑄇𑄨𑄝𑄮𑄖𑄴𑄢𑄴</annotation>
|
| 429 |
+
<annotation cp="🖱" draft="unconfirmed">𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴 𑄟𑄅𑄌𑄴𑄴</annotation>
|
| 430 |
+
<annotation cp="🖱" type="tts" draft="unconfirmed">𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴 𑄟𑄅𑄌𑄴𑄴</annotation>
|
| 431 |
+
<annotation cp="🖲" draft="unconfirmed">𑄑𑄳𑄢𑄇𑄴𑄝𑄧𑄣𑄴</annotation>
|
| 432 |
+
<annotation cp="🖲" type="tts" draft="unconfirmed">𑄑𑄳𑄢𑄇𑄴𑄝𑄧𑄣𑄴</annotation>
|
| 433 |
+
<annotation cp="💽" draft="unconfirmed">𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴 𑄓𑄨𑄌𑄴𑄇𑄴</annotation>
|
| 434 |
+
<annotation cp="💽" type="tts" draft="unconfirmed">𑄇𑄧𑄟𑄴𑄛𑄅𑄑𑄢𑄴 𑄓𑄨𑄌𑄴𑄇𑄴</annotation>
|
| 435 |
+
<annotation cp="💾" draft="unconfirmed">𑄜𑄳𑄣𑄧𑄛𑄨 𑄓𑄨𑄌𑄴𑄇𑄴</annotation>
|
| 436 |
+
<annotation cp="💾" type="tts" draft="unconfirmed">𑄜𑄳𑄣𑄧𑄛𑄨 𑄓𑄨𑄌𑄴𑄇𑄴</annotation>
|
| 437 |
+
<annotation cp="💿" draft="unconfirmed">𑄃𑄧𑄛𑄴𑄑𑄨𑄇𑄳𑄠𑄣𑄴 𑄓𑄨𑄌𑄴𑄇𑄴</annotation>
|
| 438 |
+
<annotation cp="💿" type="tts" draft="unconfirmed">𑄃𑄧𑄛𑄴𑄑𑄨𑄇𑄳𑄠𑄣𑄴 𑄓𑄨𑄌𑄴𑄇𑄴</annotation>
|
| 439 |
+
<annotation cp="📀" draft="unconfirmed">𑄓𑄨𑄞𑄨𑄓𑄨</annotation>
|
| 440 |
+
<annotation cp="📀" type="tts" draft="unconfirmed">𑄓𑄨𑄞𑄨𑄓𑄨</annotation>
|
| 441 |
+
<annotation cp="🧮" draft="unconfirmed">𑄃𑄳𑄠𑄝𑄇𑄌𑄴</annotation>
|
| 442 |
+
<annotation cp="🧮" type="tts" draft="unconfirmed">𑄃𑄳𑄠𑄝𑄇𑄌𑄴</annotation>
|
| 443 |
+
<annotation cp="🎥" draft="unconfirmed">𑄟𑄪𑄞𑄨 𑄇𑄬𑄟𑄬𑄢</annotation>
|
| 444 |
+
<annotation cp="🎥" type="tts" draft="unconfirmed">𑄟𑄪𑄞𑄨 𑄇𑄬𑄟𑄬𑄢</annotation>
|
| 445 |
+
<annotation cp="🎞" draft="unconfirmed">𑄜𑄨𑄣𑄴𑄟𑄴 𑄜𑄳𑄢𑄬𑄟𑄴𑄌𑄴</annotation>
|
| 446 |
+
<annotation cp="🎞" type="tts" draft="unconfirmed">𑄜𑄨𑄣𑄴𑄟𑄴 𑄜𑄳𑄢𑄬𑄟𑄴𑄌𑄴</annotation>
|
| 447 |
+
<annotation cp="📽" draft="unconfirmed">𑄜𑄨𑄣𑄴𑄟𑄴 𑄛𑄳𑄢𑄧𑄎𑄬𑄇𑄴𑄑𑄧𑄢𑄴</annotation>
|
| 448 |
+
<annotation cp="📽" type="tts" draft="unconfirmed">𑄜𑄨𑄣𑄴𑄟𑄴 𑄛𑄳𑄢𑄧𑄎𑄬𑄇𑄴𑄑𑄧𑄢𑄴</annotation>
|
| 449 |
+
<annotation cp="🎬" draft="unconfirmed">𑄇𑄳𑄣𑄳𑄠𑄛𑄢𑄴 𑄝𑄮𑄢𑄳𑄓𑄴</annotation>
|
| 450 |
+
<annotation cp="🎬" type="tts" draft="unconfirmed">𑄇𑄳𑄣𑄳𑄠𑄛𑄢𑄴 𑄝𑄮𑄢𑄳𑄓𑄴</annotation>
|
| 451 |
+
<annotation cp="📺" draft="unconfirmed">𑄑𑄬𑄣𑄨𑄞𑄨𑄥𑄧𑄚𑄴</annotation>
|
| 452 |
+
<annotation cp="📺" type="tts" draft="unconfirmed">𑄑𑄬𑄣𑄨𑄞𑄨𑄥𑄧𑄚𑄴</annotation>
|
| 453 |
+
<annotation cp="📷" draft="unconfirmed">𑄇𑄬𑄟𑄬𑄢</annotation>
|
| 454 |
+
<annotation cp="📷" type="tts" draft="unconfirmed">𑄇𑄬𑄟𑄬𑄢</annotation>
|
| 455 |
+
<annotation cp="📸" draft="unconfirmed">𑄇𑄬𑄟𑄬𑄢 𑄣𑄧𑄉𑄬 𑄜𑄳𑄣𑄌𑄴</annotation>
|
| 456 |
+
<annotation cp="📸" type="tts" draft="unconfirmed">𑄇𑄬𑄟𑄬𑄢 𑄣𑄧𑄉𑄬 𑄜𑄳𑄣𑄌𑄴</annotation>
|
| 457 |
+
<annotation cp="📹" draft="unconfirmed">𑄞𑄨𑄓𑄨𑄠𑄮 𑄇𑄬𑄟𑄬𑄢</annotation>
|
| 458 |
+
<annotation cp="📹" type="tts" draft="unconfirmed">𑄞𑄨𑄓𑄨𑄠𑄮 𑄇𑄬𑄟𑄬𑄢</annotation>
|
| 459 |
+
<annotation cp="📼" draft="unconfirmed">𑄞𑄨𑄓𑄨𑄠𑄮𑄇𑄬𑄥𑄬𑄖𑄴</annotation>
|
| 460 |
+
<annotation cp="📼" type="tts" draft="unconfirmed">𑄞𑄨𑄓𑄨𑄠𑄮𑄇𑄬𑄥𑄬𑄖𑄴</annotation>
|
| 461 |
+
<annotation cp="🕯" draft="unconfirmed">𑄟𑄪𑄟𑄴𑄝𑄖𑄴𑄨</annotation>
|
| 462 |
+
<annotation cp="🕯" type="tts" draft="unconfirmed">𑄟𑄪𑄟𑄴𑄝𑄖𑄴𑄨</annotation>
|
| 463 |
+
<annotation cp="💡" draft="unconfirmed">𑄟𑄪𑄟𑄴𑄝𑄖𑄴𑄨 𑄝𑄣𑄳𑄛𑄴</annotation>
|
| 464 |
+
<annotation cp="💡" type="tts" draft="unconfirmed">𑄟𑄪𑄟𑄴𑄝𑄖𑄴���� 𑄝𑄣𑄳𑄛𑄴</annotation>
|
| 465 |
+
<annotation cp="🔦" draft="unconfirmed">𑄑𑄨𑄛𑄴𑄝𑄨𑄖𑄴𑄨</annotation>
|
| 466 |
+
<annotation cp="🔦" type="tts" draft="unconfirmed">𑄑𑄨𑄛𑄴𑄝𑄨𑄖𑄴𑄨</annotation>
|
| 467 |
+
<annotation cp="📧" draft="unconfirmed">𑄄-𑄟𑄬𑄭𑄣𑄴</annotation>
|
| 468 |
+
<annotation cp="📧" type="tts" draft="unconfirmed">𑄄-𑄟𑄬𑄭𑄣𑄴</annotation>
|
| 469 |
+
<annotation cp="🎌" draft="unconfirmed">𑄝𑄃𑄟𑄪𑄌𑄳𑄠𑄴 𑄝𑄝𑄧𑄘</annotation>
|
| 470 |
+
<annotation cp="🎌" type="tts" draft="unconfirmed">𑄝𑄃𑄟𑄪𑄌𑄳𑄠𑄴 𑄝𑄝𑄧𑄘</annotation>
|
| 471 |
+
<annotation cp="🏴" draft="unconfirmed">𑄇𑄣 𑄝𑄝𑄧𑄘</annotation>
|
| 472 |
+
<annotation cp="🏴" type="tts" draft="unconfirmed">𑄇𑄣 𑄝𑄝𑄧𑄘</annotation>
|
| 473 |
+
<annotation cp="🏳" draft="unconfirmed">𑄙𑄪𑄛𑄴 𑄝𑄝𑄧𑄘</annotation>
|
| 474 |
+
<annotation cp="🏳" type="tts" draft="unconfirmed">𑄙𑄪𑄛𑄴 𑄝𑄝𑄧𑄘</annotation>
|
| 475 |
+
<annotation cp="🏳🌈" draft="unconfirmed">𑄢𑄚𑄴𑄎𑄪𑄚𑄨 𑄝𑄝𑄧𑄘</annotation>
|
| 476 |
+
<annotation cp="🏳🌈" type="tts" draft="unconfirmed">𑄢𑄚𑄴𑄎𑄪𑄚𑄨 𑄝𑄝𑄧𑄘</annotation>
|
| 477 |
+
</annotations>
|
| 478 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ceb.xml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
|
| 8 |
+
the U.S. and other countries. CLDR data files are interpreted according to
|
| 9 |
+
the LDML specification (http://unicode.org/reports/tr35/)
|
| 10 |
+
-->
|
| 11 |
+
<ldml>
|
| 12 |
+
<identity>
|
| 13 |
+
<version number="$Revision$"/>
|
| 14 |
+
<language type="ceb"/>
|
| 15 |
+
</identity>
|
| 16 |
+
<annotations>
|
| 17 |
+
<annotation cp="🏳⚧">flag | flag sa transgender | hanap nga asul | pink | puti | transgender</annotation>
|
| 18 |
+
<annotation cp="🏳⚧" type="tts">flag sa transgender</annotation>
|
| 19 |
+
</annotations>
|
| 20 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/chr.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/ckb.xml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="ckb"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="🔫" draft="unconfirmed">دەمانچەی ئاوی</annotation>
|
| 15 |
+
<annotation cp="🔫" type="tts" draft="unconfirmed">دەمانچەی ئاوی</annotation>
|
| 16 |
+
</annotations>
|
| 17 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/cs.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/cv.xml
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="cv"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="🏻" draft="unconfirmed">сӑран ҫутӑ тӗсӗ | сӑран тонӗ | тип 1–2</annotation>
|
| 15 |
+
<annotation cp="🏻" type="tts" draft="unconfirmed">сӑран ҫутӑ тӗсӗ</annotation>
|
| 16 |
+
<annotation cp="🏼" draft="unconfirmed">сӑран тонӗ | тип 3 | ӳт-тирӗн вӑтам-ҫутӑ тӗсӗ</annotation>
|
| 17 |
+
<annotation cp="🏼" type="tts" draft="unconfirmed">ӳт-тирӗн вӑтам-ҫутӑ тӗсӗ</annotation>
|
| 18 |
+
<annotation cp="🏽" draft="unconfirmed">сӑран вӑтам тонӗ | сӑран тонӗ | тип 4</annotation>
|
| 19 |
+
<annotation cp="🏽" type="tts" draft="unconfirmed">сӑран вӑтам тонӗ</annotation>
|
| 20 |
+
<annotation cp="🏾" draft="unconfirmed">сӑран вӑтам тӗксӗм тонӗ | сӑран тонӗ | тип 5</annotation>
|
| 21 |
+
<annotation cp="🏾" type="tts" draft="unconfirmed">сӑран вӑтам тӗксӗм тонӗ</annotation>
|
| 22 |
+
<annotation cp="🏿" draft="unconfirmed">сӑран тӗксӗм тонӗ | сӑран тонӗ | тип 6</annotation>
|
| 23 |
+
<annotation cp="🏿" type="tts" draft="unconfirmed">сӑран тӗксӗм тонӗ</annotation>
|
| 24 |
+
<annotation cp="🦰" draft="unconfirmed">импир | хӗрлӗ ҫӳҫ | хӗрлӗрех ҫӳҫ</annotation>
|
| 25 |
+
<annotation cp="🦰" type="tts" draft="unconfirmed">хӗрлӗ ҫӳҫ</annotation>
|
| 26 |
+
<annotation cp="🦱" draft="unconfirmed">афро | кӑтра | кӑтра ҫӳҫ | ҫӳҫ пайӑркисем | явӑнчӑк ҫӳҫ</annotation>
|
| 27 |
+
<annotation cp="🦱" type="tts" draft="unconfirmed">явӑнчӑк ҫӳҫ</annotation>
|
| 28 |
+
<annotation cp="🦳" draft="unconfirmed">ватӑ | кӑвакарнӑ | ҫӳҫ | шурӑ</annotation>
|
| 29 |
+
<annotation cp="🦳" type="tts" draft="unconfirmed">шурӑ ҫӳҫ</annotation>
|
| 30 |
+
<annotation cp="🦲" draft="unconfirmed">кукша | кукша пуҫ | ҫӳҫсӗр | химиотерапи | хырӑннӑ</annotation>
|
| 31 |
+
<annotation cp="🦲" type="tts" draft="unconfirmed">кукша пуҫ</annotation>
|
| 32 |
+
<annotation cp="🎄" draft="unconfirmed">Раштав елки</annotation>
|
| 33 |
+
<annotation cp="🎄" type="tts" draft="unconfirmed">Раштав елки</annotation>
|
| 34 |
+
<annotation cp="👓" draft="unconfirmed">куҫлӑх</annotation>
|
| 35 |
+
<annotation cp="👓" type="tts" draft="unconfirmed">куҫлӑх</annotation>
|
| 36 |
+
<annotation cp="🕶" draft="unconfirmed">хӗвел хӳтӗлекен куҫлӑх</annotation>
|
| 37 |
+
<annotation cp="🕶" type="tts" draft="unconfirmed">хӗвел хӳтӗлекен куҫлӑх</annotation>
|
| 38 |
+
<annotation cp="🥽" draft="unconfirmed">симӗс куҫлӑх</annotation>
|
| 39 |
+
<annotation cp="🥽" type="tts" draft="unconfirmed">симӗс куҫлӑх</annotation>
|
| 40 |
+
<annotation cp="👖" draft="unconfirmed">джинссем</annotation>
|
| 41 |
+
<annotation cp="👖" type="tts" draft="unconfirmed">джинссем</annotation>
|
| 42 |
+
<annotation cp="🔋" draft="unconfirmed">аккумулятор</annotation>
|
| 43 |
+
<annotation cp="🔋" type="tts" draft="unconfirmed">аккумулятор</annotation>
|
| 44 |
+
<annotation cp="💻" draft="unconfirmed">ноутбук</annotation>
|
| 45 |
+
<annotation cp="💻" type="tts" draft="unconfirmed">ноутбук</annotation>
|
| 46 |
+
<annotation cp="🖨" draft="unconfirmed">принтер</annotation>
|
| 47 |
+
<annotation cp="🖨" type="tts" draft="unconfirmed">принтер</annotation>
|
| 48 |
+
<annotation cp="🖱" draft="unconfirmed">компьютер шӑшийӗ</annotation>
|
| 49 |
+
<annotation cp="🖱" type="tts" draft="unconfirmed">компьютер шӑшийӗ</annotation>
|
| 50 |
+
<annotation cp="🏁" draft="unconfirmed">ӑмӑрту | клеткӑллӑ ялав | тӑваткал-тӑваткал ялав</annotation>
|
| 51 |
+
<annotation cp="🏁" type="tts" draft="unconfirmed">клеткӑллӑ ялав</annotation>
|
| 52 |
+
<annotation cp="🚩" draft="unconfirmed">виҫкӗтеслӗ ялав | юпа | ялав виҫкӗтеслӗ</annotation>
|
| 53 |
+
<annotation cp="🚩" type="tts" draft="unconfirmed">виҫкӗтеслӗ ялав</annotation>
|
| 54 |
+
<annotation cp="🎌" draft="unconfirmed">уявлани | хӗрес | хӗреслӗ ялавсем | хӗресленнӗ ялавсем | япун</annotation>
|
| 55 |
+
<annotation cp="🎌" type="tts" draft="unconfirmed">хӗреслӗ ялавсем</annotation>
|
| 56 |
+
<annotation cp="🏴" draft="unconfirmed">вӗлкӗшет | хура ялав</annotation>
|
| 57 |
+
<annotation cp="🏴" type="tts" draft="unconfirmed">хура ялав</annotation>
|
| 58 |
+
<annotation cp="🏳" draft="unconfirmed">вӗлкӗшет | шурӑ ялав</annotation>
|
| 59 |
+
<annotation cp="🏳" type="tts" draft="unconfirmed">шурӑ ялав</annotation>
|
| 60 |
+
<annotation cp="🏳🌈" draft="unconfirmed">асамат кӗперӗ | асамат кӗперӗ ялавӗ | мӑнаҫлӑх</annotation>
|
| 61 |
+
<annotation cp="🏳🌈" type="tts" draft="unconfirmed">асамат кӗперӗ ялавӗ</annotation>
|
| 62 |
+
<annotation cp="🏳⚧" draft="unconfirmed">ҫутӑ-сенкер | трансгендер | трансгендер ялавӗ | шупка | шурӑ | ялав</annotation>
|
| 63 |
+
<annotation cp="🏳⚧" type="tts" draft="unconfirmed">трансгендер ялавӗ</annotation>
|
| 64 |
+
<annotation cp="🏴☠" draft="unconfirmed">мул | пират | пират ялавӗ | ҫарату | Хаваслӑ Роджер</annotation>
|
| 65 |
+
<annotation cp="🏴☠" type="tts" draft="unconfirmed">пират ялавӗ</annotation>
|
| 66 |
+
</annotations>
|
| 67 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/cy.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/da.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/de.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/de_CH.xml
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="de"/>
|
| 12 |
+
<territory type="CH"/>
|
| 13 |
+
</identity>
|
| 14 |
+
<annotations>
|
| 15 |
+
<annotation cp="‾" draft="contributed">Oberstrich | Überstrich</annotation>
|
| 16 |
+
<annotation cp="‽" draft="contributed">Fragerufzeichen | Interrobang</annotation>
|
| 17 |
+
<annotation cp="”">schliessendes doppeltes Anführungszeichen</annotation>
|
| 18 |
+
<annotation cp="”" type="tts">schliessendes doppeltes Anführungszeichen</annotation>
|
| 19 |
+
<annotation cp=")">Klammer | Parenthese | runde Klammer | schliessende Klammer | schliessende runde Klammer</annotation>
|
| 20 |
+
<annotation cp=")" type="tts">schliessende Klammer</annotation>
|
| 21 |
+
<annotation cp="]">eckige Klammer | eckige Klammer rechts | schliessende eckige Klammer</annotation>
|
| 22 |
+
<annotation cp="]" type="tts">schliessende eckige Klammer</annotation>
|
| 23 |
+
<annotation cp="}">geschweifte Klammer | geschweifte Klammer rechts | geschwungene Klammer | geschwungene Klammer rechts | schliessende geschweifte Klammer | schliessende geschwungene Klammer</annotation>
|
| 24 |
+
<annotation cp="}" type="tts">schliessende geschwungene Klammer</annotation>
|
| 25 |
+
<annotation cp="〉">Pfeilspitze rechts | schliessende spitze Klammer | schliessende Winkelklammer | spitze Klammer | spitze Klammer rechts | Winkelklammer</annotation>
|
| 26 |
+
<annotation cp="〉" type="tts">schliessende spitze Klammer</annotation>
|
| 27 |
+
<annotation cp="》">doppelte spitze Klammer | Klammer | schliessende doppelte spitze Klammer</annotation>
|
| 28 |
+
<annotation cp="》" type="tts">schliessende doppelte spitze Klammer</annotation>
|
| 29 |
+
<annotation cp="」">Eckklammer | Klammer | schliessende Eckklammer | schliessende rechtwinklige Klammer</annotation>
|
| 30 |
+
<annotation cp="」" type="tts">schliessende rechtwinklige Klammer</annotation>
|
| 31 |
+
<annotation cp="『">Klammer | öffnende weisse Eckklammer | weisse Eckklammer</annotation>
|
| 32 |
+
<annotation cp="『" type="tts">öffnende weisse Eckklammer</annotation>
|
| 33 |
+
<annotation cp="』">Klammer | schliessende rechtwinklige Klammer hohl | schliessende weisse Eckklammer | weisse Eckklammer</annotation>
|
| 34 |
+
<annotation cp="』" type="tts">schliessende rechtwinklige Klammer hohl</annotation>
|
| 35 |
+
<annotation cp="】">Klammer | konkave Klammer | schliessende schwarze konkave Klammer | schwarze konkave Klammer</annotation>
|
| 36 |
+
<annotation cp="】" type="tts">schliessende schwarze konkave Klammer</annotation>
|
| 37 |
+
<annotation cp="〕">rechte stumpfe Klammer | schliessende Klammer mit stumpfen Winkeln | schliessende stumpfe Klammer | stumpfe Klammer</annotation>
|
| 38 |
+
<annotation cp="〕" type="tts">schliessende Klammer mit stumpfen Winkeln</annotation>
|
| 39 |
+
<annotation cp="〗">hohle konkave Klammer | Klammer | konkave Klammer | schliessende hohle konkave Klammer | schliessende linsenförmige Klammer hohl</annotation>
|
| 40 |
+
<annotation cp="〗" type="tts">schliessende linsenförmige Klammer hohl</annotation>
|
| 41 |
+
<annotation cp="§" type="tts">Paragraph</annotation>
|
| 42 |
+
<annotation cp="@">Adresszeichen | Affenschaukel | Affenschwanz | At | At-Zeichen | Klammeraffe</annotation>
|
| 43 |
+
<annotation cp="⁂" draft="contributed">Asterism | Dreifachsternchen | Sterngruppe</annotation>
|
| 44 |
+
<annotation cp="⁂" type="tts">Dreifachsternchen</annotation>
|
| 45 |
+
<annotation cp="`">Accent grave | Akzent | Betonung | Gravis</annotation>
|
| 46 |
+
<annotation cp="`" type="tts">Accent grave</annotation>
|
| 47 |
+
<annotation cp="´">Accent aigu | Akut | Akzent | Betonung</annotation>
|
| 48 |
+
<annotation cp="´" type="tts">Accent aigu</annotation>
|
| 49 |
+
<annotation cp="↹">links | Ofeil | Pfeil nach links auf Strich zulaufend über Pfeil nach rechts auf Strich zulaufend | rechts | Strich | über Pfeil nach rechts auf Strich</annotation>
|
| 50 |
+
<annotation cp="↼" draft="contributed">Harpune | Harpune nach links mit Zacken nach oben | Harpune nach oben mit Zacken nach oben</annotation>
|
| 51 |
+
<annotation cp="↾" draft="contributed">Harpune | Harpune nach oben mit Zacken nach rechts</annotation>
|
| 52 |
+
<annotation cp="↿" draft="contributed">Harpune | Harpune nach oben mit Zacken nach links</annotation>
|
| 53 |
+
<annotation cp="⇀" draft="contributed">Harpune | Harpune nach oben mit Zacken nach oben | Harpune nach rechts mit Zacken nach oben</annotation>
|
| 54 |
+
<annotation cp="⇁" draft="contributed">Harpune | Harpune nach oben mit Zacken nach unten | Harpune nach rechts mit Zacken nach unten</annotation>
|
| 55 |
+
<annotation cp="⇂" draft="contributed">Harpune | Harpune nach oben mit Zacken nach oben | Harpune nach unten mit Zacken nach rechts</annotation>
|
| 56 |
+
<annotation cp="⇃" draft="contributed">Harpune | Harpune nach unten mit Zacken nach links</annotation>
|
| 57 |
+
<annotation cp="⇦">weisser Pfeil nach links</annotation>
|
| 58 |
+
<annotation cp="⇦" type="tts">weisser Pfeil nach links</annotation>
|
| 59 |
+
<annotation cp="⇧">weisser Pfeil nach oben</annotation>
|
| 60 |
+
<annotation cp="⇧" type="tts">weisser Pfeil nach oben</annotation>
|
| 61 |
+
<annotation cp="⇨">weisser Pfeil nach rechts</annotation>
|
| 62 |
+
<annotation cp="⇨" type="tts">weisser Pfeil nach rechts</annotation>
|
| 63 |
+
<annotation cp="⇩">weisser Pfeil nach unten</annotation>
|
| 64 |
+
<annotation cp="⇩" type="tts">weisser Pfeil nach unten</annotation>
|
| 65 |
+
<annotation cp="⇪">weisser Pfeil nach oben von Strich weglaufend</annotation>
|
| 66 |
+
<annotation cp="⇪" type="tts">weisser Pfeil nach oben von Strich weglaufend</annotation>
|
| 67 |
+
<annotation cp="∂" draft="contributed">Ableitung | partielle Ableitung</annotation>
|
| 68 |
+
<annotation cp="∎" draft="contributed">Beweis | Ende des Beweises | q.e.d. | qed</annotation>
|
| 69 |
+
<annotation cp="∑" draft="contributed">Mathematik | Summe | Summenzeichen</annotation>
|
| 70 |
+
<annotation cp="≮" draft="contributed">Mathematik | nicht kleiner als | nicht weniger als</annotation>
|
| 71 |
+
<annotation cp="=" type="tts">gleich</annotation>
|
| 72 |
+
<annotation cp=">">grösser als | Grösser-als-Zeichen</annotation>
|
| 73 |
+
<annotation cp=">" type="tts">grösser als</annotation>
|
| 74 |
+
<annotation cp="≯" draft="contributed">Mathematik | nicht grösser als</annotation>
|
| 75 |
+
<annotation cp="≯" type="tts">nicht grösser als</annotation>
|
| 76 |
+
<annotation cp="|">Längsstrich | Pipe | Pipe-Symbol | Pipe-Zeichen | senkrechter Strich | vertikaler Strich</annotation>
|
| 77 |
+
<annotation cp="|" type="tts">Längsstrich</annotation>
|
| 78 |
+
<annotation cp="∓" draft="contributed">minus oder plus | plusminus</annotation>
|
| 79 |
+
<annotation cp="∕" draft="contributed">Divisionsstrich | Längsstrich | Slash | Strich</annotation>
|
| 80 |
+
<annotation cp="⁄" draft="contributed">Bruchsstrich | Bruchstrich | Schrägstrich | Strich</annotation>
|
| 81 |
+
<annotation cp="∗" draft="contributed">Stern | Sternchen | Sternchen-Operator</annotation>
|
| 82 |
+
<annotation cp="∘" draft="contributed">Operator | Ring-Operator</annotation>
|
| 83 |
+
<annotation cp="∙" draft="contributed">Kreis-Operator | Operator</annotation>
|
| 84 |
+
<annotation cp="∝" draft="contributed">proportional | proportional zu | Proportionalität</annotation>
|
| 85 |
+
<annotation cp="∟" draft="contributed">Mathematik | rechter Winkel</annotation>
|
| 86 |
+
<annotation cp="∠" draft="contributed">Mathemaik | Winkel | Winkel-Zeichen</annotation>
|
| 87 |
+
<annotation cp="∣" draft="contributed">teilen | Teilt-Zeichen</annotation>
|
| 88 |
+
<annotation cp="∧" draft="contributed">ac | atque | logisches Und</annotation>
|
| 89 |
+
<annotation cp="∫" draft="contributed">Integral | Rechnen</annotation>
|
| 90 |
+
<annotation cp="∬" draft="contributed">Doppelintegral | Rechnen</annotation>
|
| 91 |
+
<annotation cp="∵" draft="contributed">logisch | Weil</annotation>
|
| 92 |
+
<annotation cp="∷" draft="contributed">Proportion | Proportionalität | Proportionszeichen</annotation>
|
| 93 |
+
<annotation cp="∼" draft="contributed">Operator | Tilde | Tilde-Operator</annotation>
|
| 94 |
+
<annotation cp="∽" draft="contributed">gespiegelte Tilde | Operator | Tilde</annotation>
|
| 95 |
+
<annotation cp="≃" draft="contributed">Asymptote | asymptotisch gleich | Mathematik</annotation>
|
| 96 |
+
<annotation cp="≅" draft="contributed">fast gleich | Mathematik | ungefähr gleich | ungefähr-gleich</annotation>
|
| 97 |
+
<annotation cp="≈">fast gleich wie | Näherung | ungefähr gleich | Ungefähr-Zeichen</annotation>
|
| 98 |
+
<annotation cp="≈" type="tts">fast gleich wie</annotation>
|
| 99 |
+
<annotation cp="≌" draft="contributed">alles gleich | Mathematik</annotation>
|
| 100 |
+
<annotation cp="≒">Bild von | ungefähr gleich | ungefähr gleich oder Bild von</annotation>
|
| 101 |
+
<annotation cp="≖" draft="contributed">gleich | Mathematik | Ring | Ring im Gleichheitszeichen</annotation>
|
| 102 |
+
<annotation cp="≣" draft="contributed">genau äquivalent | genau gleich | Mathematik</annotation>
|
| 103 |
+
<annotation cp="≥">gleich | grösser als | grösser als oder gleich | ist gleich | Vergleichszeichen</annotation>
|
| 104 |
+
<annotation cp="≥" type="tts">grösser als oder gleich</annotation>
|
| 105 |
+
<annotation cp="≦" draft="contributed">kleiner als über gleich | Mathematik | ungleich</annotation>
|
| 106 |
+
<annotation cp="≧" draft="contributed">grösser als über gleich | Mathematik | ungleich</annotation>
|
| 107 |
+
<annotation cp="≧" type="tts">grösser als über gleich</annotation>
|
| 108 |
+
<annotation cp="≪" draft="contributed">Mathematik | ungleich | viel kleiner als</annotation>
|
| 109 |
+
<annotation cp="≫" draft="contributed">Mathematik | ungleich | viel grösser als</annotation>
|
| 110 |
+
<annotation cp="≫" type="tts">viel grösser als</annotation>
|
| 111 |
+
<annotation cp="≳" draft="contributed">äquivalent | grösser als | grösser als oder äquivalent | Mathematik</annotation>
|
| 112 |
+
<annotation cp="≳" type="tts">grösser als oder äquivalent</annotation>
|
| 113 |
+
<annotation cp="≺" draft="contributed">Mathematik | vorangehend</annotation>
|
| 114 |
+
<annotation cp="≻" draft="contributed">Mathematik | nachfolgend</annotation>
|
| 115 |
+
<annotation cp="⊁" draft="contributed">Mathematik | nicht nachfolgend</annotation>
|
| 116 |
+
<annotation cp="⊃" draft="contributed">Mathematik | Obermenge von</annotation>
|
| 117 |
+
<annotation cp="⊆" draft="contributed">Mathematik | Teilmenge von oder gleich mit</annotation>
|
| 118 |
+
<annotation cp="⊇" draft="contributed">Mathematik | Obermenge von oder gleich mit</annotation>
|
| 119 |
+
<annotation cp="⊕" draft="contributed">eingekreistes Pluszeichen | Plus</annotation>
|
| 120 |
+
<annotation cp="⊖" draft="contributed">eingekreistes Minuszeichen | Minus</annotation>
|
| 121 |
+
<annotation cp="⊗" draft="contributed">eingekreistes Multiplikationszeichen | Mal</annotation>
|
| 122 |
+
<annotation cp="⊘" draft="contributed">Durch | eingekreister Divisionsstrich</annotation>
|
| 123 |
+
<annotation cp="⊙" draft="contributed">eingekreister Punkt-Operator | Operator | XNOR</annotation>
|
| 124 |
+
<annotation cp="⊛" draft="contributed">eingekreister Stern-Operator | Kreis | Operator | Stern</annotation>
|
| 125 |
+
<annotation cp="⊞" draft="contributed">eingerahmtes Pluszeichen | Mathematik</annotation>
|
| 126 |
+
<annotation cp="⊟" draft="contributed">eingerahmtes Minuszeichen | Minus</annotation>
|
| 127 |
+
<annotation cp="⊥" draft="contributed">senkrecht nach oben | teilerfremd | widersprüchlich</annotation>
|
| 128 |
+
<annotation cp="⊰" draft="contributed">Mathematik | vorangehend in Relation</annotation>
|
| 129 |
+
<annotation cp="⊱" draft="contributed">Mathematik | nachfolgend in Relation</annotation>
|
| 130 |
+
<annotation cp="⋭" draft="contributed">enthält nicht als normale Untergruppe oder gleich | Mathematik</annotation>
|
| 131 |
+
<annotation cp="⊹" draft="contributed">hermitesche konjugierte Matrix | Mathematik | Matrix</annotation>
|
| 132 |
+
<annotation cp="⊿" draft="contributed">Dreieck | rechtes Dreieck | rechtwinklig</annotation>
|
| 133 |
+
<annotation cp="⋁" draft="contributed">Mathematik | n-stufig | N-stufiges logisches Oder | Oder</annotation>
|
| 134 |
+
<annotation cp="⋂" draft="contributed">n-stufig | N-stufige Schnittmenge | Schnittmenge</annotation>
|
| 135 |
+
<annotation cp="⋃" draft="contributed">n-stufig | N-stufige Vereinigungsmenge | Vereinungsmenge</annotation>
|
| 136 |
+
<annotation cp="⋅" draft="contributed">Operator | Punkt-Operator</annotation>
|
| 137 |
+
<annotation cp="⋆" draft="contributed">Operator | Stern-Operator</annotation>
|
| 138 |
+
<annotation cp="⋈" draft="contributed">binärer Operator | natürliche Verknüpfung | Schleife | Verknüpfung</annotation>
|
| 139 |
+
<annotation cp="⋒" draft="contributed">doppelte Schnittmenge | Mathematik | Schnittmenge | überschneidet</annotation>
|
| 140 |
+
<annotation cp="⋘" draft="contributed">kleiner | sehr viel kleiner als | ungleich</annotation>
|
| 141 |
+
<annotation cp="⋙" draft="contributed">grösser | sehr viel grösser als | ungleich</annotation>
|
| 142 |
+
<annotation cp="⋙" type="tts">sehr viel grösser als</annotation>
|
| 143 |
+
<annotation cp="⋮" draft="contributed">Ellipse | Mathematik | vertikale Ellipse</annotation>
|
| 144 |
+
<annotation cp="⋯" draft="contributed">Ellipse | horizontal | horizontale Ellipse auf mittlerer Höhe</annotation>
|
| 145 |
+
<annotation cp="⋰" draft="contributed">Ellipse | Mathematik | rechts-aufwärts steigende diagonale Ellipse</annotation>
|
| 146 |
+
<annotation cp="⋱" draft="contributed">diagonal | Ellipse | rechts-abwärts fallende diagonale Ellipse</annotation>
|
| 147 |
+
<annotation cp="□">weisses Quadrat</annotation>
|
| 148 |
+
<annotation cp="□" type="tts">weisses Quadrat</annotation>
|
| 149 |
+
<annotation cp="▢">weisses Quadrat mit abgerundeten Ecken</annotation>
|
| 150 |
+
<annotation cp="▢" type="tts">weisses Quadrat mit abgerundeten Ecken</annotation>
|
| 151 |
+
<annotation cp="▣">weisses Quadrat mit kleinem schwarzem Quadrat</annotation>
|
| 152 |
+
<annotation cp="▣" type="tts">weisses Quadrat mit kleinem schwarzem Quadrat</annotation>
|
| 153 |
+
<annotation cp="▩">Quadrat | Quadrat mit diagonaler Kreuzschraffur | schraffiert | Schraffur</annotation>
|
| 154 |
+
<annotation cp="▬">dicker Strich | schwarzes Rechteck</annotation>
|
| 155 |
+
<annotation cp="▭">weisses Rechteck</annotation>
|
| 156 |
+
<annotation cp="▭" type="tts">weisses Rechteck</annotation>
|
| 157 |
+
<annotation cp="△">weisses nach oben weisendes Dreieck</annotation>
|
| 158 |
+
<annotation cp="△" type="tts">weisses nach oben weisendes Dreieck</annotation>
|
| 159 |
+
<annotation cp="▵">weisses nach oben weisendes kleines Dreieck</annotation>
|
| 160 |
+
<annotation cp="▵" type="tts">weisses nach oben weisendes kleines Dreieck</annotation>
|
| 161 |
+
<annotation cp="▷">weisses nach rechts weisendes Dreieck</annotation>
|
| 162 |
+
<annotation cp="▷" type="tts">weisses nach rechts weisendes Dreieck</annotation>
|
| 163 |
+
<annotation cp="▹">weisses nach rechts weisendes kleines Dreieck</annotation>
|
| 164 |
+
<annotation cp="▹" type="tts">weisses nach rechts weisendes kleines Dreieck</annotation>
|
| 165 |
+
<annotation cp="▻">weisser nach rechts weisender Zeiger</annotation>
|
| 166 |
+
<annotation cp="▻" type="tts">weisser nach rechts weisender Zeiger</annotation>
|
| 167 |
+
<annotation cp="▽">weisses nach unten weisendes Dreieck</annotation>
|
| 168 |
+
<annotation cp="▽" type="tts">weisses nach unten weisendes Dreieck</annotation>
|
| 169 |
+
<annotation cp="▿">weisses nach unten weisendes kleines Dreieck</annotation>
|
| 170 |
+
<annotation cp="▿" type="tts">weisses nach unten weisendes kleines Dreieck</annotation>
|
| 171 |
+
<annotation cp="◁">weisses nach links weisendes Dreieck</annotation>
|
| 172 |
+
<annotation cp="◁" type="tts">weisses nach links weisendes Dreieck</annotation>
|
| 173 |
+
<annotation cp="◃">weisses nach links weisendes kleines Dreieck</annotation>
|
| 174 |
+
<annotation cp="◃" type="tts">weisses nach links weisendes kleines Dreieck</annotation>
|
| 175 |
+
<annotation cp="◅">weisser nach links weisender Zeiger</annotation>
|
| 176 |
+
<annotation cp="◅" type="tts">weisser nach links weisender Zeiger</annotation>
|
| 177 |
+
<annotation cp="◇">weisses Karo</annotation>
|
| 178 |
+
<annotation cp="◇" type="tts">weisses Karo</annotation>
|
| 179 |
+
<annotation cp="◈">weisses Karo mit kleinem schwarzem Karo</annotation>
|
| 180 |
+
<annotation cp="◈" type="tts">weisses Karo mit kleinem schwarzem Karo</annotation>
|
| 181 |
+
<annotation cp="◉" draft="contributed">Bullauge | kleiner schwarzer Kreis | konzentrische Kreise | Kreis | weisser Kreis mit kleinem schwarzem Kreis</annotation>
|
| 182 |
+
<annotation cp="◉" type="tts">weisser Kreis mit kleinem schwarzem Kreis</annotation>
|
| 183 |
+
<annotation cp="◎" draft="contributed">doppelter Kreis | konzentrische Kreise | Ziel</annotation>
|
| 184 |
+
<annotation cp="◕">schwarzer Kreis mit weissem Viertel oben links</annotation>
|
| 185 |
+
<annotation cp="◕" type="tts">schwarzer Kreis mit weissem Viertel oben links</annotation>
|
| 186 |
+
<annotation cp="◙" draft="contributed">schwarzes Quadrat mit weissem Kreis</annotation>
|
| 187 |
+
<annotation cp="◙" type="tts">schwarzes Quadrat mit weissem Kreis</annotation>
|
| 188 |
+
<annotation cp="◦">weisses Aufzählungszeichen</annotation>
|
| 189 |
+
<annotation cp="◦" type="tts">weisses Aufzählungszeichen</annotation>
|
| 190 |
+
<annotation cp="◯">grosser hohler Kreis | Kreis | Ring</annotation>
|
| 191 |
+
<annotation cp="◯" type="tts">grosser hohler Kreis</annotation>
|
| 192 |
+
<annotation cp="◳">weisses Quadrat mit Viertel oben rechts</annotation>
|
| 193 |
+
<annotation cp="◳" type="tts">weisses Quadrat mit Viertel oben rechts</annotation>
|
| 194 |
+
<annotation cp="◷">weisser Kreis mit Viertel oben rechts</annotation>
|
| 195 |
+
<annotation cp="◷" type="tts">weisser Kreis mit Viertel oben rechts</annotation>
|
| 196 |
+
<annotation cp="◿">weisses Dreieck unten rechts</annotation>
|
| 197 |
+
<annotation cp="◿" type="tts">weisses Dreieck unten rechts</annotation>
|
| 198 |
+
<annotation cp="♪">Achtel | Achtelsnote | Musik | Note</annotation>
|
| 199 |
+
<annotation cp="♪" type="tts">Achtelsnote</annotation>
|
| 200 |
+
<annotation cp="⪚">gleich über grösser als</annotation>
|
| 201 |
+
<annotation cp="⪚" type="tts">gleich über grösser als</annotation>
|
| 202 |
+
<annotation cp="😃">Gesicht | grinsendes Gesicht mit grossen Augen | lol | lustig</annotation>
|
| 203 |
+
<annotation cp="😃" type="tts">grinsendes Gesicht mit grossen Augen</annotation>
|
| 204 |
+
<annotation cp="😅">Gesicht | Lachender Smiley mit kaltem Schweiss | lustig | Schweiss | schwitzen</annotation>
|
| 205 |
+
<annotation cp="😅" type="tts">Lachender Smiley mit kaltem Schweiss</annotation>
|
| 206 |
+
<annotation cp="🫠">auflösen | schmelzen | schmelzendes Gesicht | verflüssigen | verschwinden</annotation>
|
| 207 |
+
<annotation cp="🤪">Auge | gross | irres Gesicht | klein</annotation>
|
| 208 |
+
<annotation cp="🫡">Aye aye | Gesicht | grüssendes Gesicht | jawohl | ok | salutieren | Truppen</annotation>
|
| 209 |
+
<annotation cp="🫡" type="tts">grüssendes Gesicht</annotation>
|
| 210 |
+
<annotation cp="🤐">Gesicht | Mund | Reissverschluss | Smiley mit Reissverschlussmund</annotation>
|
| 211 |
+
<annotation cp="🤐" type="tts">Smiley mit Reissverschlussmund</annotation>
|
| 212 |
+
<annotation cp="😶🌫">abwesend | benebelt | geistig umnachtet | Kopf in den Wolken</annotation>
|
| 213 |
+
<annotation cp="😶🌫" type="tts">Kopf in den Wolken</annotation>
|
| 214 |
+
<annotation cp="😮💨">ausatmen | ausatmendes Gesicht | besorgt | flüstern | Huch! | pfeifen | Puh! | seufzen | stöhnen</annotation>
|
| 215 |
+
<annotation cp="😮💨" type="tts">ausatmendes Gesicht</annotation>
|
| 216 |
+
<annotation cp="🥵">erhitzt | Fieber | heiss | Hitzschlag | schwitzen | schwitzendes Gesicht</annotation>
|
| 217 |
+
<annotation cp="😵💫">Gesicht mit Spiralaugen | Hypnose | hypnotisiert | schwindelig | Spirale | verwirrt</annotation>
|
| 218 |
+
<annotation cp="😵💫" type="tts">Gesicht mit Spiralaugen</annotation>
|
| 219 |
+
<annotation cp="🥸">Brille | Gesicht | Gesicht mit Maske | incognito | Maske | Nase</annotation>
|
| 220 |
+
<annotation cp="🥸" type="tts">Gesicht mit Maske</annotation>
|
| 221 |
+
<annotation cp="😳">Erröteter Smiley mit grossen Augen | Gesicht | rote Wangen | überrascht</annotation>
|
| 222 |
+
<annotation cp="😳" type="tts">Erröteter Smiley mit grossen Augen</annotation>
|
| 223 |
+
<annotation cp="😰">Gesicht | kalter Schweiss | offener Mund | Smiley mit offenem Mund und kaltem Schweiss</annotation>
|
| 224 |
+
<annotation cp="😰" type="tts">Smiley mit offenem Mund und kaltem Schweiss</annotation>
|
| 225 |
+
<annotation cp="😥">enttäuscht | erleichtert | Gesicht | Schweiss | trauriges aber erleichtertes Gesicht</annotation>
|
| 226 |
+
<annotation cp="😓">geschlossene Augen | Gesicht | Smiley mit kaltem Schweiss</annotation>
|
| 227 |
+
<annotation cp="😓" type="tts">Smiley mit kaltem Schweiss</annotation>
|
| 228 |
+
<annotation cp="👽">Alien | Ausserirdischer | Ausserirdisches Wesen | Gesicht | UFO</annotation>
|
| 229 |
+
<annotation cp="👽" type="tts">Ausserirdisches Wesen</annotation>
|
| 230 |
+
<annotation cp="❤����">brennen | brennendes Herz | Feuer | Herz in Flammen | Liebe</annotation>
|
| 231 |
+
<annotation cp="❤🔥" type="tts">brennendes Herz</annotation>
|
| 232 |
+
<annotation cp="❤🩹">Besserung | erholen | gesund | gute Besserung | heilen | Herz mit Pflaster | Pflaster</annotation>
|
| 233 |
+
<annotation cp="❤🩹" type="tts">Herz mit Pflaster</annotation>
|
| 234 |
+
<annotation cp="🩷">flirten | Herz | pink | pinkes Herz | süss | verliebt</annotation>
|
| 235 |
+
<annotation cp="🤍">Herz | weiss | weisses Herz</annotation>
|
| 236 |
+
<annotation cp="🤍" type="tts">weisses Herz</annotation>
|
| 237 |
+
<annotation cp="💥">Comic | Kollision | Zusammenstoss</annotation>
|
| 238 |
+
<annotation cp="💥" type="tts">Zusammenstoss</annotation>
|
| 239 |
+
<annotation cp="💦">Comic | Schweiss | Schweisstropfen</annotation>
|
| 240 |
+
<annotation cp="💦" type="tts">Schweisstropfen</annotation>
|
| 241 |
+
<annotation cp="🖖">Finger | Hand | Spock | Vulkanier(in) | vulkanisch | Vulkanischer Gruss</annotation>
|
| 242 |
+
<annotation cp="🖖" type="tts">Vulkanischer Gruss</annotation>
|
| 243 |
+
<annotation cp="🫷">drücken | High Five | nach links | nach links drückende Hand | nein | Stopp | warten</annotation>
|
| 244 |
+
<annotation cp="🫷" type="tts">nach links drückende Hand</annotation>
|
| 245 |
+
<annotation cp="🫸">drücken | High Five | nach rechts | nach rechts drückende Hand | nein | Stopp | warten</annotation>
|
| 246 |
+
<annotation cp="🫸" type="tts">nach rechts drückende Hand</annotation>
|
| 247 |
+
<annotation cp="🤘">Finger | Hand | Hörner | Rock | Teufel | Teufelsgruss</annotation>
|
| 248 |
+
<annotation cp="🤘" type="tts">Teufelsgruss</annotation>
|
| 249 |
+
<annotation cp="🙏">beten | betende Hände | bitten | danken | Gebet | grüssen | zusammengelegte Handflächen</annotation>
|
| 250 |
+
<annotation cp="🦶">Fuss | Kick | stampfen</annotation>
|
| 251 |
+
<annotation cp="🦶" type="tts">Fuss</annotation>
|
| 252 |
+
<annotation cp="🫦">Angst | ängstlich | Auf Lippe beissen | besorgt | flirtend | nervös | unbehaglich</annotation>
|
| 253 |
+
<annotation cp="🫦" type="tts">Auf Lippe beissen</annotation>
|
| 254 |
+
<annotation cp="🧑⚕">Arzt | Arzt/Ärztin | Gesundheitswesen | Krankenpfleger | Krankenpflegerin | Therapeut</annotation>
|
| 255 |
+
<annotation cp="🧑🔧">Mechaniker(in)</annotation>
|
| 256 |
+
<annotation cp="👨🏭">Arbeiter | Fabrik | Fabrikarbeiter | industriell | Montage</annotation>
|
| 257 |
+
<annotation cp="👩🏭">Arbeiter | Fabrik | Fabrikarbeiterin | industriell | Montage</annotation>
|
| 258 |
+
<annotation cp="🧑💼">Architekt | Büroangestellte(r) | Business | Manager</annotation>
|
| 259 |
+
<annotation cp="🧑🔬">Wissenschaftler(in)</annotation>
|
| 260 |
+
<annotation cp="🎅">Samichlaus | Weihnachten | Weihnachtsmann</annotation>
|
| 261 |
+
<annotation cp="🧟♂">Zombiemann</annotation>
|
| 262 |
+
<annotation cp="🧟♂" type="tts">Zombiemann</annotation>
|
| 263 |
+
<annotation cp="💇">Coiffeur | Friseur | Frisur | Person beim Haareschneiden</annotation>
|
| 264 |
+
<annotation cp="💇♂">Coiffeur | Friseur | Haarschnitt | Mann | Mann beim Haareschneiden | Schere</annotation>
|
| 265 |
+
<annotation cp="💇♀">Coiffeur | Frau | Frau beim Haareschneiden | Friseur | Haarschnitt | Schere</annotation>
|
| 266 |
+
<annotation cp="🚶">Fussgänger(in) | gehen | gehend | wandern</annotation>
|
| 267 |
+
<annotation cp="🚶" type="tts">Fussgänger(in)</annotation>
|
| 268 |
+
<annotation cp="🚶♂">Fussgänger | gehen | Mann | Spaziergang</annotation>
|
| 269 |
+
<annotation cp="🚶♂" type="tts">Fussgänger</annotation>
|
| 270 |
+
<annotation cp="🚶♀">Frau | Fussgängerin | gehen | Spaziergang</annotation>
|
| 271 |
+
<annotation cp="🚶♀" type="tts">Fussgängerin</annotation>
|
| 272 |
+
<annotation cp="🧑🦯">Barrierefreiheit | blind | Person mit Langstock</annotation>
|
| 273 |
+
<annotation cp="👨🦯">Mann mit Gehstock | Mann mit Langstock</annotation>
|
| 274 |
+
<annotation cp="🧗♂">bergsteigen | Bergsteiger | Kletterer | klettern</annotation>
|
| 275 |
+
<annotation cp="🧗♀">bergsteigen | Bergsteigerin | Kletterin | klettern</annotation>
|
| 276 |
+
<annotation cp="👣">Abdruck | Fussabdruck | Fussabdrücke</annotation>
|
| 277 |
+
<annotation cp="👣" type="tts">Fussabdrücke</annotation>
|
| 278 |
+
<annotation cp="🦳">weisses Haar</annotation>
|
| 279 |
+
<annotation cp="🦳" type="tts">weisses Haar</annotation>
|
| 280 |
+
<annotation cp="🫏">Dummkopf | Esel | Grautier | Maultier | Säugetier | störrisch | stur | Tier</annotation>
|
| 281 |
+
<annotation cp="🦣">Aussterben | gross | Mammut | Stosszahn | wollig</annotation>
|
| 282 |
+
<annotation cp="🐻❄">Arktis | Eisbär | Nordpol | weiss</annotation>
|
| 283 |
+
<annotation cp="🦤">Aussterben | Dodo | gross | Mauritius</annotation>
|
| 284 |
+
<annotation cp="🪽">Engel | Federn | fliegen | Flügel | Mythologie | Vogel</annotation>
|
| 285 |
+
<annotation cp="🪿">dumm | Gans | schnattern | Vogel</annotation>
|
| 286 |
+
<annotation cp="🐦🔥">Asche | Donnervogel | Fantasy | Feuer | Feuervogel | Phönix | Vogel | Wiedergeburt</annotation>
|
| 287 |
+
<annotation cp="💐">Blumen | Blumenstrauss | Bouquet</annotation>
|
| 288 |
+
<annotation cp="💐" type="tts">Blumenstrauss</annotation>
|
| 289 |
+
<annotation cp="🪻">Blume | Hyazinthe | Lavendel | Löwenmaul | Lupine</annotation>
|
| 290 |
+
<annotation cp="🍋🟩">Frucht | Limette | sauer | tropisch | Zitrusfrucht</annotation>
|
| 291 |
+
<annotation cp="🌶" type="tts">Chili</annotation>
|
| 292 |
+
<annotation cp="🫑">Gemüse | Paprika | Peperoni</annotation>
|
| 293 |
+
<annotation cp="🫑" type="tts">Peperoni</annotation>
|
| 294 |
+
<annotation cp="🫚">Ginger Beer | Ingwer | Ingwerwurzel | scharf</annotation>
|
| 295 |
+
<annotation cp="🫚" type="tts">Ingwerwurzel</annotation>
|
| 296 |
+
<annotation cp="🫛">Bohne | Edamame | Erbse | Gemüse | Hülsenfrüchte</annotation>
|
| 297 |
+
<annotation cp="🫛" type="tts">Erbse</annotation>
|
| 298 |
+
<annotation cp="🍄🟫">braun | brauner Pilz | Gemüse | Natur | Pilz | Wald</annotation>
|
| 299 |
+
<annotation cp="🍗">Geflügel | Poulet | Pouletschenkel</annotation>
|
| 300 |
+
<annotation cp="🍗" type="tts">Pouletschenkel</annotation>
|
| 301 |
+
<annotation cp="🍝">Nudeln mit Tomatensauce | Pasta | Spaghetti</annotation>
|
| 302 |
+
<annotation cp="🍠">geröstet | Geröstete Süsskartoffel | Süsskartoffel</annotation>
|
| 303 |
+
<annotation cp="🍠" type="tts">Geröstete Süsskartoffel</annotation>
|
| 304 |
+
<annotation cp="🍡">Dango | japanisches Gericht | Mochi-Kugeln auf einem Spiess | Restaurant</annotation>
|
| 305 |
+
<annotation cp="🧁">Cupcake | Gebäck | Konditorei | Muffin | süss</annotation>
|
| 306 |
+
<annotation cp="🍬">Bonbon | Süssigkeit</annotation>
|
| 307 |
+
<annotation cp="🍭">Lolli | Lutscher | Süssigkeit</annotation>
|
| 308 |
+
<annotation cp="🍮">Dessert | Nachspeise | Nachtisch | Pudding | Sauce | Schokolade</annotation>
|
| 309 |
+
<annotation cp="☕">dampfend | Getränk | heiss | Heissgetränk | Kaffee | Tee | trinken</annotation>
|
| 310 |
+
<annotation cp="☕" type="tts">Heissgetränk</annotation>
|
| 311 |
+
<annotation cp="🫖">Kanne | Tee | Teekanne | Teekrug | trinken</annotation>
|
| 312 |
+
<annotation cp="🫖" type="tts">Teekrug</annotation>
|
| 313 |
+
<annotation cp="🍻">anstossen | Bier | Bierkrüge</annotation>
|
| 314 |
+
<annotation cp="🥂">anstossen | Champagner | feiern | Getränk | Sekt | Sektgläser</annotation>
|
| 315 |
+
<annotation cp="🫗">ausgiessen | Flüssigkeit ausgiessen | Getränk | giessen | Glas | leer | trinken</annotation>
|
| 316 |
+
<annotation cp="🫗" type="tts">Flüssigkeit ausgiessen</annotation>
|
| 317 |
+
<annotation cp="🏺">Amphore | Gefäss | kochen | Krug | Vase | Wassermann</annotation>
|
| 318 |
+
<annotation cp="♨">Dampf | dampfend | heiss | Heisse Quellen | Quellen</annotation>
|
| 319 |
+
<annotation cp="♨" type="tts">Heisse Quellen</annotation>
|
| 320 |
+
<annotation cp="🚃">Eisenbahnwagen | Fahrzeug | Strassenbahn | Strassenbahnwagen | Tram | Wagen | Wagon | Zug</annotation>
|
| 321 |
+
<annotation cp="🚊">Strassenbahn | Tram</annotation>
|
| 322 |
+
<annotation cp="🚊" type="tts">Strassenbahn</annotation>
|
| 323 |
+
<annotation cp="🚋">Strassenbahn | Strassenbahnwagen | Tram | Tramwagen</annotation>
|
| 324 |
+
<annotation cp="🚋" type="tts">Tramwagen</annotation>
|
| 325 |
+
<annotation cp="🛣">Autobahn | Schnellstrasse</annotation>
|
| 326 |
+
<annotation cp="⭐">Stern | weisser mittelgrosser Stern</annotation>
|
| 327 |
+
<annotation cp="⭐" type="tts">weisser mittelgrosser Stern</annotation>
|
| 328 |
+
<annotation cp="🌌">Galaxie | Milchstrasse</annotation>
|
| 329 |
+
<annotation cp="🌌" type="tts">Milchstrasse</annotation>
|
| 330 |
+
<annotation cp="🌥">grosse Wolke | Sonne | Sonne hinter grosser Wolke | Wetter | Wolke</annotation>
|
| 331 |
+
<annotation cp="🌥" type="tts">Sonne hinter grosser Wolke</annotation>
|
| 332 |
+
<annotation cp="🔥">Feuer | Flamme | heiss</annotation>
|
| 333 |
+
<annotation cp="💧">Schweiss | Tropfen | Wasser | Wassertropfen</annotation>
|
| 334 |
+
<annotation cp="⚽">Ball | Fussball</annotation>
|
| 335 |
+
<annotation cp="⚽" type="tts">Fussball</annotation>
|
| 336 |
+
<annotation cp="🥌">Curlingstein</annotation>
|
| 337 |
+
<annotation cp="🥽">Augenschutz | Schutzbrille | Schweissen | Schwimmen</annotation>
|
| 338 |
+
<annotation cp="🪭">Fächer | fächern | Faltfächer | Flamenco | heiss | kühl | scheu | tanzen</annotation>
|
| 339 |
+
<annotation cp="🪭" type="tts" draft="contributed">Fächer</annotation>
|
| 340 |
+
<annotation cp="🎒">Ranzen | Rucksack | Schule | Schulranzen | Schulsack | Tornister</annotation>
|
| 341 |
+
<annotation cp="🎒" type="tts">Schulsack</annotation>
|
| 342 |
+
<annotation cp="🩴">Flipflops | Zehensandale | Zehensandalen</annotation>
|
| 343 |
+
<annotation cp="🩴" type="tts">Flipflops</annotation>
|
| 344 |
+
<annotation cp="🪮">Afro Pick | Kamm | kämmen</annotation>
|
| 345 |
+
<annotation cp="🪮" type="tts" draft="contributed">Afro Pick</annotation>
|
| 346 |
+
<annotation cp="⛑">Helm | Helm mit weissem Kreuz | Hilfe | Kreuz</annotation>
|
| 347 |
+
<annotation cp="⛑" type="tts">Helm mit weissem Kreuz</annotation>
|
| 348 |
+
<annotation cp="🪇">Instrument | Maraca | Musik | schütteln | Trommel</annotation>
|
| 349 |
+
<annotation cp="🪇" type="tts">Maraca</annotation>
|
| 350 |
+
<annotation cp="🪈">Blockflöte | Flöte | Holzblasinstrument | Musik | Pfeife</annotation>
|
| 351 |
+
<annotation cp="🪫">Akku leer | Batterie leer | schwache Batterie</annotation>
|
| 352 |
+
<annotation cp="🔍">Lupe nach links | Suche | Vergrösserungsglas</annotation>
|
| 353 |
+
<annotation cp="🔎">Lupe nach rechts | Suche | Vergrösserungsglas</annotation>
|
| 354 |
+
<annotation cp="📆">Abreisskalender | Kalender</annotation>
|
| 355 |
+
<annotation cp="📆" type="tts">Abreisskalender</annotation>
|
| 356 |
+
<annotation cp="📌">anpinnen | Reisszwecke</annotation>
|
| 357 |
+
<annotation cp="📌" type="tts">Reisszwecke</annotation>
|
| 358 |
+
<annotation cp="📍">anpinnen | Reisszwecke | rund | runde Reisszwecke</annotation>
|
| 359 |
+
<annotation cp="📍" type="tts">runde Reisszwecke</annotation>
|
| 360 |
+
<annotation cp="✂">basteln | Schere | schneiden</annotation>
|
| 361 |
+
<annotation cp="⛓💥">befreien | Freiheit | kaputt | kaputte Kette | Kette | losreissen | reissen</annotation>
|
| 362 |
+
<annotation cp="⛓💥" type="tts">kaputte Kette</annotation>
|
| 363 |
+
<annotation cp="🩻">Arzt | Bildgebung | Knochen | Röntgen</annotation>
|
| 364 |
+
<annotation cp="🩻" type="tts">Röntgen</annotation>
|
| 365 |
+
<annotation cp="🛗" type="tts">Lift</annotation>
|
| 366 |
+
<annotation cp="🪠">Klempner | Pümpel | Sanitär | Saugglocke | WC</annotation>
|
| 367 |
+
<annotation cp="🫧">sauber | Schaum | Seife | Seifenblasen</annotation>
|
| 368 |
+
<annotation cp="🫧" type="tts">Seifenblasen</annotation>
|
| 369 |
+
<annotation cp="🪪">Ausweis | Fahrausweis | ID</annotation>
|
| 370 |
+
<annotation cp="🪪" type="tts">ID</annotation>
|
| 371 |
+
<annotation cp="🚼">Baby-Symbol | Symbol „Baby“ | Wickelraum</annotation>
|
| 372 |
+
<annotation cp="🛅">Gepäck | Gepäckaufbewahrung | Schliessfach</annotation>
|
| 373 |
+
<annotation cp="🚸">Kinder | Kinder-queren-die-Strasse-Schild | Vorsicht</annotation>
|
| 374 |
+
<annotation cp="🚸" type="tts">Kinder-queren-die-Strasse-Schild</annotation>
|
| 375 |
+
<annotation cp="🚷">Fussgänger-verboten-Schild | verboten</annotation>
|
| 376 |
+
<annotation cp="🚷" type="tts">Fussgänger-verboten-Schild</annotation>
|
| 377 |
+
<annotation cp="☢">radioaktiv | Radioaktivität</annotation>
|
| 378 |
+
<annotation cp="☢" type="tts">radioaktiv</annotation>
|
| 379 |
+
<annotation cp="🪯">Khanda | Khanda-Emblem | Religion | Schwert | Sikhismus</annotation>
|
| 380 |
+
<annotation cp="🪯" type="tts">Khanda-Emblem</annotation>
|
| 381 |
+
<annotation cp="🛜">Computer | drahtlos | Internet | kabellos | Netzwerk | WIFI | WLAN</annotation>
|
| 382 |
+
<annotation cp="🛜" type="tts">drahtlos</annotation>
|
| 383 |
+
<annotation cp="➕" type="tts">Plus</annotation>
|
| 384 |
+
<annotation cp="➖" type="tts">Minus</annotation>
|
| 385 |
+
<annotation cp="❔">Satzzeichen | weiss | weisses Fragezeichen</annotation>
|
| 386 |
+
<annotation cp="❔" type="tts">weisses Fragezeichen</annotation>
|
| 387 |
+
<annotation cp="❕">Satzzeichen | weiss | weisses Ausrufezeichen</annotation>
|
| 388 |
+
<annotation cp="❕" type="tts">weisses Ausrufezeichen</annotation>
|
| 389 |
+
<annotation cp="⭕">grosser Kreis | hohler roter Kreis | Kreis | o | rot</annotation>
|
| 390 |
+
<annotation cp="✅">abgehakt | erledigt | Weisses Häkchen</annotation>
|
| 391 |
+
<annotation cp="✅" type="tts">Weisses Häkchen</annotation>
|
| 392 |
+
<annotation cp="➰">Looping | Schleife</annotation>
|
| 393 |
+
<annotation cp="🔠">Eingabesymbol lateinische Grossbuchstaben | Grossbuchstaben | lateinische Grossbuchstaben</annotation>
|
| 394 |
+
<annotation cp="🔠" type="tts">Eingabesymbol lateinische Grossbuchstaben</annotation>
|
| 395 |
+
<annotation cp="🅰">a | Blut | Blutgruppe | Grossbuchstabe A in Quadrat | negativ | positiv</annotation>
|
| 396 |
+
<annotation cp="🅰" type="tts">Grossbuchstabe A in Quadrat</annotation>
|
| 397 |
+
<annotation cp="🆎">ab | Blut | Blutgruppe | Grossbuchstaben AB in rotem Quadrat | negativ | positiv</annotation>
|
| 398 |
+
<annotation cp="🆎" type="tts">Grossbuchstaben AB in rotem Quadrat</annotation>
|
| 399 |
+
<annotation cp="🅱">b | Blut | Blutgruppe | Grossbuchstabe B in Quadrat | negativ | positiv</annotation>
|
| 400 |
+
<annotation cp="🅱" type="tts">Grossbuchstabe B in Quadrat</annotation>
|
| 401 |
+
<annotation cp="🆑">CL | Grossbuchstaben CL in rotem Quadrat</annotation>
|
| 402 |
+
<annotation cp="🆑" type="tts">Grossbuchstaben CL in rotem Quadrat</annotation>
|
| 403 |
+
<annotation cp="🆔">Grossbuchstaben ID in lila Quadrat | ID</annotation>
|
| 404 |
+
<annotation cp="🆔" type="tts">Grossbuchstaben ID in lila Quadrat</annotation>
|
| 405 |
+
<annotation cp="🆖">Grossbuchstaben NG in blauem Quadrat | NG</annotation>
|
| 406 |
+
<annotation cp="🆖" type="tts">Grossbuchstaben NG in blauem Quadrat</annotation>
|
| 407 |
+
<annotation cp="🅾">0 | Blut | Blutgruppe | Grossbuchstabe O in Quadrat | negativ | positiv</annotation>
|
| 408 |
+
<annotation cp="🅾" type="tts">Grossbuchstabe O in Quadrat</annotation>
|
| 409 |
+
<annotation cp="🆗">Grossbuchstaben OK in blauem Quadrat | OK</annotation>
|
| 410 |
+
<annotation cp="🆗" type="tts">Grossbuchstaben OK in blauem Quadrat</annotation>
|
| 411 |
+
<annotation cp="🅿">Grossbuchstabe P in Quadrat | Parkplatz | Quadrat</annotation>
|
| 412 |
+
<annotation cp="🅿" type="tts">Grossbuchstabe P in Quadrat</annotation>
|
| 413 |
+
<annotation cp="🆚">Grossbuchstaben VS in orangefarbenem Quadrat | versus | VS</annotation>
|
| 414 |
+
<annotation cp="🆚" type="tts">Grossbuchstaben VS in orangefarbenem Quadrat</annotation>
|
| 415 |
+
<annotation cp="🔴">Ball | Grosser roter Kreis | Kreis | rot</annotation>
|
| 416 |
+
<annotation cp="🔴" type="tts">Grosser roter Kreis</annotation>
|
| 417 |
+
<annotation cp="🔵">Ball | blau | Grosser blauer Kreis | Kreis</annotation>
|
| 418 |
+
<annotation cp="🔵" type="tts">Grosser blauer Kreis</annotation>
|
| 419 |
+
<annotation cp="⚫">Ball | Grosser schwarzer Kreis | Kreis | schwarz</annotation>
|
| 420 |
+
<annotation cp="⚫" type="tts">Grosser schwarzer Kreis</annotation>
|
| 421 |
+
<annotation cp="⚪">Ball | Grosser weisser Kreis | Kreis | weiss</annotation>
|
| 422 |
+
<annotation cp="⚪" type="tts">Grosser weisser Kreis</annotation>
|
| 423 |
+
<annotation cp="⬛">Grosses schwarzes Quadrat | Quadrat | schwarz</annotation>
|
| 424 |
+
<annotation cp="⬛" type="tts">Grosses schwarzes Quadrat</annotation>
|
| 425 |
+
<annotation cp="⬜">Grosses weisses Quadrat | Quadrat | weiss</annotation>
|
| 426 |
+
<annotation cp="⬜" type="tts">Grosses weisses Quadrat</annotation>
|
| 427 |
+
<annotation cp="◼">Mittelgrosses schwarzes Quadrat | Quadrat | schwarz</annotation>
|
| 428 |
+
<annotation cp="◼" type="tts">Mittelgrosses schwarzes Quadrat</annotation>
|
| 429 |
+
<annotation cp="◻">Mittelgrosses weisses Quadrat | Quadrat | weiss</annotation>
|
| 430 |
+
<annotation cp="◻" type="tts">Mittelgrosses weisses Quadrat</annotation>
|
| 431 |
+
<annotation cp="◽">Mittelkleines weisses Quadrat | Quadrat | weiss</annotation>
|
| 432 |
+
<annotation cp="◽" type="tts">Mittelkleines weisses Quadrat</annotation>
|
| 433 |
+
<annotation cp="▫">Kleines weisses Quadrat | Quadrat | weiss</annotation>
|
| 434 |
+
<annotation cp="▫" type="tts">Kleines weisses Quadrat</annotation>
|
| 435 |
+
<annotation cp="🔶">Grosse orangefarbene Raute | orangefarben | Raute</annotation>
|
| 436 |
+
<annotation cp="🔶" type="tts">Grosse orangefarbene Raute</annotation>
|
| 437 |
+
<annotation cp="🔷">blau | Grosse blaue Raute | Raute</annotation>
|
| 438 |
+
<annotation cp="🔷" type="tts">Grosse blaue Raute</annotation>
|
| 439 |
+
<annotation cp="🔳">quadratisch | Schaltfläche | weiss | Weisse quadratische Schaltfläche</annotation>
|
| 440 |
+
<annotation cp="🔳" type="tts">Weisse quadratische Schaltfläche</annotation>
|
| 441 |
+
<annotation cp="🏳">Fahne | wehen | Wehende weisse Fahne | weisse Fahne</annotation>
|
| 442 |
+
<annotation cp="🏳" type="tts">Wehende weisse Fahne</annotation>
|
| 443 |
+
<annotation cp="🏳⚧">Flagge | hellblau | pink | Transgender | Transgenderflagge | weiss</annotation>
|
| 444 |
+
<annotation cp="🏳⚧" type="tts">Transgenderflagge</annotation>
|
| 445 |
+
<annotation cp="$">Dollar | Dollarzeichen | Geld | Peso | USD</annotation>
|
| 446 |
+
<annotation cp="$" type="tts">Dollarzeichen</annotation>
|
| 447 |
+
<annotation cp="₤" draft="contributed">Lira | Währung</annotation>
|
| 448 |
+
<annotation cp="₰" draft="contributed">Deutscher Pfennig | Pfennig | Währung</annotation>
|
| 449 |
+
<annotation cp="₳" draft="contributed">ARA | Austral | Währung</annotation>
|
| 450 |
+
<annotation cp="₶" draft="contributed">Livre tournois | Livre tournoise | Währung</annotation>
|
| 451 |
+
<annotation cp="₷" draft="contributed">Spesmilo | Währung</annotation>
|
| 452 |
+
<annotation cp="₨" draft="contributed">Rupie | Währung</annotation>
|
| 453 |
+
<annotation cp="﷼" draft="contributed">Rial | Währung</annotation>
|
| 454 |
+
<annotation cp="µ">Masseinheit | Mikro-Zeichen | My</annotation>
|
| 455 |
+
</annotations>
|
| 456 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/doi.xml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="doi"/>
|
| 12 |
+
</identity>
|
| 13 |
+
<annotations>
|
| 14 |
+
<annotation cp="‾">ओवरलाइन</annotation>
|
| 15 |
+
<annotation cp="‾" type="tts">ओवरलाइन</annotation>
|
| 16 |
+
<annotation cp="‽">इंटरोबैंग</annotation>
|
| 17 |
+
<annotation cp="‽" type="tts">इंटरोबैंग</annotation>
|
| 18 |
+
<annotation cp="‸">कैरट</annotation>
|
| 19 |
+
<annotation cp="‸" type="tts">कैरट</annotation>
|
| 20 |
+
<annotation cp="⁂">नक्षत्र</annotation>
|
| 21 |
+
<annotation cp="⁂" type="tts">नक्षत्र</annotation>
|
| 22 |
+
<annotation cp="¬">नांह्</annotation>
|
| 23 |
+
<annotation cp="¬" type="tts">नांह्</annotation>
|
| 24 |
+
<annotation cp="|">लंबूतरी काहर</annotation>
|
| 25 |
+
<annotation cp="|" type="tts">लंबूतरी काहर</annotation>
|
| 26 |
+
<annotation cp="~">टिल्ड</annotation>
|
| 27 |
+
<annotation cp="~" type="tts">टिल्ड</annotation>
|
| 28 |
+
<annotation cp="≥">थमां बड्डा जां बरोबर</annotation>
|
| 29 |
+
<annotation cp="≥" type="tts">थमां बड्डा जां बरोबर</annotation>
|
| 30 |
+
</annotations>
|
| 31 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/dsb.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/el.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/en.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/en_001.xml
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
|
| 8 |
+
Warnings: All cp values have U+FE0F characters removed. See /annotationsDerived/ for derived annotations.
|
| 9 |
+
-->
|
| 10 |
+
<ldml>
|
| 11 |
+
<identity>
|
| 12 |
+
<version number="$Revision$"/>
|
| 13 |
+
<language type="en"/>
|
| 14 |
+
<territory type="001"/>
|
| 15 |
+
</identity>
|
| 16 |
+
<annotations>
|
| 17 |
+
<annotation cp="{">brace | bracket | curly brace | curly bracket | gullwing | left curly bracket | open curly bracket</annotation>
|
| 18 |
+
<annotation cp="🏻">light skin tone | skin tone</annotation>
|
| 19 |
+
<annotation cp="🏼">medium-light skin tone | skin tone</annotation>
|
| 20 |
+
<annotation cp="🏽">medium skin tone | skin tone</annotation>
|
| 21 |
+
<annotation cp="🏾">medium-dark skin tone | skin tone</annotation>
|
| 22 |
+
<annotation cp="🏿">dark skin tone | skin tone</annotation>
|
| 23 |
+
<annotation cp="_">dash | line | low dash | underdash | underline | underscore</annotation>
|
| 24 |
+
<annotation cp="_" type="tts">underscore</annotation>
|
| 25 |
+
<annotation cp="،">Arabic | comma</annotation>
|
| 26 |
+
<annotation cp="،" type="tts">Arabic comma</annotation>
|
| 27 |
+
<annotation cp="؛">Arabic | Arabic semicolon | semi-colon</annotation>
|
| 28 |
+
<annotation cp="؛" type="tts">Arabic semicolon</annotation>
|
| 29 |
+
<annotation cp="؟">Arabic | Arabic question mark | question | question mark</annotation>
|
| 30 |
+
<annotation cp="؟" type="tts">Arabic question mark</annotation>
|
| 31 |
+
<annotation cp="." type="tts">full stop</annotation>
|
| 32 |
+
<annotation cp="。">full stop | ideographic | ideographic full stop | period</annotation>
|
| 33 |
+
<annotation cp="。" type="tts">ideographic full stop</annotation>
|
| 34 |
+
<annotation cp="'">apostrophe | quote | single quote | straight apostrophe | typewriter apostrophe</annotation>
|
| 35 |
+
<annotation cp="'" type="tts">straight apostrophe</annotation>
|
| 36 |
+
<annotation cp="‘">apostrophe | curly quote | left apostrophe | quote | single quote | smart quote</annotation>
|
| 37 |
+
<annotation cp="’">apostrophe | curly quote | quote | right apostrophe | single quote | smart quote</annotation>
|
| 38 |
+
<annotation cp="“">curly quotes | double quote | left quotation mark | quotation | quote | smart quotation</annotation>
|
| 39 |
+
<annotation cp="”">curly quotes | double quote | quotation | quote | right quotation mark | smart quotation</annotation>
|
| 40 |
+
<annotation cp=")">bracket | close parenthesis | parens | parenthesis | round bracket</annotation>
|
| 41 |
+
<annotation cp="[">bracket | crotchet | left square bracket | open square bracket | square bracket</annotation>
|
| 42 |
+
<annotation cp="]">bracket | close square bracket | crotchet | right square bracket | square bracket</annotation>
|
| 43 |
+
<annotation cp="}">brace | bracket | close curly bracket | curly brace | curly bracket | gullwing | right curly bracket</annotation>
|
| 44 |
+
<annotation cp="〈">angle bracket | bracket | chevron | diamond brackets | left angle bracket | open angle bracket | pointy bracket | tuple</annotation>
|
| 45 |
+
<annotation cp="〉">angle bracket | bracket | chevron | close angle bracket | diamond brackets | pointy bracket | right angle bracket | tuple</annotation>
|
| 46 |
+
<annotation cp="《">bracket | double angle bracket | left double angle bracket | open double angle bracket</annotation>
|
| 47 |
+
<annotation cp="》">bracket | close double angle bracket | double angle bracket | right double angle bracket</annotation>
|
| 48 |
+
<annotation cp="「">bracket | corner bracket | left corner bracket | open corner bracket</annotation>
|
| 49 |
+
<annotation cp="」">bracket | close corner bracket | corner bracket | right corner bracket</annotation>
|
| 50 |
+
<annotation cp="『">bracket | hollow corner bracket | left hollow corner bracket | open hollow corner bracket</annotation>
|
| 51 |
+
<annotation cp="』">bracket | close hollow corner bracket | hollow corner bracket | right hollow corner bracket</annotation>
|
| 52 |
+
<annotation cp="【">bracket | left black lenticular bracket | lens bracket | lenticular bracket | open black lenticular bracket</annotation>
|
| 53 |
+
<annotation cp="【" type="tts">open black lenticular bracket</annotation>
|
| 54 |
+
<annotation cp="】">bracket | close black lenticular bracket | lens bracket | lenticular bracket | right black lenticular bracket</annotation>
|
| 55 |
+
<annotation cp="】" type="tts">close black lenticular bracket</annotation>
|
| 56 |
+
<annotation cp="〔">bracket | left tortoise shell bracket | open tortoise shell bracket | shell bracket | tortoise shell bracket</annotation>
|
| 57 |
+
<annotation cp="〕">bracket | close tortoise shell bracket | right tortoise shell bracket | shell bracket | tortoise shell bracket</annotation>
|
| 58 |
+
<annotation cp="〖">bracket | hollow lens bracket | hollow lenticular bracket | left hollow lenticular bracket | open hollow lenticular bracket</annotation>
|
| 59 |
+
<annotation cp="〖" type="tts">open hollow lenticular bracket</annotation>
|
| 60 |
+
<annotation cp="〗">bracket | close hollow lenticular bracket | hollow lens bracket | hollow lenticular bracket | right hollow lenticular bracket</annotation>
|
| 61 |
+
<annotation cp="〗" type="tts">close hollow lenticular bracket</annotation>
|
| 62 |
+
<annotation cp="@">ampersat | arobase | arroba | at mark | at sign | commercial at | strudel</annotation>
|
| 63 |
+
<annotation cp="@" type="tts">at sign</annotation>
|
| 64 |
+
<annotation cp="%" type="tts">per cent</annotation>
|
| 65 |
+
<annotation cp="‰">per mil | per mill | per mille | permil | permille</annotation>
|
| 66 |
+
<annotation cp="†">dagger | dagger sign | dagger symbol | obelisk | obelus</annotation>
|
| 67 |
+
<annotation cp="†" type="tts">dagger symbol</annotation>
|
| 68 |
+
<annotation cp="‡">dagger | double | double dagger sign | double dagger symbol | obelisk | obelus</annotation>
|
| 69 |
+
<annotation cp="‡" type="tts">double dagger symbol</annotation>
|
| 70 |
+
<annotation cp="^">accent | caret | chevron | circumflex | hat | power | wedge</annotation>
|
| 71 |
+
<annotation cp="↚">leftwards arrow with stroke</annotation>
|
| 72 |
+
<annotation cp="↚" type="tts">leftwards arrow with stroke</annotation>
|
| 73 |
+
<annotation cp="↛">rightwards arrow with stroke</annotation>
|
| 74 |
+
<annotation cp="↛" type="tts">rightwards arrow with stroke</annotation>
|
| 75 |
+
<annotation cp="↞">leftwards two-headed arrow</annotation>
|
| 76 |
+
<annotation cp="↞" type="tts">leftwards two-headed arrow</annotation>
|
| 77 |
+
<annotation cp="↟">upwards two-headed arrow</annotation>
|
| 78 |
+
<annotation cp="↟" type="tts">upwards two-headed arrow</annotation>
|
| 79 |
+
<annotation cp="↠">rightwards two-headed arrow</annotation>
|
| 80 |
+
<annotation cp="↠" type="tts">rightwards two-headed arrow</annotation>
|
| 81 |
+
<annotation cp="↡">downwards two-headed arrow</annotation>
|
| 82 |
+
<annotation cp="↡" type="tts">downwards two-headed arrow</annotation>
|
| 83 |
+
<annotation cp="↢">arrow | arrow with tail | left | leftwards arrow with tail</annotation>
|
| 84 |
+
<annotation cp="↢" type="tts">leftwards arrow with tail</annotation>
|
| 85 |
+
<annotation cp="↣">rightwards arrow with tail</annotation>
|
| 86 |
+
<annotation cp="↣" type="tts">rightwards arrow with tail</annotation>
|
| 87 |
+
<annotation cp="↨">up-down arrow with base</annotation>
|
| 88 |
+
<annotation cp="↨" type="tts">up-down arrow with base</annotation>
|
| 89 |
+
<annotation cp="↫">leftwards arrow with loop</annotation>
|
| 90 |
+
<annotation cp="↫" type="tts">leftwards arrow with loop</annotation>
|
| 91 |
+
<annotation cp="↬">rightwards arrow with loop</annotation>
|
| 92 |
+
<annotation cp="↬" type="tts">rightwards arrow with loop</annotation>
|
| 93 |
+
<annotation cp="↭">left-right wave arrow</annotation>
|
| 94 |
+
<annotation cp="↭" type="tts">left-right wave arrow</annotation>
|
| 95 |
+
<annotation cp="↰">upwards arrow with leftwards tip</annotation>
|
| 96 |
+
<annotation cp="↰" type="tts">upwards arrow with leftwards tip</annotation>
|
| 97 |
+
<annotation cp="↱">upwards arrow with rightwards tip</annotation>
|
| 98 |
+
<annotation cp="↱" type="tts">upwards arrow with rightwards tip</annotation>
|
| 99 |
+
<annotation cp="↲">downwards arrow with leftwards tip</annotation>
|
| 100 |
+
<annotation cp="↲" type="tts">downwards arrow with leftwards tip</annotation>
|
| 101 |
+
<annotation cp="↳">downwards arrow with rightwards tip</annotation>
|
| 102 |
+
<annotation cp="↳" type="tts">downwards arrow with rightwards tip</annotation>
|
| 103 |
+
<annotation cp="↴">rightwards arrow with corner downwards</annotation>
|
| 104 |
+
<annotation cp="↴" type="tts">rightwards arrow with corner downwards</annotation>
|
| 105 |
+
<annotation cp="↵">downwards arrow with corner leftwards</annotation>
|
| 106 |
+
<annotation cp="↵" type="tts">downwards arrow with corner leftwards</annotation>
|
| 107 |
+
<annotation cp="↶">anticlockwise top-semicircle arrow</annotation>
|
| 108 |
+
<annotation cp="↶" type="tts">anticlockwise top-semicircle arrow</annotation>
|
| 109 |
+
<annotation cp="↷">clockwise top-semicircle arrow</annotation>
|
| 110 |
+
<annotation cp="↷" type="tts">clockwise top-semicircle arrow</annotation>
|
| 111 |
+
<annotation cp="↸">north-west arrow to long bar</annotation>
|
| 112 |
+
<annotation cp="↸" type="tts">north-west arrow to long bar</annotation>
|
| 113 |
+
<annotation cp="↹" draft="provisional">leftwards over rightwards arrow bars</annotation>
|
| 114 |
+
<annotation cp="↺">anticlockwise open-circle arrow</annotation>
|
| 115 |
+
<annotation cp="↺" type="tts">anticlockwise open-circle arrow</annotation>
|
| 116 |
+
<annotation cp="↻">clockwise open-circle arrow</annotation>
|
| 117 |
+
<annotation cp="↻" type="tts">clockwise open-circle arrow</annotation>
|
| 118 |
+
<annotation cp="↼">leftwards harpoon with upwards barb</annotation>
|
| 119 |
+
<annotation cp="↼" type="tts">leftwards harpoon with upwards barb</annotation>
|
| 120 |
+
<annotation cp="↽">leftwards harpoon with downwards barb</annotation>
|
| 121 |
+
<annotation cp="↽" type="tts">leftwards harpoon with downwards barb</annotation>
|
| 122 |
+
<annotation cp="↾">upwards harpoon with rightwards barb</annotation>
|
| 123 |
+
<annotation cp="↾" type="tts">upwards harpoon with rightwards barb</annotation>
|
| 124 |
+
<annotation cp="↿">upwards harpoon with leftwards barb</annotation>
|
| 125 |
+
<annotation cp="↿" type="tts">upwards harpoon with leftwards barb</annotation>
|
| 126 |
+
<annotation cp="⇀">rightwards harpoon with upwards barb</annotation>
|
| 127 |
+
<annotation cp="⇀" type="tts">rightwards harpoon with upwards barb</annotation>
|
| 128 |
+
<annotation cp="⇁">rightwards harpoon with downwards barb</annotation>
|
| 129 |
+
<annotation cp="⇁" type="tts">rightwards harpoon with downwards barb</annotation>
|
| 130 |
+
<annotation cp="⇂">downwards harpoon with rightwards barb</annotation>
|
| 131 |
+
<annotation cp="⇂" type="tts">downwards harpoon with rightwards barb</annotation>
|
| 132 |
+
<annotation cp="⇃">downwards harpoon with leftwards barb</annotation>
|
| 133 |
+
<annotation cp="⇃" type="tts">downwards harpoon with leftwards barb</annotation>
|
| 134 |
+
<annotation cp="⇍">leftwards double arrow with stroke</annotation>
|
| 135 |
+
<annotation cp="⇍" type="tts">leftwards double arrow with stroke</annotation>
|
| 136 |
+
<annotation cp="⇏">rightwards double arrow with stroke</annotation>
|
| 137 |
+
<annotation cp="⇏" type="tts">rightwards double arrow with stroke</annotation>
|
| 138 |
+
<annotation cp="⇔">left-right double arrow</annotation>
|
| 139 |
+
<annotation cp="⇔" type="tts">left-right double arrow</annotation>
|
| 140 |
+
<annotation cp="⇎">left-right double arrow with stroke</annotation>
|
| 141 |
+
<annotation cp="⇎" type="tts">left-right double arrow with stroke</annotation>
|
| 142 |
+
<annotation cp="⇖">north-west double arrow</annotation>
|
| 143 |
+
<annotation cp="⇖" type="tts">north-west double arrow</annotation>
|
| 144 |
+
<annotation cp="⇗">north-east double arrow</annotation>
|
| 145 |
+
<annotation cp="⇗" type="tts">north-east double arrow</annotation>
|
| 146 |
+
<annotation cp="⇘">south-east double arrow</annotation>
|
| 147 |
+
<annotation cp="⇘" type="tts">south-east double arrow</annotation>
|
| 148 |
+
<annotation cp="⇙">south-west double arrow</annotation>
|
| 149 |
+
<annotation cp="⇙" type="tts">south-west double arrow</annotation>
|
| 150 |
+
<annotation cp="⇞">upwards arrow with double stroke</annotation>
|
| 151 |
+
<annotation cp="⇞" type="tts">upwards arrow with double stroke</annotation>
|
| 152 |
+
<annotation cp="⇟">downwards arrow with double stroke</annotation>
|
| 153 |
+
<annotation cp="⇟" type="tts">downwards arrow with double stroke</annotation>
|
| 154 |
+
<annotation cp="⇤">leftwards arrow bar | leftwards arrow to bar</annotation>
|
| 155 |
+
<annotation cp="⇤" type="tts">leftwards arrow to bar</annotation>
|
| 156 |
+
<annotation cp="⇥">rightwards arrow bar | rightwards arrow to bar</annotation>
|
| 157 |
+
<annotation cp="⇥" type="tts">rightwards arrow to bar</annotation>
|
| 158 |
+
<annotation cp="⇵">downwards and upwards arrows</annotation>
|
| 159 |
+
<annotation cp="⇵" type="tts">downwards and upwards arrows</annotation>
|
| 160 |
+
<annotation cp="∂">differential | partial derivative | partial differential</annotation>
|
| 161 |
+
<annotation cp="∃">existential | mathematics | quantifier | there exists</annotation>
|
| 162 |
+
<annotation cp="∅">empty set | mathematics | null set | null sign | set operator</annotation>
|
| 163 |
+
<annotation cp="∉">element | not an element | not an element of | set</annotation>
|
| 164 |
+
<annotation cp="∎">end of proof | end proof | halmos | q.e.d. | qed | tombstone</annotation>
|
| 165 |
+
<annotation cp="∎" type="tts">end of proof</annotation>
|
| 166 |
+
<annotation cp="∑">mathematics | n-ary summation | sigma | summation</annotation>
|
| 167 |
+
<annotation cp="|">bar | line | pipe | sheffer stroke | vertical bar | vertical line</annotation>
|
| 168 |
+
<annotation cp="∓">minus-or-plus | minus-plus</annotation>
|
| 169 |
+
<annotation cp="∝">is proportional | proportional | proportionality</annotation>
|
| 170 |
+
<annotation cp="∝" type="tts">is proportional</annotation>
|
| 171 |
+
<annotation cp="∣">divides | divisor | vertical bar</annotation>
|
| 172 |
+
<annotation cp="∥">parallel | parallel to</annotation>
|
| 173 |
+
<annotation cp="∥" type="tts">parallel to</annotation>
|
| 174 |
+
<annotation cp="∮">complex analysis | contour integral</annotation>
|
| 175 |
+
<annotation cp="≃">asymptote | asymptotically equal | asymptotically equal to | mathematics</annotation>
|
| 176 |
+
<annotation cp="≃" type="tts">asymptotically equal to</annotation>
|
| 177 |
+
<annotation cp="≅">approximately equal | approximately equal to | congruence | equality | isomorphism | mathematics</annotation>
|
| 178 |
+
<annotation cp="≅" type="tts">approximately equal to</annotation>
|
| 179 |
+
<annotation cp="≌">all equal | all equal to | equality | mathematics</annotation>
|
| 180 |
+
<annotation cp="≌" type="tts">all equal to</annotation>
|
| 181 |
+
<annotation cp="≣">equality | mathematics | strictly equivalent | strictly equivalent to</annotation>
|
| 182 |
+
<annotation cp="≣" type="tts">strictly equivalent to</annotation>
|
| 183 |
+
<annotation cp="≳">equivalent | greater-than | greater-than or equivalent to | inequality | mathematics</annotation>
|
| 184 |
+
<annotation cp="≳" type="tts">greater-than or equivalent to</annotation>
|
| 185 |
+
<annotation cp="≺">mathematics | ordered set | precedes | set operator</annotation>
|
| 186 |
+
<annotation cp="≻">follows | mathematics | ordered set | set operator | succeeds</annotation>
|
| 187 |
+
<annotation cp="⊁">does not succeed | mathematics | ordered set | set operator</annotation>
|
| 188 |
+
<annotation cp="⊃">mathematics | proper superset | set operator | superset of</annotation>
|
| 189 |
+
<annotation cp="⊃" type="tts">superset of</annotation>
|
| 190 |
+
<annotation cp="⊆">equal | mathematics | subset | subset of or equal to</annotation>
|
| 191 |
+
<annotation cp="⊆" type="tts">subset of or equal to</annotation>
|
| 192 |
+
<annotation cp="⊇">equal | mathematics | superset | superset of or equal to</annotation>
|
| 193 |
+
<annotation cp="⊇" type="tts">superset of or equal to</annotation>
|
| 194 |
+
<annotation cp="⊕">circled plus | direct sum | exclusive or | logic | mathematics</annotation>
|
| 195 |
+
<annotation cp="⊖">circled minus | erosion | mathematics | symmetric difference</annotation>
|
| 196 |
+
<annotation cp="⊗">circled times | Kronecker | product | tensor</annotation>
|
| 197 |
+
<annotation cp="⊙">circled dot operator | mathematics | vector | XNOR</annotation>
|
| 198 |
+
<annotation cp="⊛">circled asterisk operator</annotation>
|
| 199 |
+
<annotation cp="⊞">addition-like | free additive convolution | mathematics | squared plus</annotation>
|
| 200 |
+
<annotation cp="⊮">does not force | mathematics</annotation>
|
| 201 |
+
<annotation cp="⊰">mathematics | ordered set | precedes under relation | set operator</annotation>
|
| 202 |
+
<annotation cp="⊱">mathematics | ordered set | set operator | succeeds under relation</annotation>
|
| 203 |
+
<annotation cp="⋭">does not contain as normal subgroup equal | does not contain as normal subgroup or equal | group theory | mathematics</annotation>
|
| 204 |
+
<annotation cp="⋭" type="tts">does not contain as normal subgroup or equal</annotation>
|
| 205 |
+
<annotation cp="⊶">original | original of</annotation>
|
| 206 |
+
<annotation cp="⊶" type="tts">original of</annotation>
|
| 207 |
+
<annotation cp="⋰">ellipsis | mathematics | upwards diagonal ellipsis | upwards right diagonal ellipsis</annotation>
|
| 208 |
+
<annotation cp="⋰" type="tts">upwards right diagonal ellipsis</annotation>
|
| 209 |
+
<annotation cp="⋱">downwards right diagonal ellipsis | ellipsis | mathematics</annotation>
|
| 210 |
+
<annotation cp="⋱" type="tts">downwards right diagonal ellipsis</annotation>
|
| 211 |
+
<annotation cp="■">black square | filled square</annotation>
|
| 212 |
+
<annotation cp="□">hollow square | white square</annotation>
|
| 213 |
+
<annotation cp="▢">hollow square with rounded corners | white square with rounded corners</annotation>
|
| 214 |
+
<annotation cp="▣">hollow square containing filled square | white square containing black small square</annotation>
|
| 215 |
+
<annotation cp="▦">square with orthogonal crosshatch fill</annotation>
|
| 216 |
+
<annotation cp="▦" type="tts">square with orthogonal crosshatch fill</annotation>
|
| 217 |
+
<annotation cp="▧">square with upper left to lower right fill</annotation>
|
| 218 |
+
<annotation cp="▧" type="tts">square with upper left to lower right fill</annotation>
|
| 219 |
+
<annotation cp="▨">square with upper right to lower left fill</annotation>
|
| 220 |
+
<annotation cp="▨" type="tts">square with upper right to lower left fill</annotation>
|
| 221 |
+
<annotation cp="▩">square with diagonal crosshatch fill</annotation>
|
| 222 |
+
<annotation cp="▩" type="tts">square with diagonal crosshatch fill</annotation>
|
| 223 |
+
<annotation cp="▬">black rectangle | filled rectangle</annotation>
|
| 224 |
+
<annotation cp="▭">hollow rectangle | white rectangle</annotation>
|
| 225 |
+
<annotation cp="▮">black vertical rectangle | filled vertical rectangle</annotation>
|
| 226 |
+
<annotation cp="▰">black parallelogram | filled parallelogram</annotation>
|
| 227 |
+
<annotation cp="▲">arrow | black up-pointing triangle | filled up-pointing triangle | triangle | up</annotation>
|
| 228 |
+
<annotation cp="△">hollow up-pointing triangle | white up-pointing triangle</annotation>
|
| 229 |
+
<annotation cp="▴">black up-pointing small triangle | filled up-pointing small triangle</annotation>
|
| 230 |
+
<annotation cp="▵">hollow up-pointing small triangle | white up-pointing small triangle</annotation>
|
| 231 |
+
<annotation cp="▷">hollow right-pointing triangle | white right-pointing triangle</annotation>
|
| 232 |
+
<annotation cp="▸">black right-pointing triangle | filled right-pointing small triangle</annotation>
|
| 233 |
+
<annotation cp="▹">hollow right-pointing small triangle | white right-pointing small triangle</annotation>
|
| 234 |
+
<annotation cp="►">black right-pointing pointer | filled right-pointing pointer</annotation>
|
| 235 |
+
<annotation cp="▻">hollow right-pointing pointer | white right-pointing pointer</annotation>
|
| 236 |
+
<annotation cp="▼">arrow | black down-pointing triangle | down | filled down-pointing triangle | triangle</annotation>
|
| 237 |
+
<annotation cp="▽">hollow down-pointing triangle | white down-pointing triangle</annotation>
|
| 238 |
+
<annotation cp="▾">black down-pointing small triangle | filled down-pointing small triangle</annotation>
|
| 239 |
+
<annotation cp="▿">hollow down-pointing small triangle | white down-pointing small triangle</annotation>
|
| 240 |
+
<annotation cp="◁">hollow left-pointing triangle | white left-pointing triangle</annotation>
|
| 241 |
+
<annotation cp="◂">black left-pointing small triangle | filled left-pointing small triangle</annotation>
|
| 242 |
+
<annotation cp="◃">hollow left-pointing small triangle | white left-pointing small triangle</annotation>
|
| 243 |
+
<annotation cp="◄">black left-pointing pointer | filled left-pointing pointer</annotation>
|
| 244 |
+
<annotation cp="◅">hollow left-pointing pointer | white left-pointing pointer</annotation>
|
| 245 |
+
<annotation cp="◆">black diamond | filled diamond</annotation>
|
| 246 |
+
<annotation cp="◇">hollow diamond | white diamond</annotation>
|
| 247 |
+
<annotation cp="◈">hollow diamond containing filled diamond | white diamond containing black small diamond</annotation>
|
| 248 |
+
<annotation cp="◉">circled dot | concentric circles filled | fisheye | hollow circle containing filled circle | white circle containing black small circle</annotation>
|
| 249 |
+
<annotation cp="○">circle | hollow circle | ring | white circle</annotation>
|
| 250 |
+
<annotation cp="●">black circle | circle | filled circle</annotation>
|
| 251 |
+
<annotation cp="◐">circle with left half filled</annotation>
|
| 252 |
+
<annotation cp="◐" type="tts">circle with left half filled</annotation>
|
| 253 |
+
<annotation cp="◑">circle with right half filled</annotation>
|
| 254 |
+
<annotation cp="◑" type="tts">circle with right half filled</annotation>
|
| 255 |
+
<annotation cp="◒">circle with lower half filled</annotation>
|
| 256 |
+
<annotation cp="◒" type="tts">circle with lower half filled</annotation>
|
| 257 |
+
<annotation cp="◓">circle with upper half filled</annotation>
|
| 258 |
+
<annotation cp="◓" type="tts">circle with upper half filled</annotation>
|
| 259 |
+
<annotation cp="◔">circle with upper-right quadrant filled</annotation>
|
| 260 |
+
<annotation cp="◔" type="tts">circle with upper-right quadrant filled</annotation>
|
| 261 |
+
<annotation cp="◕">circle with all but upper-left quadrant filled</annotation>
|
| 262 |
+
<annotation cp="◕" type="tts">circle with all but upper-left quadrant filled</annotation>
|
| 263 |
+
<annotation cp="◖">left half black circle | left half filled circle</annotation>
|
| 264 |
+
<annotation cp="◗">right half black circle | right half filled circle</annotation>
|
| 265 |
+
<annotation cp="◙">black square containing hollow circle | filled square containing hollow circle | inverse hollow circle</annotation>
|
| 266 |
+
<annotation cp="◜">upper-left quadrant circular arc</annotation>
|
| 267 |
+
<annotation cp="◜" type="tts">upper-left quadrant circular arc</annotation>
|
| 268 |
+
<annotation cp="◝">upper-right quadrant circular arc</annotation>
|
| 269 |
+
<annotation cp="◝" type="tts">upper-right quadrant circular arc</annotation>
|
| 270 |
+
<annotation cp="◞">lower-right quadrant circular arc</annotation>
|
| 271 |
+
<annotation cp="◞" type="tts">lower-right quadrant circular arc</annotation>
|
| 272 |
+
<annotation cp="◟">lower-left quadrant circular arc</annotation>
|
| 273 |
+
<annotation cp="◟" type="tts">lower-left quadrant circular arc</annotation>
|
| 274 |
+
<annotation cp="◢">black lower-right triangle | filled lower-right triangle</annotation>
|
| 275 |
+
<annotation cp="◢" type="tts">filled lower-right triangle</annotation>
|
| 276 |
+
<annotation cp="◣">black lower-left triangle | filled lower-left triangle</annotation>
|
| 277 |
+
<annotation cp="◣" type="tts">filled lower-left triangle</annotation>
|
| 278 |
+
<annotation cp="◤">black upper-left triangle | filled upper-left triangle</annotation>
|
| 279 |
+
<annotation cp="◤" type="tts">filled upper-left triangle</annotation>
|
| 280 |
+
<annotation cp="◥">black upper-right triangle | filled upper-right triangle</annotation>
|
| 281 |
+
<annotation cp="◥" type="tts">filled upper-right triangle</annotation>
|
| 282 |
+
<annotation cp="◯">circle | large hollow circle | large white circle | ring</annotation>
|
| 283 |
+
<annotation cp="◳">hollow square with upper-right quadrant | white square with upper-right quadrant</annotation>
|
| 284 |
+
<annotation cp="◳" type="tts">hollow square with upper-right quadrant</annotation>
|
| 285 |
+
<annotation cp="◷">hollow circle with upper-right quadrant | white circle with upper-right quadrant</annotation>
|
| 286 |
+
<annotation cp="◷" type="tts">hollow circle with upper-right quadrant</annotation>
|
| 287 |
+
<annotation cp="◿">lower-right triangle | white</annotation>
|
| 288 |
+
<annotation cp="◿" type="tts">lower-right triangle</annotation>
|
| 289 |
+
<annotation cp="♪">eighth | music | note | quaver</annotation>
|
| 290 |
+
<annotation cp="♪" type="tts">quaver</annotation>
|
| 291 |
+
<annotation cp="⨧">plus sign with subscript two</annotation>
|
| 292 |
+
<annotation cp="⨧" type="tts">plus sign with subscript two</annotation>
|
| 293 |
+
<annotation cp="⨯">vector or cross product</annotation>
|
| 294 |
+
<annotation cp="⨯" type="tts">vector or cross product</annotation>
|
| 295 |
+
<annotation cp="⨼">interior product | mathematics</annotation>
|
| 296 |
+
<annotation cp="⩣">logical or with double underbar | mathematics</annotation>
|
| 297 |
+
<annotation cp="⩣" type="tts">logical or with double underbar</annotation>
|
| 298 |
+
<annotation cp="⩽">inequality | less-than or slanted equal to | mathematics</annotation>
|
| 299 |
+
<annotation cp="⩽" type="tts">less-than or slanted equal to</annotation>
|
| 300 |
+
<annotation cp="⪍">less-than above similar or equal</annotation>
|
| 301 |
+
<annotation cp="⪍" type="tts">less-than above similar or equal</annotation>
|
| 302 |
+
<annotation cp="⪚">double-line equal to or greater-than | inequality | mathematics</annotation>
|
| 303 |
+
<annotation cp="⪚" type="tts">double-line equal to or greater-than</annotation>
|
| 304 |
+
<annotation cp="😋">delicious | face | face savoring food | face savouring food | savouring | smile | yum</annotation>
|
| 305 |
+
<annotation cp="😋" type="tts">face savouring food</annotation>
|
| 306 |
+
<annotation cp="🤭">embarrassed | face with hand over mouth | oops | whoops</annotation>
|
| 307 |
+
<annotation cp="🤐">face | mouth | zip | zip-mouth face</annotation>
|
| 308 |
+
<annotation cp="🤐" type="tts">zip-mouth face</annotation>
|
| 309 |
+
<annotation cp="🤨">distrust | face with raised eyebrow | sceptic</annotation>
|
| 310 |
+
<annotation cp="😶🌫">absent-minded | face in clouds | face in the fog | head in clouds</annotation>
|
| 311 |
+
<annotation cp="😷">cold | doctor | face with medical mask | ill | mask | medicine | poorly | sick</annotation>
|
| 312 |
+
<annotation cp="😵💫">dizzy | face with spiral eyes | hypnotised | spiral | trouble | whoa</annotation>
|
| 313 |
+
<annotation cp="🫤">disappointed | face with diagonal mouth | meh | sceptical | unsure</annotation>
|
| 314 |
+
<annotation cp="😤">angry | face | face with steam from nose | frustration | triumph | won</annotation>
|
| 315 |
+
<annotation cp="🩶">grey | heart | silver | slate</annotation>
|
| 316 |
+
<annotation cp="💬">balloon | bubble | comic | dialogue | speech</annotation>
|
| 317 |
+
<annotation cp="🗨">balloon | bubble | dialogue | left speech bubble | speech</annotation>
|
| 318 |
+
<annotation cp="🙌">celebration | gesture | hand | hooray | raising hands | woo hoo | yay</annotation>
|
| 319 |
+
<annotation cp="🙏">ask | hand | high 5 | high five | please | pray | thanks</annotation>
|
| 320 |
+
<annotation cp="🫀">anatomical heart | cardiology | heart | organ | pulse</annotation>
|
| 321 |
+
<annotation cp="🙇♂">apology | bowing | favour | gesture | man | sorry</annotation>
|
| 322 |
+
<annotation cp="🙇♀">apology | bowing | favour | gesture | sorry | woman</annotation>
|
| 323 |
+
<annotation cp="🧑⚖">judge | law</annotation>
|
| 324 |
+
<annotation cp="👨⚖">judge | justice | law | man</annotation>
|
| 325 |
+
<annotation cp="👩⚖">judge | justice | law | woman</annotation>
|
| 326 |
+
<annotation cp="🧑🚒">fire engine | fire truck | firefighter</annotation>
|
| 327 |
+
<annotation cp="👨🚒">fire | fire truck | firefighter | man</annotation>
|
| 328 |
+
<annotation cp="👩🚒">fire | fire truck | firefighter | woman</annotation>
|
| 329 |
+
<annotation cp="🤵">groom | person | person in tux | person in tuxedo | tuxedo</annotation>
|
| 330 |
+
<annotation cp="🤵♂">man | man in tux | man in tuxedo | tuxedo</annotation>
|
| 331 |
+
<annotation cp="🤵♀">tuxedo | woman | woman in tux | woman in tuxedo</annotation>
|
| 332 |
+
<annotation cp="💇">barber | beauty | haircut | parlour | person getting haircut</annotation>
|
| 333 |
+
<annotation cp="🧑🦯">accessibility | blind | person with guide cane | person with white cane</annotation>
|
| 334 |
+
<annotation cp="🧑🦯" type="tts">person with guide cane</annotation>
|
| 335 |
+
<annotation cp="👨🦯">accessibility | blind | man | man with guide cane</annotation>
|
| 336 |
+
<annotation cp="👨🦯" type="tts">man with guide cane</annotation>
|
| 337 |
+
<annotation cp="👩🦯">accessibility | blind | woman | woman with guide cane</annotation>
|
| 338 |
+
<annotation cp="👩🦯" type="tts">woman with guide cane</annotation>
|
| 339 |
+
<annotation cp="🧑🦼">accessibility | person in motorized wheelchair | person in powered wheelchair | wheelchair</annotation>
|
| 340 |
+
<annotation cp="🧑🦼" type="tts">person in powered wheelchair</annotation>
|
| 341 |
+
<annotation cp="👨🦼">accessibility | man | man in powered wheelchair | wheelchair</annotation>
|
| 342 |
+
<annotation cp="👨🦼" type="tts">man in powered wheelchair</annotation>
|
| 343 |
+
<annotation cp="👩🦼">accessibility | wheelchair | woman | woman in powered wheelchair</annotation>
|
| 344 |
+
<annotation cp="👩🦼" type="tts">woman in powered wheelchair</annotation>
|
| 345 |
+
<annotation cp="👬">couple | Gemini | holding hands | man | men holding hands | twins | zodiac</annotation>
|
| 346 |
+
<annotation cp="🦳">grey | hair | old | white</annotation>
|
| 347 |
+
<annotation cp="🪴">grow | house | nurturing | plant | potted plant</annotation>
|
| 348 |
+
<annotation cp="🫑">bell pepper | capsicum | pepper | sweet pepper | vegetable</annotation>
|
| 349 |
+
<annotation cp="🫑" type="tts">pepper</annotation>
|
| 350 |
+
<annotation cp="🥬">bok choy | cabbage | kale | leafy green | lettuce | pak choi</annotation>
|
| 351 |
+
<annotation cp="🧄">flavouring | garlic</annotation>
|
| 352 |
+
<annotation cp="🧅">flavouring | onion</annotation>
|
| 353 |
+
<annotation cp="🧇">breakfast | iron | unclear | vague | waffle</annotation>
|
| 354 |
+
<annotation cp="🥩">chop | cut of meat | lamb chop | pork chop | steak</annotation>
|
| 355 |
+
<annotation cp="🍥">cake | fish | fish cake with swirl | narutomaki | pastry | swirl</annotation>
|
| 356 |
+
<annotation cp="🥡">oyster pail | takeaway box | takeout box</annotation>
|
| 357 |
+
<annotation cp="🍶">bar | beverage | bottle | cup | drink | sake | saké</annotation>
|
| 358 |
+
<annotation cp="🧉">drink | maté</annotation>
|
| 359 |
+
<annotation cp="🧉" type="tts">maté</annotation>
|
| 360 |
+
<annotation cp="🏺">amphora | Aquarius | drink | jar | jug | zodiac</annotation>
|
| 361 |
+
<annotation cp="🗻">Fuji | Mount Fuji | mountain</annotation>
|
| 362 |
+
<annotation cp="🗻" type="tts">Mount Fuji</annotation>
|
| 363 |
+
<annotation cp="🏛">classical | classical building | column</annotation>
|
| 364 |
+
<annotation cp="🕌">Islam | mosque | Muslim | religion</annotation>
|
| 365 |
+
<annotation cp="🛕">Hindu | temple</annotation>
|
| 366 |
+
<annotation cp="🛕" type="tts">Hindu temple</annotation>
|
| 367 |
+
<annotation cp="🕋">Islam | Kaaba | Muslim | religion</annotation>
|
| 368 |
+
<annotation cp="🕋" type="tts">Kaaba</annotation>
|
| 369 |
+
<annotation cp="🚃">car | electric | railway | railway carriage | train | tram | trolleybus</annotation>
|
| 370 |
+
<annotation cp="🚙">4x4 | off-road vehicle | sport utility | sport utility vehicle</annotation>
|
| 371 |
+
<annotation cp="🦼">accessibility | powered wheelchair</annotation>
|
| 372 |
+
<annotation cp="🦼" type="tts">powered wheelchair</annotation>
|
| 373 |
+
<annotation cp="🛺">auto rickshaw | tuk tuk | tuk-tuk</annotation>
|
| 374 |
+
<annotation cp="🛞">circle | turn | tyre | wheel</annotation>
|
| 375 |
+
<annotation cp="🛟">float | life preserver | life saver | lifebuoy | rescue | ring buoy | safety</annotation>
|
| 376 |
+
<annotation cp="🛟" type="tts">lifebuoy</annotation>
|
| 377 |
+
<annotation cp="🛫">aeroplane | airplane | check-in | departure | take-off</annotation>
|
| 378 |
+
<annotation cp="🪂">hang-glide | parachute | parasail | parascend | skydive</annotation>
|
| 379 |
+
<annotation cp="🕧">12:30 | 12.30 | clock | half past twelve | twelve-thirty</annotation>
|
| 380 |
+
<annotation cp="🕜">1:30 | 1.30 | clock | half past one | one-thirty</annotation>
|
| 381 |
+
<annotation cp="🕝">2:30 | 2.30 | clock | half past two | two-thirty</annotation>
|
| 382 |
+
<annotation cp="🕞">3:30 | 3.30 | clock | half past three | three-thirty</annotation>
|
| 383 |
+
<annotation cp="🕟">4:30 | 4.30 | clock | four-thirty | half past four</annotation>
|
| 384 |
+
<annotation cp="🕠">5:30 | 5.30 | clock | five-thirty | half past five</annotation>
|
| 385 |
+
<annotation cp="🕡">6:30 | 6.30 | clock | half past six | six-thirty</annotation>
|
| 386 |
+
<annotation cp="🕢">7:30 | 7.30 | clock | half past seven | seven-thirty</annotation>
|
| 387 |
+
<annotation cp="🕣">8:30 | 8.30 | clock | eight-thirty | half past eight</annotation>
|
| 388 |
+
<annotation cp="🕤">9:30 | 9.30 | clock | half past nine | nine-thirty</annotation>
|
| 389 |
+
<annotation cp="🕥">10:30 | 10.30 | clock | half past ten | ten-thirty</annotation>
|
| 390 |
+
<annotation cp="🕦">11:30 | 11.30 | clock | eleven-thirty | half past eleven</annotation>
|
| 391 |
+
<annotation cp="🎏">carp | carp wind sock | celebration | Japanese wind socks | koinobori | streamer</annotation>
|
| 392 |
+
<annotation cp="🪆">babushka | doll | matryoshka | nesting dolls | russia | Russian dolls</annotation>
|
| 393 |
+
<annotation cp="🪆" type="tts">Russian dolls</annotation>
|
| 394 |
+
<annotation cp="🦺">emergency | hi-vis | high-vis | jacket | life jacket | safety | vest</annotation>
|
| 395 |
+
<annotation cp="👔" type="tts">tie</annotation>
|
| 396 |
+
<annotation cp="🩱">bathing suit | one-piece swimsuit | swimming costume</annotation>
|
| 397 |
+
<annotation cp="🩲">bathing suit | briefs | one-piece | pants | swimsuit | underwear</annotation>
|
| 398 |
+
<annotation cp="🩳">bathing suit | boardshorts | shorts | swim shorts | underwear</annotation>
|
| 399 |
+
<annotation cp="🩴">beach sandals | flip-flop | flipflop | sandals | thong sandals | thongs | zori</annotation>
|
| 400 |
+
<annotation cp="🩴" type="tts">flip-flop</annotation>
|
| 401 |
+
<annotation cp="🥿">ballet flat | flat shoe | pump | slip-on | slipper</annotation>
|
| 402 |
+
<annotation cp="📯" type="tts">post horn</annotation>
|
| 403 |
+
<annotation cp="🪘" type="tts">conga drum</annotation>
|
| 404 |
+
<annotation cp="💷">banknote | bill | currency | money | note | pound | sterling</annotation>
|
| 405 |
+
<annotation cp="📫">closed postbox with raised flag | letterbox | mail | mailbox | post | post box | postbox</annotation>
|
| 406 |
+
<annotation cp="📪">closed postbox with lowered flag | letterbox | lowered | mail | mailbox | post box | postbox</annotation>
|
| 407 |
+
<annotation cp="📬">mail | mailbox | open postbox with raised flag | post | post box | postbox</annotation>
|
| 408 |
+
<annotation cp="📭">lowered | mail | mailbox | open postbox with lowered flag | post | post box | postbox</annotation>
|
| 409 |
+
<annotation cp="🔒">closed | locked | padlock</annotation>
|
| 410 |
+
<annotation cp="🔓">lock | open | padlock | unlock | unlocked</annotation>
|
| 411 |
+
<annotation cp="🦯">accessibility | blind | guide cane</annotation>
|
| 412 |
+
<annotation cp="🦯" type="tts">guide cane</annotation>
|
| 413 |
+
<annotation cp="💉">ill | injection | medicine | needle | syringe</annotation>
|
| 414 |
+
<annotation cp="🩹">injury | plaster | sticking plaster</annotation>
|
| 415 |
+
<annotation cp="🩹" type="tts">plaster</annotation>
|
| 416 |
+
<annotation cp="🛗" type="tts">lift</annotation>
|
| 417 |
+
<annotation cp="🛁" type="tts">bath</annotation>
|
| 418 |
+
<annotation cp="🪤" type="tts">mousetrap</annotation>
|
| 419 |
+
<annotation cp="🪒">cut-throat | razor | sharp | shave</annotation>
|
| 420 |
+
<annotation cp="🧴">lotion | lotion bottle | moisturiser | shampoo | sunscreen</annotation>
|
| 421 |
+
<annotation cp="🧷">nappy | punk rock | safety pin</annotation>
|
| 422 |
+
<annotation cp="🧻">paper towels | roll of paper | toilet paper | toilet roll</annotation>
|
| 423 |
+
<annotation cp="🪪">credentials | driving | ID | identification card | licence | security</annotation>
|
| 424 |
+
<annotation cp="🚾">closet | lavatory | restroom | toilet | water | wc</annotation>
|
| 425 |
+
<annotation cp="↮">left-right arrow with stroke</annotation>
|
| 426 |
+
<annotation cp="↮" type="tts">left-right arrow with stroke</annotation>
|
| 427 |
+
<annotation cp="🔄">anticlockwise | anticlockwise arrows button | arrow | counterclockwise | counterclockwise arrows button | withershins</annotation>
|
| 428 |
+
<annotation cp="✡">David | Jewish | Judaism | religion | star | Star of David</annotation>
|
| 429 |
+
<annotation cp="✡" type="tts">Star of David</annotation>
|
| 430 |
+
<annotation cp="✝">Christian | cross | Latin cross | religion</annotation>
|
| 431 |
+
<annotation cp="✝" type="tts">Latin cross</annotation>
|
| 432 |
+
<annotation cp="☦">Christian | cross | Orthodox cross | religion</annotation>
|
| 433 |
+
<annotation cp="☦" type="tts">Orthodox cross</annotation>
|
| 434 |
+
<annotation cp="☪">Islam | Muslim | religion | star and crescent</annotation>
|
| 435 |
+
<annotation cp="⚧">trans | transgender | transgender symbol</annotation>
|
| 436 |
+
<annotation cp="✖">× | cancel | heavy multiplication sign | multiplication | multiply | sign | x</annotation>
|
| 437 |
+
<annotation cp="➕">+ | math | maths | plus | sign</annotation>
|
| 438 |
+
<annotation cp="➖">- | − | heavy minus sign | math | maths | minus | sign</annotation>
|
| 439 |
+
<annotation cp="🟰">equality | heavy equals sign | math | maths</annotation>
|
| 440 |
+
<annotation cp="⁉">! | !? | ? | exclamation question mark | interrobang | mark | punctuation | question</annotation>
|
| 441 |
+
<annotation cp="✅">✓ | button | mark | tick</annotation>
|
| 442 |
+
<annotation cp="✅" type="tts">tick button</annotation>
|
| 443 |
+
<annotation cp="☑">✓ | box | tick | tick box with tick</annotation>
|
| 444 |
+
<annotation cp="☑" type="tts">tick box with tick</annotation>
|
| 445 |
+
<annotation cp="✔">✓ | mark | tick</annotation>
|
| 446 |
+
<annotation cp="✔" type="tts">tick</annotation>
|
| 447 |
+
<annotation cp="®">r | registered | trademark</annotation>
|
| 448 |
+
<annotation cp="🚩">post | red flag | triangular flag</annotation>
|
| 449 |
+
<annotation cp="🏳">surrender | waving | white flag</annotation>
|
| 450 |
+
<annotation cp="🏳⚧">flag | light blue | pink | trans | transgender | white</annotation>
|
| 451 |
+
<annotation cp="£">currency | EGP | GBP | pound | quid | sterling</annotation>
|
| 452 |
+
<annotation cp="₢">Brazil | BRB | cruzeiro | currency</annotation>
|
| 453 |
+
<annotation cp="₣">currency | franc | France | French franc</annotation>
|
| 454 |
+
<annotation cp="₣" type="tts">French franc</annotation>
|
| 455 |
+
<annotation cp="₤">currency | Italy | lira</annotation>
|
| 456 |
+
<annotation cp="₰">currency | German penny | pfennig</annotation>
|
| 457 |
+
<annotation cp="₰" type="tts">German penny</annotation>
|
| 458 |
+
<annotation cp="₳">ARA | Argentina | austral | currency</annotation>
|
| 459 |
+
<annotation cp="₶">currency | France | livre tournois</annotation>
|
| 460 |
+
<annotation cp="₹">currency | Indian rupee | rupee</annotation>
|
| 461 |
+
<annotation cp="₹" type="tts">Indian rupee</annotation>
|
| 462 |
+
<annotation cp="₽">currency | rouble | ruble</annotation>
|
| 463 |
+
<annotation cp="₽" type="tts">rouble</annotation>
|
| 464 |
+
<annotation cp="µ">measure | micro sign | mu</annotation>
|
| 465 |
+
</annotations>
|
| 466 |
+
</ldml>
|
SPFsmartGATE/LIVE/TMP/babel/cldr/cldr-common-45.0/common/annotations/en_AU.xml
ADDED
|
@@ -0,0 +1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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
| 2 |
+
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
|
| 3 |
+
<!-- Copyright © 1991-2024 Unicode, Inc.
|
| 4 |
+
For terms of use, see http://www.unicode.org/copyright.html
|
| 5 |
+
SPDX-License-Identifier: Unicode-3.0
|
| 6 |
+
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
| 7 |
+
-->
|
| 8 |
+
<ldml>
|
| 9 |
+
<identity>
|
| 10 |
+
<version number="$Revision$"/>
|
| 11 |
+
<language type="en"/>
|
| 12 |
+
<territory type="AU"/>
|
| 13 |
+
</identity>
|
| 14 |
+
<annotations>
|
| 15 |
+
<annotation cp="≤">inequality | less-than | less-than or equal</annotation>
|
| 16 |
+
<annotation cp="≥">greater-than | greater-than or equal | inequality</annotation>
|
| 17 |
+
<annotation cp="⋭">does not contain as normal subgroup | does not contain as normal subgroup or equal | group theory | mathematics</annotation>
|
| 18 |
+
<annotation cp="🤭">face with hand over mouth | whoops</annotation>
|
| 19 |
+
<annotation cp="🤫">quiet | shooshing face | shush | shushing face</annotation>
|
| 20 |
+
<annotation cp="🤫" type="tts">shooshing face</annotation>
|
| 21 |
+
<annotation cp="🥵">feverish | flushed | heat stroke | hot | hot face | red-faced | sweating</annotation>
|
| 22 |
+
<annotation cp="😱">face | face screaming in fear | fear | Munch | scared | scream</annotation>
|
| 23 |
+
<annotation cp="😈">devil | face | fantasy | horns | smile | smiling face with horns</annotation>
|
| 24 |
+
<annotation cp="🖖">finger | hand | spock | vulcan | Vulcan salute</annotation>
|
| 25 |
+
<annotation cp="🖖" type="tts">Vulcan salute</annotation>
|
| 26 |
+
<annotation cp="🤙">call | call me hand | call-me hand | hand | shaka</annotation>
|
| 27 |
+
<annotation cp="🙌">celebration | gesture | hand | hooray | raised | raising hands</annotation>
|
| 28 |
+
<annotation cp="👦">boy | young | young person</annotation>
|
| 29 |
+
<annotation cp="👧">girl | Virgo | young person | zodiac</annotation>
|
| 30 |
+
<annotation cp="🧑🔧">electrician | mechanic | plumber | tradesperson | tradie</annotation>
|
| 31 |
+
<annotation cp="👨💼">business man | man office worker | manager | office worker | white collar</annotation>
|
| 32 |
+
<annotation cp="👩💼">business woman | manager | office worker | white collar | woman office worker</annotation>
|
| 33 |
+
<annotation cp="👨🎨">artist | man | painter | palette</annotation>
|
| 34 |
+
<annotation cp="👩🎨">artist | painter | palette | woman</annotation>
|
| 35 |
+
<annotation cp="👨🚒">fire truck | firefighter | man</annotation>
|
| 36 |
+
<annotation cp="👩🚒">fire truck | firefighter | woman</annotation>
|
| 37 |
+
<annotation cp="🕵">detective | investigator | sleuth | spy</annotation>
|
| 38 |
+
<annotation cp="🕵♂">detective | investigator | man | sleuth | spy</annotation>
|
| 39 |
+
<annotation cp="🕵♀">detective | investigator | sleuth | spy | woman</annotation>
|
| 40 |
+
<annotation cp="🤵♂">man | man in tux | man in tuxedo | tux | tuxedo</annotation>
|
| 41 |
+
<annotation cp="👰♀">bride | veil | woman | woman with veil</annotation>
|
| 42 |
+
<annotation cp="🎅">celebration | Christmas | Father Christmas | Santa | Santa Claus</annotation>
|
| 43 |
+
<annotation cp="🎅" type="tts">Santa</annotation>
|
| 44 |
+
<annotation cp="🤶">celebration | Christmas | Mrs Claus | Mrs Santa Claus | Mrs. Claus</annotation>
|
| 45 |
+
<annotation cp="💇♂">haircut | hairdresser | man | man getting haircut</annotation>
|
| 46 |
+
<annotation cp="💇♀">haircut | hairdresser | woman | woman getting haircut</annotation>
|
| 47 |
+
<annotation cp="🧑🦯">accessibility | blind | person with guide cane | person with long mobility cane</annotation>
|
| 48 |
+
<annotation cp="🧑🦯" type="tts">person with long mobility cane</annotation>
|
| 49 |
+
<annotation cp="🧑🦼">accessibility | electric wheelchair | person in motorised wheelchair | wheelchair</annotation>
|
| 50 |
+
<annotation cp="🧑🦼" type="tts">person in motorised wheelchair</annotation>
|
| 51 |
+
<annotation cp="👨🦼">accessibility | electric wheelchair | man | man in motorised wheelchair | wheelchair</annotation>
|
| 52 |
+
<annotation cp="👨🦼" type="tts">man in motorised wheelchair</annotation>
|
| 53 |
+
<annotation cp="👩🦼">accessibility | electric wheelchair | wheelchair | woman | woman in motorised wheelchair</annotation>
|
| 54 |
+
<annotation cp="👩🦼" type="tts">woman in motorised wheelchair</annotation>
|
| 55 |
+
<annotation cp="🧖♂">man in steam room | man in steamy room | sauna | steam room</annotation>
|
| 56 |
+
<annotation cp="🧖♂" type="tts">man in steam room</annotation>
|
| 57 |
+
<annotation cp="🧖♀">sauna | steam room | woman in steam room | woman in steamy room</annotation>
|
| 58 |
+
<annotation cp="🧖♀" type="tts">woman in steam room</annotation>
|
| 59 |
+
<annotation cp="🏌">ball | golf | golfer | person golfing</annotation>
|
| 60 |
+
<annotation cp="🏌♂">golf | golfer | man | man golfing</annotation>
|
| 61 |
+
<annotation cp="🏌♀">golf | golfer | woman | woman golfing</annotation>
|
| 62 |
+
<annotation cp="🏄">person surfing | surfer | surfing</annotation>
|
| 63 |
+
<annotation cp="🏄♂">man | surfer | surfing</annotation>
|
| 64 |
+
<annotation cp="🏄♀">surfer | surfing | woman</annotation>
|
| 65 |
+
<annotation cp="🚣">boat | person | person rowing boat | rowboat</annotation>
|
| 66 |
+
<annotation cp="🏊">person swimming | swim | swimmer</annotation>
|
| 67 |
+
<annotation cp="🏊♂">man | man swimming | swim | swimmer</annotation>
|
| 68 |
+
<annotation cp="🏊♀">swim | swimmer | woman | woman swimming</annotation>
|
| 69 |
+
<annotation cp="🚴">bicycle | biking | cyclist | person biking | person riding a bike</annotation>
|
| 70 |
+
<annotation cp="🚴" type="tts">person riding a bike</annotation>
|
| 71 |
+
<annotation cp="🚴♂">bicycle | cycling | cyclist | man | man riding a bike</annotation>
|
| 72 |
+
<annotation cp="🚴♂" type="tts">man riding a bike</annotation>
|
| 73 |
+
<annotation cp="🚴♀">bicycle | cycling | cyclist | woman | woman riding a bike</annotation>
|
| 74 |
+
<annotation cp="🚴♀" type="tts">woman riding a bike</annotation>
|
| 75 |
+
<annotation cp="🤹">balance | juggle | multi-task | person juggling | skill</annotation>
|
| 76 |
+
<annotation cp="🤹♂">juggling | man | multi-task</annotation>
|
| 77 |
+
<annotation cp="🤹♀">juggling | multi-task | woman</annotation>
|
| 78 |
+
<annotation cp="🛀">bath | bathtub | person taking bath | tub</annotation>
|
| 79 |
+
<annotation cp="🛌">hotel | person in bed | sleep | sleeping</annotation>
|
| 80 |
+
<annotation cp="🦌">deer | stag</annotation>
|
| 81 |
+
<annotation cp="🦏">rhino | rhinoceros</annotation>
|
| 82 |
+
<annotation cp="🐭">face | mouse | pet</annotation>
|
| 83 |
+
<annotation cp="🐁">mouse | pet | rodent</annotation>
|
| 84 |
+
<annotation cp="🐀">pet | rat | rodent</annotation>
|
| 85 |
+
<annotation cp="🐨">koala | marsupial</annotation>
|
| 86 |
+
<annotation cp="🦃">bird | poultry | turkey</annotation>
|
| 87 |
+
<annotation cp="🐔">bird | chicken | poultry</annotation>
|
| 88 |
+
<annotation cp="🦅">bird of prey | eagle</annotation>
|
| 89 |
+
<annotation cp="🦉">bird of prey | owl | wise</annotation>
|
| 90 |
+
<annotation cp="🐬">dolphin | porpoise</annotation>
|
| 91 |
+
<annotation cp="🐠">fish | reef fish | tropical</annotation>
|
| 92 |
+
<annotation cp="🐠" type="tts">reef fish</annotation>
|
| 93 |
+
<annotation cp="🐌">mollusc | snail</annotation>
|
| 94 |
+
<annotation cp="🦋">butterfly | insect | moth</annotation>
|
| 95 |
+
<annotation cp="🐛">bug | caterpillar | insect | worm</annotation>
|
| 96 |
+
<annotation cp="🐛" type="tts">caterpillar</annotation>
|
| 97 |
+
<annotation cp="🕷">arachnid | spider</annotation>
|
| 98 |
+
<annotation cp="🦟">dengue | fever | insect | malaria | mosquito | mozzie | virus</annotation>
|
| 99 |
+
<annotation cp="🪴">grow | house | nurturing | plant | pot plant</annotation>
|
| 100 |
+
<annotation cp="🪴" type="tts">pot plant</annotation>
|
| 101 |
+
<annotation cp="🍊">fruit | mandarin | orange</annotation>
|
| 102 |
+
<annotation cp="🍊" type="tts">mandarin</annotation>
|
| 103 |
+
<annotation cp="🥝">food | fruit | kiwi fruit</annotation>
|
| 104 |
+
<annotation cp="🌽">corn | corn on the cob | sweetcorn</annotation>
|
| 105 |
+
<annotation cp="🌽" type="tts">sweetcorn</annotation>
|
| 106 |
+
<annotation cp="🌶">chilli | hot pepper | pepper</annotation>
|
| 107 |
+
<annotation cp="🫑" type="tts">capsicum</annotation>
|
| 108 |
+
<annotation cp="🥬">bok choy | leafy green | pak choi</annotation>
|
| 109 |
+
<annotation cp="🥜">food | nut | nuts | peanut | peanuts</annotation>
|
| 110 |
+
<annotation cp="🫘">food | kidney bean | kidney beans | legume</annotation>
|
| 111 |
+
<annotation cp="🫘" type="tts">kidney beans</annotation>
|
| 112 |
+
<annotation cp="🫚">beer | ginger | root | spice</annotation>
|
| 113 |
+
<annotation cp="🫚" type="tts">ginger</annotation>
|
| 114 |
+
<annotation cp="🥖">baguette | bread | food | french | French stick</annotation>
|
| 115 |
+
<annotation cp="🥯">bagel | bakery</annotation>
|
| 116 |
+
<annotation cp="🧇">waffle | waffle with butter</annotation>
|
| 117 |
+
<annotation cp="🍔">beefburger | burger | hamburger</annotation>
|
| 118 |
+
<annotation cp="🍟">chips | french fries | fries</annotation>
|
| 119 |
+
<annotation cp="🥙">falafel | flatbread | food | gyro | kebab | pita roll | stuffed</annotation>
|
| 120 |
+
<annotation cp="🥙" type="tts">pita roll</annotation>
|
| 121 |
+
<annotation cp="🧆">chickpea | falafel</annotation>
|
| 122 |
+
<annotation cp="🥗">food | garden | salad</annotation>
|
| 123 |
+
<annotation cp="🥗" type="tts">garden salad</annotation>
|
| 124 |
+
<annotation cp="🍤">battered | fried | prawn | shrimp | tempura</annotation>
|
| 125 |
+
<annotation cp="🍤" type="tts">battered prawn</annotation>
|
| 126 |
+
<annotation cp="🥟">dumpling | empanada | gyōza | pastie | samosa</annotation>
|
| 127 |
+
<annotation cp="🥡">takeaway container | takeout</annotation>
|
| 128 |
+
<annotation cp="🥡" type="tts">takeaway container</annotation>
|
| 129 |
+
<annotation cp="🦀">crab | crustacean | seafood | shellfish</annotation>
|
| 130 |
+
<annotation cp="🦞">bisque | claws | lobster | seafood | shellfish</annotation>
|
| 131 |
+
<annotation cp="🦐">prawn | seafood | shellfish | shrimp</annotation>
|
| 132 |
+
<annotation cp="🦐" type="tts">prawn</annotation>
|
| 133 |
+
<annotation cp="🦑">decapod | seafood | squid</annotation>
|
| 134 |
+
<annotation cp="🍦">cream | dessert | ice cream | soft serve | sweet</annotation>
|
| 135 |
+
<annotation cp="🍦" type="tts">soft serve</annotation>
|
| 136 |
+
<annotation cp="🍧">dessert | granita | ice | sweet</annotation>
|
| 137 |
+
<annotation cp="🍧" type="tts">granita</annotation>
|
| 138 |
+
<annotation cp="🍨">cream | dessert | ice cream | sweet</annotation>
|
| 139 |
+
<annotation cp="🍪">biscuit | cookie | dessert | sweet</annotation>
|
| 140 |
+
<annotation cp="🍮">baked custard | dessert | pudding | sweet</annotation>
|
| 141 |
+
<annotation cp="🍮" type="tts">baked custard</annotation>
|
| 142 |
+
<annotation cp="🧃">drink carton | juice box | popper</annotation>
|
| 143 |
+
<annotation cp="🧃" type="tts">drink carton</annotation>
|
| 144 |
+
<annotation cp="🥢">chopsticks | pair of chopsticks</annotation>
|
| 145 |
+
<annotation cp="🗻">Fuji | mount Fuji | mountain</annotation>
|
| 146 |
+
<annotation cp="🗻" type="tts">mount Fuji</annotation>
|
| 147 |
+
<annotation cp="🏟">arena | stadium</annotation>
|
| 148 |
+
<annotation cp="⛩">religion | Shinto | shrine</annotation>
|
| 149 |
+
<annotation cp="⛩" type="tts">Shinto shrine</annotation>
|
| 150 |
+
<annotation cp="🎠">carousel | horse | merry-go-round</annotation>
|
| 151 |
+
<annotation cp="🎠" type="tts">merry-go-round</annotation>
|
| 152 |
+
<annotation cp="🎪">big top | circus</annotation>
|
| 153 |
+
<annotation cp="🎪" type="tts">big top</annotation>
|
| 154 |
+
<annotation cp="🚃">car | electric | railway | train | train carriage | tram | trolley bus</annotation>
|
| 155 |
+
<annotation cp="🚃" type="tts">train carriage</annotation>
|
| 156 |
+
<annotation cp="🚊">light rail | oncoming | oncoming light rail | tram | trolleybus</annotation>
|
| 157 |
+
<annotation cp="🚊" type="tts">oncoming light rail</annotation>
|
| 158 |
+
<annotation cp="🚋">car | tram | trolley bus</annotation>
|
| 159 |
+
<annotation cp="🚎">bus | tram | trolley</annotation>
|
| 160 |
+
<annotation cp="🚎" type="tts">trolley bus</annotation>
|
| 161 |
+
<annotation cp="🚒" type="tts">fire truck</annotation>
|
| 162 |
+
<annotation cp="🚙">4WD | four-wheel drive</annotation>
|
| 163 |
+
<annotation cp="🚙" type="tts">four-wheel drive</annotation>
|
| 164 |
+
<annotation cp="🛻">pick-up | pickup | truck | ute</annotation>
|
| 165 |
+
<annotation cp="🛻" type="tts">ute</annotation>
|
| 166 |
+
<annotation cp="🚛">articulated truck | lorry | semi | truck</annotation>
|
| 167 |
+
<annotation cp="🚛" type="tts">articulated truck</annotation>
|
| 168 |
+
<annotation cp="🦼">mobility scooter</annotation>
|
| 169 |
+
<annotation cp="🦼" type="tts">mobility scooter</annotation>
|
| 170 |
+
<annotation cp="🛴" type="tts">scooter</annotation>
|
| 171 |
+
<annotation cp="🛼">roller | rollerskate | skate</annotation>
|
| 172 |
+
<annotation cp="🛼" type="tts">rollerskate</annotation>
|
| 173 |
+
<annotation cp="🛣">freeway | highway | road</annotation>
|
| 174 |
+
<annotation cp="🛣" type="tts">freeway</annotation>
|
| 175 |
+
<annotation cp="⛽">diesel | fuel | gas | petrol pump | pump | station</annotation>
|
| 176 |
+
<annotation cp="⛽" type="tts">petrol pump</annotation>
|
| 177 |
+
<annotation cp="🚥">horizontal traffic lights | lights | signal | traffic</annotation>
|
| 178 |
+
<annotation cp="🚥" type="tts">horizontal traffic lights</annotation>
|
| 179 |
+
<annotation cp="🚦">lights | signal | traffic | vertical traffic lights</annotation>
|
| 180 |
+
<annotation cp="🚦" type="tts">vertical traffic lights</annotation>
|
| 181 |
+
<annotation cp="🛟">buoy | float | life preserver | lifebuoy | rescue | ring buoy | safety</annotation>
|
| 182 |
+
<annotation cp="🚟">cable | railway | suspension</annotation>
|
| 183 |
+
<annotation cp="🚟" type="tts">cable railway</annotation>
|
| 184 |
+
<annotation cp="🚠">cable | cableway | gondola | mountain</annotation>
|
| 185 |
+
<annotation cp="🚠" type="tts">cableway</annotation>
|
| 186 |
+
<annotation cp="🚡" type="tts">cable car</annotation>
|
| 187 |
+
<annotation cp="🛎">bell | hotel | porter</annotation>
|
| 188 |
+
<annotation cp="🛎" type="tts">porter bell</annotation>
|
| 189 |
+
<annotation cp="⌛">hourglass | hourglass done | sand | timer</annotation>
|
| 190 |
+
<annotation cp="⏲" type="tts">timer</annotation>
|
| 191 |
+
<annotation cp="🕰">clock</annotation>
|
| 192 |
+
<annotation cp="🕰" type="tts">clock</annotation>
|
| 193 |
+
<annotation cp="🌌">Milky Way | space</annotation>
|
| 194 |
+
<annotation cp="🌌" type="tts">Milky Way</annotation>
|
| 195 |
+
<annotation cp="⛱">beach | sand | sun | umbrella</annotation>
|
| 196 |
+
<annotation cp="⛱" type="tts">beach umbrella</annotation>
|
| 197 |
+
<annotation cp="🎉">celebration | party | popper | ta-da</annotation>
|
| 198 |
+
<annotation cp="🎍">bamboo | celebration | decoration | Japanese</annotation>
|
| 199 |
+
<annotation cp="🎍" type="tts">bamboo decoration</annotation>
|
| 200 |
+
<annotation cp="🎁" type="tts">gift</annotation>
|
| 201 |
+
<annotation cp="🎟">admission | admission tickets | entry | ticket</annotation>
|
| 202 |
+
<annotation cp="🏆">celebration | prize | trophy</annotation>
|
| 203 |
+
<annotation cp="🏅">celebration | medal | sports</annotation>
|
| 204 |
+
<annotation cp="🏉">australian football | rugby ball | rugby league | rugby union</annotation>
|
| 205 |
+
<annotation cp="🏉" type="tts">rugby ball</annotation>
|
| 206 |
+
<annotation cp="🥏">flying disc | frisbee | ultimate</annotation>
|
| 207 |
+
<annotation cp="🥏" type="tts">frisbee</annotation>
|
| 208 |
+
<annotation cp="🎳">ball | game | tenpin bowling</annotation>
|
| 209 |
+
<annotation cp="🎳" type="tts">tenpin bowling</annotation>
|
| 210 |
+
<annotation cp="🥅">goal | goal cage | net</annotation>
|
| 211 |
+
<annotation cp="🥅" type="tts">goal cage</annotation>
|
| 212 |
+
<annotation cp="⛳">flag | flag in hole | golf | hole</annotation>
|
| 213 |
+
<annotation cp="⛸">ice | ice skating | skate</annotation>
|
| 214 |
+
<annotation cp="🎣">fish | fishing | pole | rod</annotation>
|
| 215 |
+
<annotation cp="🎣" type="tts">fishing rod</annotation>
|
| 216 |
+
<annotation cp="🎿">ski | skiing | skis | snow</annotation>
|
| 217 |
+
<annotation cp="🥌">curling | game | rock | stone</annotation>
|
| 218 |
+
<annotation cp="🔫">toy | water pistol</annotation>
|
| 219 |
+
<annotation cp="🎰">game | pokie | pokies</annotation>
|
| 220 |
+
<annotation cp="🎰" type="tts">pokie</annotation>
|
| 221 |
+
<annotation cp="♦">card | diamond suit | diamonds | game</annotation>
|
| 222 |
+
<annotation cp="♣">card | club suit | clubs | game</annotation>
|
| 223 |
+
<annotation cp="🪡">embroidery | needle | needle and thread | sewing | stitches | sutures | tailoring</annotation>
|
| 224 |
+
<annotation cp="🪡" type="tts">needle and thread</annotation>
|
| 225 |
+
<annotation cp="🕶">dark | eye | eyewear | glasses | sunglasses | sunnies</annotation>
|
| 226 |
+
<annotation cp="👕">clothing | shirt | T-shirt | tee | tshirt</annotation>
|
| 227 |
+
<annotation cp="👗">clothing | dress | woman’s clothes</annotation>
|
| 228 |
+
<annotation cp="🩲">bathers | briefs | speedos | underwear</annotation>
|
| 229 |
+
<annotation cp="🩳">bathing suit | boardies | boardshorts | shorts | swim shorts | underwear</annotation>
|
| 230 |
+
<annotation cp="👙">bikini | clothing | swim suit | two-piece</annotation>
|
| 231 |
+
<annotation cp="👚">blouse | clothing | top | woman | woman’s clothes</annotation>
|
| 232 |
+
<annotation cp="👚" type="tts">blouse</annotation>
|
| 233 |
+
<annotation cp="👛">accessories | coin | purse</annotation>
|
| 234 |
+
<annotation cp="👜">accessories | bag | handbag | tote</annotation>
|
| 235 |
+
<annotation cp="👝">accessories | bag | clutch bag | pouch</annotation>
|
| 236 |
+
<annotation cp="👝" type="tts">pouch</annotation>
|
| 237 |
+
<annotation cp="🩴" type="tts">thongs</annotation>
|
| 238 |
+
<annotation cp="👟">athletic | clothing | runners | running shoe | shoe | sneaker | trainer</annotation>
|
| 239 |
+
<annotation cp="👟" type="tts">sneaker</annotation>
|
| 240 |
+
<annotation cp="👠">heel | high-heeled shoe | shoe | stiletto | woman</annotation>
|
| 241 |
+
<annotation cp="🧢" type="tts">baseball cap</annotation>
|
| 242 |
+
<annotation cp="💄">cosmetics | lipstick | make-up</annotation>
|
| 243 |
+
<annotation cp="🔈">low | quiet | soft | speaker | volume</annotation>
|
| 244 |
+
<annotation cp="📻">AM | FM | radio | wireless</annotation>
|
| 245 |
+
<annotation cp="🎹">instrument | keyboard | music | musical keyboard | organ | piano</annotation>
|
| 246 |
+
<annotation cp="🥁">drum | drumsticks | music | percussions</annotation>
|
| 247 |
+
<annotation cp="☎">landline | phone | telephone</annotation>
|
| 248 |
+
<annotation cp="💻">computer | laptop | PC | personal</annotation>
|
| 249 |
+
<annotation cp="💾">computer | disk | diskette | floppy</annotation>
|
| 250 |
+
<annotation cp="📀">blu-ray | computer | disk | DVD | optical</annotation>
|
| 251 |
+
<annotation cp="📀" type="tts">DVD</annotation>
|
| 252 |
+
<annotation cp="🎬">clapper | clapper board | clapperboard | film | movie</annotation>
|
| 253 |
+
<annotation cp="📺">television | TV | video</annotation>
|
| 254 |
+
<annotation cp="📼">tape | VHS | video | videocassette</annotation>
|
| 255 |
+
<annotation cp="💡">bulb | comic | electric | globe | idea | light</annotation>
|
| 256 |
+
<annotation cp="💡" type="tts">light globe</annotation>
|
| 257 |
+
<annotation cp="🏷">label | tag</annotation>
|
| 258 |
+
<annotation cp="💹">chart | chart increasing with yen | graph | graph increasing with yen | growth | money | yen</annotation>
|
| 259 |
+
<annotation cp="💹" type="tts">graph increasing with yen</annotation>
|
| 260 |
+
<annotation cp="📤">box | letter | mail | out tray | outbox | sent | tray</annotation>
|
| 261 |
+
<annotation cp="📤" type="tts">out tray</annotation>
|
| 262 |
+
<annotation cp="📥">box | in tray | inbox | letter | mail | receive | tray</annotation>
|
| 263 |
+
<annotation cp="📥" type="tts">in tray</annotation>
|
| 264 |
+
<annotation cp="📫">closed | closed letterbox with raised flag | mail | mailbox | postbox</annotation>
|
| 265 |
+
<annotation cp="📫" type="tts">closed letterbox with raised flag</annotation>
|
| 266 |
+
<annotation cp="📪">closed | closed letterbox with lowered flag | lowered | mail | mailbox | postbox</annotation>
|
| 267 |
+
<annotation cp="📪" type="tts">closed letterbox with lowered flag</annotation>
|
| 268 |
+
<annotation cp="📬">mail | mailbox | open | open letterbox with raised flag | postbox</annotation>
|
| 269 |
+
<annotation cp="📬" type="tts">open letterbox with raised flag</annotation>
|
| 270 |
+
<annotation cp="📭">lowered | mail | mailbox | open | open letterbox with lowered flag | postbox</annotation>
|
| 271 |
+
<annotation cp="📭" type="tts">open letterbox with lowered flag</annotation>
|
| 272 |
+
<annotation cp="🗂" type="tts">index card dividers</annotation>
|
| 273 |
+
<annotation cp="📇" type="tts">index card</annotation>
|
| 274 |
+
<annotation cp="📈">chart | chart increasing | graph | graph increasing | growth | trend | upward</annotation>
|
| 275 |
+
<annotation cp="📈" type="tts">graph increasing</annotation>
|
| 276 |
+
<annotation cp="📉">chart | chart decreasing | down | graph | graph decreasing | trend</annotation>
|
| 277 |
+
<annotation cp="📉" type="tts">graph decreasing</annotation>
|
| 278 |
+
<annotation cp="📊" type="tts">bar graph</annotation>
|
| 279 |
+
<annotation cp="📌">drawing-pin | pin</annotation>
|
| 280 |
+
<annotation cp="📌" type="tts">drawing-pin</annotation>
|
| 281 |
+
<annotation cp="📍">pin | pushpin | round drawing-pin</annotation>
|
| 282 |
+
<annotation cp="📍" type="tts">round drawing-pin</annotation>
|
| 283 |
+
<annotation cp="🗄" type="tts">filing cabinet</annotation>
|
| 284 |
+
<annotation cp="🗑">rubbish bin | trash | waste paper basket</annotation>
|
| 285 |
+
<annotation cp="🗑" type="tts">waste paper basket</annotation>
|
| 286 |
+
<annotation cp="🛠">hammer | hammer and spanner | hammer and wrench | spanner | tool | wrench</annotation>
|
| 287 |
+
<annotation cp="🦯">accessibility | blind | long mobility cane | white cane</annotation>
|
| 288 |
+
<annotation cp="🦯" type="tts">long mobility cane</annotation>
|
| 289 |
+
<annotation cp="🪝">catch | crook | curve | ensnare | fishing | hook | selling point</annotation>
|
| 290 |
+
<annotation cp="🧬">biologist | DNA | evolution | gene | genetics | life</annotation>
|
| 291 |
+
<annotation cp="🧬" type="tts">DNA</annotation>
|
| 292 |
+
<annotation cp="📡" type="tts">satellite dish</annotation>
|
| 293 |
+
<annotation cp="💊">capsule | doctor | medicine | pill | sick</annotation>
|
| 294 |
+
<annotation cp="🩹">adhesive bandage | bandage | bandaid | dressing</annotation>
|
| 295 |
+
<annotation cp="🩹" type="tts">bandaid</annotation>
|
| 296 |
+
<annotation cp="🪞">looking glass | mirror | reflection | reflector</annotation>
|
| 297 |
+
<annotation cp="🛋">couch | couch and lamp | hotel | lamp | sofa | sofa and lamp</annotation>
|
| 298 |
+
<annotation cp="🚽">facilities | loo | toilet | WC</annotation>
|
| 299 |
+
<annotation cp="🪤" type="tts">mouse trap</annotation>
|
| 300 |
+
<annotation cp="🛒" type="tts">shopping trolley</annotation>
|
| 301 |
+
<annotation cp="🧿">amulet | charm | evil-eye | nazar | talisman</annotation>
|
| 302 |
+
<annotation cp="🧿" type="tts">evil-eye amulet</annotation>
|
| 303 |
+
<annotation cp="♿">access | disabled access | wheelchair symbol</annotation>
|
| 304 |
+
<annotation cp="🚺">ladies room | lavatory | restroom | wc | woman | women’s room | women’s toilet</annotation>
|
| 305 |
+
<annotation cp="🚼">baby | baby symbol | change room | changing</annotation>
|
| 306 |
+
<annotation cp="🚾">amenities | bathroom | restroom | toilet | water closet | WC</annotation>
|
| 307 |
+
<annotation cp="🚾" type="tts">WC</annotation>
|
| 308 |
+
<annotation cp="🛂">border | control | passport | security</annotation>
|
| 309 |
+
<annotation cp="⛔">denied | entry | forbidden | no | prohibited | traffic</annotation>
|
| 310 |
+
<annotation cp="🚫">denied | entry | forbidden | no | prohibited</annotation>
|
| 311 |
+
<annotation cp="🚭">denied | forbidden | no | prohibited | smoking</annotation>
|
| 312 |
+
<annotation cp="🚯">denied | forbidden | litter | no | no littering | prohibited</annotation>
|
| 313 |
+
<annotation cp="🚱">non-drinkable water | non-drinking | non-potable | water</annotation>
|
| 314 |
+
<annotation cp="🚱" type="tts">non-drinkable water</annotation>
|
| 315 |
+
<annotation cp="🚷">denied | forbidden | no | no pedestrians | pedestrian | prohibited</annotation>
|
| 316 |
+
<annotation cp="⬆">arrow | cardinal | direction | north | up</annotation>
|
| 317 |
+
<annotation cp="✝">Christian | cross | religion</annotation>
|
| 318 |
+
<annotation cp="✝" type="tts">Christian cross</annotation>
|
| 319 |
+
<annotation cp="♍">virgin | Virgo | zodiac</annotation>
|
| 320 |
+
<annotation cp="♐">archer | centaur | Sagittarius | zodiac</annotation>
|
| 321 |
+
<annotation cp="♒">Aquarius | water bearer | zodiac</annotation>
|
| 322 |
+
<annotation cp="⏩">fast forward button</annotation>
|
| 323 |
+
<annotation cp="⏩" type="tts">fast forward button</annotation>
|
| 324 |
+
<annotation cp="🔆">bright button | brightness | brightness button</annotation>
|
| 325 |
+
<annotation cp="🛜">computer | internet | network | Wi-Fi | wifi | wireless</annotation>
|
| 326 |
+
<annotation cp="➕">+ | add | addition | math | maths | plus | sign</annotation>
|
| 327 |
+
<annotation cp="➖">- | – | math | maths | minus | sign | subtraction</annotation>
|
| 328 |
+
<annotation cp="🟰">equality | heavy equals sign | maths</annotation>
|
| 329 |
+
<annotation cp="♾">eternal | forever | infinity | unbound | universal</annotation>
|
| 330 |
+
<annotation cp="‼">double exclamation mark | exclamation | mark | punctuation</annotation>
|
| 331 |
+
<annotation cp="⁉">exclamation | mark | punctuation | question</annotation>
|
| 332 |
+
<annotation cp="☑">ballot | box | check box with check | tick | tick box with tick</annotation>
|
| 333 |
+
<annotation cp="✔">check mark | heavy tick mark | mark | tick</annotation>
|
| 334 |
+
<annotation cp="🔠">input Latin uppercase</annotation>
|
| 335 |
+
<annotation cp="🔠" type="tts">input Latin uppercase</annotation>
|
| 336 |
+
<annotation cp="🔡">input Latin lowercase</annotation>
|
| 337 |
+
<annotation cp="🔡" type="tts">input Latin lowercase</annotation>
|
| 338 |
+
<annotation cp="🔤">input Latin letters</annotation>
|
| 339 |
+
<annotation cp="🔤" type="tts">input Latin letters</annotation>
|
| 340 |
+
<annotation cp="🅿">car park | carpark | P | P button | parking</annotation>
|
| 341 |
+
<annotation cp="$">AUD | dollar | money</annotation>
|
| 342 |
+
<annotation cp="₹">currency | Indian rupee | INR | rupee</annotation>
|
| 343 |
+
</annotations>
|
| 344 |
+
</ldml>
|