summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-01-11 12:57:12 +0200
committerAarni Koskela <akx@iki.fi>2023-01-11 13:02:44 +0200
commit58f9a2ad3c10661f8164520249ad4ae339b31b91 (patch)
tree19d0e3a423ce043cf66a88c6b18f5bf825372f1a
parentc779dcc8a22af838161d4bb28fd0d9bb928942a3 (diff)
downloadbabel-pre-commit-2.tar.gz
Apply spelling corrections suggested by codespellpre-commit-2
-rw-r--r--CHANGES.rst4
-rw-r--r--babel/core.py4
-rw-r--r--babel/dates.py2
-rw-r--r--babel/localedata.py2
-rw-r--r--babel/messages/checkers.py2
-rw-r--r--babel/messages/extract.py6
-rw-r--r--babel/numbers.py4
-rw-r--r--babel/plural.py2
-rw-r--r--babel/support.py2
-rw-r--r--tests/test_numbers.py2
10 files changed, 15 insertions, 15 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index bee5c3f..a146e8f 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -613,7 +613,7 @@ Version 1.0
- Explicitly sort instead of using sorted() and don't assume ordering
(Jython compatibility).
- Removed ValueError raising for string formatting message checkers if the
- string does not contain any string formattings (:trac:`150`).
+ string does not contain any string formatting (:trac:`150`).
- Fix Serbian plural forms (:trac:`213`).
- Small speed improvement in format_date() (:trac:`216`).
- Fix so frontend.CommandLineInterface.run does not accumulate logging
@@ -690,7 +690,7 @@ Version 0.9.6
- Explicitly sort instead of using sorted() and don't assume ordering
(Python 2.3 and Jython compatibility).
- Removed ValueError raising for string formatting message checkers if the
- string does not contain any string formattings (:trac:`150`).
+ string does not contain any string formatting (:trac:`150`).
- Fix Serbian plural forms (:trac:`213`).
- Small speed improvement in format_date() (:trac:`216`).
- Fix number formatting for locales where CLDR specifies alt or draft
diff --git a/babel/core.py b/babel/core.py
index 08feca5..2db4d04 100644
--- a/babel/core.py
+++ b/babel/core.py
@@ -240,13 +240,13 @@ class Locale:
>>> Locale.negotiate(['de_DE', 'de'], ['en_US'])
You can specify the character used in the locale identifiers to separate
- the differnet components. This separator is applied to both lists. Also,
+ the different components. This separator is applied to both lists. Also,
case is ignored in the comparison:
>>> Locale.negotiate(['de-DE', 'de'], ['en-us', 'de-de'], sep='-')
Locale('de', territory='DE')
- :param preferred: the list of locale identifers preferred by the user
+ :param preferred: the list of locale identifiers preferred by the user
:param available: the list of locale identifiers available
:param aliases: a dictionary of aliases for locale identifiers
"""
diff --git a/babel/dates.py b/babel/dates.py
index 7ebdc21..3dc859f 100644
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -1687,7 +1687,7 @@ class DateTimeFormat:
:param day_of_period: the number of the day in the period (usually
either the day of month or the day of year)
- :param day_of_week: the week day; if ommitted, the week day of the
+ :param day_of_week: the week day; if omitted, the week day of the
current date is assumed
"""
if day_of_week is None:
diff --git a/babel/localedata.py b/babel/localedata.py
index 0d3508d..c14391a 100644
--- a/babel/localedata.py
+++ b/babel/localedata.py
@@ -121,7 +121,7 @@ def load(name: os.PathLike[str] | str, merge_inherited: bool = True) -> dict[str
:param merge_inherited: whether the inherited data should be merged into
the data of the requested locale
:raise `IOError`: if no locale data file is found for the given locale
- identifer, or one of the locales it inherits from
+ identifier, or one of the locales it inherits from
"""
name = os.path.basename(name)
_cache_lock.acquire()
diff --git a/babel/messages/checkers.py b/babel/messages/checkers.py
index 472b72b..38a26e8 100644
--- a/babel/messages/checkers.py
+++ b/babel/messages/checkers.py
@@ -66,7 +66,7 @@ def _validate_format(format: str, alternative: str) -> None:
placeholders if `format` uses named placeholders.
The behavior of this function is undefined if the string does not use
- string formattings.
+ string formatting.
If the string formatting of `alternative` is compatible to `format` the
function returns `None`, otherwise a `TranslationError` is raised.
diff --git a/babel/messages/extract.py b/babel/messages/extract.py
index ed50001..453742e 100644
--- a/babel/messages/extract.py
+++ b/babel/messages/extract.py
@@ -544,8 +544,8 @@ def extract_python(
messages = tuple(messages)
else:
messages = messages[0]
- # Comments don't apply unless they immediately preceed the
- # message
+ # Comments don't apply unless they immediately
+ # precede the message
if translator_comments and \
translator_comments[-1][0] < message_lineno - 1:
translator_comments = []
@@ -679,7 +679,7 @@ def extract_javascript(
break
elif token.type == 'multilinecomment':
- # only one multi-line comment may preceed a translation
+ # only one multi-line comment may precede a translation
translator_comments = []
value = token.value[2:-2].strip()
for comment_tag in comment_tags:
diff --git a/babel/numbers.py b/babel/numbers.py
index 5cd563f..8e999ba 100644
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -94,7 +94,7 @@ def is_currency(currency: str, locale: Locale | str | None = None) -> bool:
def normalize_currency(currency: str, locale: Locale | str | None = None) -> str | None:
- """Returns the normalized sting of any currency code.
+ """Returns the normalized identifier of any currency code.
Accepts a ``locale`` parameter for fined-grained validation, working as
the one defined above in ``list_currencies()`` method.
@@ -1204,7 +1204,7 @@ class NumberPattern:
self._format_int(
str(exp), self.exp_prec[0], self.exp_prec[1], locale)])
- # Is it a siginificant digits pattern?
+ # Is it a significant digits pattern?
elif '@' in self.pattern:
text = self._format_significant(value,
self.int_prec[0],
diff --git a/babel/plural.py b/babel/plural.py
index 43801f4..8a592a0 100644
--- a/babel/plural.py
+++ b/babel/plural.py
@@ -427,7 +427,7 @@ class _Parser:
'n in 3,5,7..15'.
- Samples are ignored.
- The translator parses the expression on instanciation into an attribute
+ The translator parses the expression on instantiation into an attribute
called `ast`.
"""
diff --git a/babel/support.py b/babel/support.py
index 696bf1f..582c6bd 100644
--- a/babel/support.py
+++ b/babel/support.py
@@ -422,7 +422,7 @@ class NullTranslations(gettext.NullTranslations):
# backward compatibility with 0.9
dungettext = udngettext
- # Most of the downwards code, until it get's included in stdlib, from:
+ # Most of the downwards code, until it gets included in stdlib, from:
# https://bugs.python.org/file10036/gettext-pgettext.patch
#
# The encoding of a msgctxt and a msgid in a .mo file is
diff --git a/tests/test_numbers.py b/tests/test_numbers.py
index cdd409f..04a1865 100644
--- a/tests/test_numbers.py
+++ b/tests/test_numbers.py
@@ -35,7 +35,7 @@ class FormatDecimalTestCase(unittest.TestCase):
assert numbers.format_decimal(12345, '##0', locale='en_US') == '12345'
assert numbers.format_decimal(6.5, '0.00', locale='sv') == '6,50'
assert numbers.format_decimal((10.0 ** 20), '#.00', locale='en_US') == '100000000000000000000.00'
- # regression test for #183, fraction digits were not correctly cutted
+ # regression test for #183, fraction digits were not correctly cut
# if the input was a float value and the value had more than 7
# significant digits
assert numbers.format_decimal(12345678.051, '#,##0.00', locale='en_US') == '12,345,678.05'