Skip to content

Commit

Permalink
Merge pull request #354 from Pylons/localizations
Browse files Browse the repository at this point in the history
update localization files
  • Loading branch information
mmerickel authored Jan 3, 2023
2 parents 91400b1 + dd5ba48 commit b2f0ce3
Show file tree
Hide file tree
Showing 25 changed files with 1,419 additions and 736 deletions.
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ ignore =
W503
# W504: line break after binary operator (flake8 is not PEP8 compliant)
W504
exclude =
colander/compat.py
show-source = True
max-line-length = 79
9 changes: 7 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
unreleased
==========
2.0 (2022-01-02)
================

- Drop support for Python 2.7, 3.4, 3.5, 3.6.

Expand Down Expand Up @@ -32,6 +32,11 @@ unreleased
Added many new test cases for ``MappingSchema`` and ``SequenceSchema``.
See https://github.com/Pylons/colander/pull/264

- Remove the dependency on ``setuptools`` for resolving pkg_resources-style
importable paths in ``colander.GlobalObject``.

- Refresh localization files with Babel 2.11.

1.8.3 (2020-11-28)
==================

Expand Down
12 changes: 10 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,24 @@ To run everything configured in the `tox.ini` file:

$ tox

To run tests on Python 2 and 3, and ensure full coverage, but exclude building of docs:
To run tests and ensure full coverage, but exclude building of docs:

$ tox -e py2-cover,py3-cover,coverage
$ tox -e py311,coverage

To build the docs only:

$ tox -e docs

See the `tox.ini` file for details.

Updating localizations
----------------------

Extract new messages:

$ PY=.tox/py311/bin/python
$ "$PY" setup.py extract_messages
$ find src/colander/locale -type d -depth 1 -exec basename {} \; | xargs -n 1 "$PY" setup.py update_catalog -l

Contributing documentation
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 41", "wheel"]
requires = ["setuptools >= 41", "wheel", "babel"]
build-backend = "setuptools.build_meta"

[tool.black]
Expand Down
23 changes: 13 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[metadata]
name = colander
version = 1.8.3
version = 2.0
description = A simple schema-based serialization and deserialization library
long_description = file: README.rst, CHANGES.txt
long_description = file: README.rst, CHANGES.rst
long_description_content_type = text/x-rst
keywords = serialize deserialize validate schema validation
license = BSD-derived (http://www.repoze.org/LICENSE.txt)
license_file = LICENSE.txt
license_files =
LICENSE.txt
classifiers =
Development Status :: 6 - Mature
Intended Audience :: Developers
Expand Down Expand Up @@ -40,7 +41,6 @@ python_requires = >=3.7
install_requires =
translationstring
iso8601
setuptools >= 11.3 # pkg_resources.EntryPoint.resolve()

[options.packages.find]
where=src
Expand All @@ -50,33 +50,36 @@ testing =
pytest
pytest-cov
coverage>=5.0
babel

docs =
Sphinx>=1.8.1
docutils
pylons-sphinx-themes>=1.0.9
setuptools

[check-manifest]
ignore-bad-ideas =
src/colander/locale/**/*.mo

[compile_catalog]
directory = colander/locale
directory = src/colander/locale
domain = colander
statistics = true

[extract_messages]
add_comments = TRANSLATORS:
output_file = colander/locale/colander.pot
input_paths = src/colander
output_file = src/colander/locale/colander.pot
width = 80

[init_catalog]
domain = colander
input_file = colander/locale/colander.pot
output_dir = colander/locale
input_file = src/colander/locale/colander.pot
output_dir = src/colander/locale

[update_catalog]
domain = colander
input_file = colander/locale/colander.pot
output_dir = colander/locale
input_file = src/colander/locale/colander.pot
output_dir = src/colander/locale
previous = true
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from babel.messages import frontend as babel
from setuptools import setup

setup()
setup(
cmdclass={
'compile_catalog': babel.compile_catalog,
'extract_messages': babel.extract_messages,
'init_catalog': babel.init_catalog,
'update_catalog': babel.update_catalog,
}
)
5 changes: 2 additions & 3 deletions src/colander/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1768,8 +1768,6 @@ def __init__(self, package):

def _pkg_resources_style(self, node, value):
"""package.module:attr style"""
import pkg_resources

if value.startswith('.') or value.startswith(':'):
if not self.package:
raise Invalid(
Expand All @@ -1783,7 +1781,8 @@ def _pkg_resources_style(self, node, value):
value = self.package.__name__
else:
value = self.package.__name__ + value
return pkg_resources.EntryPoint.parse('x=%s' % value).resolve()
value = value.replace(':', '.', 1)
return self._zope_dottedname_style(node, value)

def _zope_dottedname_style(self, node, value):
"""package.module.attr style"""
Expand Down
99 changes: 58 additions & 41 deletions src/colander/locale/colander.pot
Original file line number Diff line number Diff line change
@@ -1,155 +1,172 @@
# Translations template for colander.
# Copyright (C) 2016 ORGANIZATION
# Copyright (C) 2023 ORGANIZATION
# This file is distributed under the same license as the colander project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: colander 1.3.1\n"
"Project-Id-Version: colander 2.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2016-09-18 22:57+0200\n"
"POT-Creation-Date: 2023-01-02 19:48-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
"Generated-By: Babel 2.11.0\n"

#: colander/__init__.py:294
#: src/colander/__init__.py:319
msgid "Invalid value"
msgstr ""

#: colander/__init__.py:340
#: src/colander/__init__.py:375
msgid "String does not match expected pattern"
msgstr ""

#: colander/__init__.py:359
#: src/colander/__init__.py:405
msgid "Invalid email address"
msgstr ""

#: colander/__init__.py:387
#: src/colander/__init__.py:434
msgid "Not a data URL"
msgstr ""

#: src/colander/__init__.py:435
msgid "Invalid MIME type"
msgstr ""

#: src/colander/__init__.py:436
msgid "Invalid Base64 encoded data"
msgstr ""

#: src/colander/__init__.py:494
msgid "${val} is less than minimum value ${min}"
msgstr ""

#: colander/__init__.py:388
#: src/colander/__init__.py:495
msgid "${val} is greater than maximum value ${max}"
msgstr ""

#: colander/__init__.py:435
#: src/colander/__init__.py:545
msgid "Shorter than minimum length ${min}"
msgstr ""

#: colander/__init__.py:436
#: src/colander/__init__.py:546
msgid "Longer than maximum length ${max}"
msgstr ""

#: colander/__init__.py:464
#: src/colander/__init__.py:569
msgid "\"${val}\" is not one of ${choices}"
msgstr ""

#: colander/__init__.py:479
#: src/colander/__init__.py:593
msgid "\"${val}\" must not be one of ${choices}"
msgstr ""

#: colander/__init__.py:501
#: src/colander/__init__.py:616
msgid "One or more of the choices you made was not acceptable"
msgstr ""

#: colander/__init__.py:523 colander/__init__.py:528
#: src/colander/__init__.py:639 src/colander/__init__.py:648
msgid "\"${val}\" is not a valid credit card number"
msgstr ""

#: colander/__init__.py:549
#: src/colander/__init__.py:720
msgid "Must be a URL"
msgstr ""

#: colander/__init__.py:553
#: src/colander/__init__.py:731
msgid "Must be a file:// URI scheme"
msgstr ""

#: src/colander/__init__.py:737
msgid "Invalid UUID string"
msgstr ""

#: colander/__init__.py:650
#: src/colander/__init__.py:839
msgid "\"${val}\" is not a mapping type: ${err}"
msgstr ""

#: colander/__init__.py:694
#: src/colander/__init__.py:889
msgid "Unrecognized keys in mapping: \"${val}\""
msgstr ""

#: colander/__init__.py:789 colander/__init__.py:1020
#: src/colander/__init__.py:990 src/colander/__init__.py:1230
msgid "\"${val}\" is not iterable"
msgstr ""

#: colander/__init__.py:797
#: src/colander/__init__.py:998
msgid "\"${val}\" has an incorrect number of elements (expected ${exp}, was ${was})"
msgstr ""

#: colander/__init__.py:936 colander/__init__.py:967
#: src/colander/__init__.py:1141 src/colander/__init__.py:1172
msgid "${cstruct} is not iterable"
msgstr ""

#: colander/__init__.py:1254
#: src/colander/__init__.py:1462
msgid "${val} cannot be serialized: ${err}"
msgstr ""

#: colander/__init__.py:1275
#: src/colander/__init__.py:1484
msgid "${val} is not a string: ${err}"
msgstr ""

#: colander/__init__.py:1295 colander/__init__.py:1306
#: src/colander/__init__.py:1507 src/colander/__init__.py:1518
msgid "\"${val}\" is not a number"
msgstr ""

#: colander/__init__.py:1454
#: src/colander/__init__.py:1697
msgid "${val} is not a string"
msgstr ""

#: colander/__init__.py:1465
#: src/colander/__init__.py:1709
msgid "\"${val}\" is neither in (${false_choices}) nor in (${true_choices})"
msgstr ""

#: colander/__init__.py:1525 colander/__init__.py:1542 colander/__init__.py:1552
#: src/colander/__init__.py:1775 src/colander/__init__.py:1794
#: src/colander/__init__.py:1806
msgid "relative name \"${val}\" irresolveable without package"
msgstr ""

#: colander/__init__.py:1582
#: src/colander/__init__.py:1843
msgid "\"${val}\" has no __name__"
msgstr ""

#: colander/__init__.py:1591
#: src/colander/__init__.py:1852
msgid "\"${val}\" is not a string"
msgstr ""

#: colander/__init__.py:1600
#: src/colander/__init__.py:1862
msgid "The dotted name \"${name}\" cannot be imported"
msgstr ""

#: colander/__init__.py:1648 colander/__init__.py:1722
#: src/colander/__init__.py:1915 src/colander/__init__.py:2005
msgid "Invalid date"
msgstr ""

#: colander/__init__.py:1662
#: src/colander/__init__.py:1932
msgid "\"${val}\" is not a datetime object"
msgstr ""

#: colander/__init__.py:1733
#: src/colander/__init__.py:2020
msgid "\"${val}\" is not a date object"
msgstr ""

#: colander/__init__.py:1794
#: src/colander/__init__.py:2085
msgid "Invalid time"
msgstr ""

#: colander/__init__.py:1804
#: src/colander/__init__.py:2096
msgid "\"${val}\" is not a time object"
msgstr ""

#: colander/tests/test_colander.py:334 colander/tests/test_colander.py:341
msgid "fail ${val}"
#: src/colander/__init__.py:2161 src/colander/__init__.py:2177
msgid "\"${val}\" is not a valid \"${cls}\""
msgstr ""

#: colander/tests/test_colander.py:537
msgid "${val}: ${choices}"
#: src/colander/__init__.py:2297
msgid "Required"
msgstr ""

Loading

0 comments on commit b2f0ce3

Please sign in to comment.