summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* plural: parse new c, e operands (otherwise unsupported though)Aarni Koskela2022-04-081-1/+3
|
* Adjust tests for CLDR 40 dataAarni Koskela2022-04-082-5/+5
|
* Plural-Forms: Fix missing trailing semicolonfarhan59002022-04-0810-29/+29
| | | | | | | | Adds missing semicolon in the code that generates the header that is Catalog.plural_forms as well as in plural.to_gettext function. Also modifies all the concerning test cases as well as test data files. Closes https://github.com/python-babel/babel/issues/836
* Prefer setuptools imports to distutils importsAarni Koskela2022-04-081-17/+12
| | | | | | | The non-conditional imports have been around for 6 to 17 years, so they should be safe in conservative situations too. Refs #824
* Fix duplicate locations when writing without linenoSigurd Ljødal2022-04-081-0/+1
| | | | | | If the same translation appears multiple times in the same file, duplicate locations would be written to the .po file when using write_po(..., include_lineno=False).
* Don't use the deprecated format_number function internally or in testsAarni Koskela2022-02-041-5/+2
|
* Merge pull request #834 from akx/improve-date-parseAarni Koskela2022-01-281-4/+31
|\ | | | | Improve date/time parsing
| * Add format argument to parse_*Juliette Monsel2022-01-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ``parse_date()`` does not allow the user to specify the date's format and the 'medium' format is used by default in the call to ``get_date_format()`` on line 1144. This results in a failure to parse the date in short format for the locale 'sv_SE'. This commit adds the format argument to avoid this failure. The default value is set to 'medium' to preserve the old behavior. Fixes #657 Co-authored-by: Aarni Koskela <akx@iki.fi>
| * Add and emit dates.ParseErrorAarni Koskela2022-01-281-0/+7
| |
| * Improve partial time parsingAarni Koskela2022-01-281-2/+21
| | | | | | | | | | | | | | Refs #442 Co-authored-by: David Bauer <david.bauer009@gmail.com> Co-authored-by: Arthur Jovart <arthur@jovart.com>
* | Add frontend for extract directory filterAarni Koskela2022-01-272-0/+28
|/ | | | Co-authored-by: Kinshuk Dua <kinshukduaexam@gmail.com>
* parse_locale(): upper-case variant tag to match file systemAarni Koskela2022-01-271-0/+6
| | | | | | | | | At all times, language tags and their subtags, including private use and extensions, are to be treated as case insensitive: there exist conventions for the capitalization of some of the subtags, but these MUST NOT be taken to carry meaning. Fixes #814
* Date intervals: allow using `other` as fallback formAarni Koskela2022-01-251-0/+10
| | | | Fixes #825
* Update copyright year to 2022Aarni Koskela2022-01-2514-14/+14
|
* Hack around empty `err` in test_extract_error_code testAarni Koskela2022-01-251-2/+3
|
* Remove redundant _compat.pyHugo van Kemenade2021-09-1413-50/+39
|
* Implement `--init-missing` option for `pybabel update` (#785)ruro2021-06-151-1/+39
| | | | | | | * implement update --init-missing option * trivial test that the --init-missing option exists * add non-trivial update --init-missing test
* Become 2.9.1Aarni Koskela2021-04-2814-14/+14
| | | | | * Update copyright year * Update changelog
* Disallow special filenames on Windowslocale-basenameAarni Koskela2021-04-281-0/+9
|
* Run locale identifiers through `os.path.basename()`Aarni Koskela2021-04-281-1/+29
|
* Use Freezegun in test_format_current_momentAarni Koskela2020-11-121-12/+4
| | | | The earlier patch resulted in `unsupported operand type(s) for -: 'datetime' and 'datetime'` on Pypy3.
* Merge branch '2.8-maintenance' into masterAarni Koskela2020-11-1114-14/+14
|\
| * Bump copyright year from 2019 to 2020Aarni Koskela2020-11-1114-14/+14
| |
* | Merge pull request #734 from akx/cldr-37Aarni Koskela2020-11-101-1/+11
|\ \ | | | | | | CLDR 37 support
| * | Skip deprecated l*gettext functions on Python 3.8+Aarni Koskela2020-10-021-1/+11
| | |
* | | Handle ZoneInfo objects in get_timezone_location, get_timezone_name (#741)Alessio Bogon2020-11-101-40/+89
|/ / | | | | Fixes #740
* | LazyProxy: Handle AttributeError in specified func (#724)Nikiforov Konstantin2020-09-301-0/+11
| | | | | | | | | | Fixes #723 Co-authored-by: Aarni Koskela <akx@iki.fi>
* | Added group_separator feature in number formatting (#726)Abdullah Javed Nesar2020-09-221-0/+30
| |
* | fix tests when using Python 3.9a6Felix Schwarz2020-05-051-5/+12
| | | | | | | | | | | | In Python 3.9a6 integer values for future flags were changed to prevent collision with compiler flags. We need to retrieve these at runtime so the test suite works with Python <= 3.8 as well as Python 3.9.
* | Introduce invariant that _invalid_pofile() takes unicode line.Niklas Hambüchen2020-01-281-1/+1
|/ | | | | | | | | | | | | | | | This makes debugging and reasoning about the code easier; otherwise it is surprising that sometimes `line` is a unicode and sometimes not. So far, when it was not, it could either be only `""` or `'Algo esta mal'`; thus this commit makes those two u"" strings. In all other cases, it was guaranteed that it's unicode, because all code paths leading to `_invalid_pofile()` went through if not isinstance(line, text_type): line = line.decode(self.catalog.charset) before.
* fix small decimal with disabled decimal_quantizationHe Chen2019-12-311-0/+4
|
* Bump copyright year from 2018 to 2019Aarni Koskela2019-05-2714-15/+15
|
* parse_decimal(): assume spaces are equivalent to non-breaking spaces when ↵Aarni Koskela2019-05-271-0/+11
| | | | | | not in strict mode Fixes #637
* Catalog update: keep user comments from destination by defaultAarni Koskela2019-05-271-1/+30
| | | | Closes #418
* Merge pull request #647 from akx/pybabel-exit-codeAarni Koskela2019-05-272-85/+74
|\ | | | | pybabel compile: exit with code 1 if errors were encountered
| * pybabel compile: exit with code 1 if errors were encounteredAarni Koskela2019-05-272-0/+14
| | | | | | | | Fixes #627
| * test_frontend: DRY out path generationAarni Koskela2019-05-271-85/+60
| |
* | Add comparison operators to _NormalizedStringAarni Koskela2019-05-271-0/+17
|/ | | | | | Based on @hoangduytranuk's original implementation. Fixes #612
* get_display_name(): Don't attempt to concatenate variant information to NoneAarni Koskela2019-05-271-0/+10
| | | | Fixes #601
* Cache locale_identifiers()Aarni Koskela2019-05-271-0/+26
| | | | Fixes #620
* Fix conftest.py compatibility with pytest 4.3Miro Hrončok2019-03-141-3/+6
| | | | | | | | While pytest in tox.ini is explicitly set to be 3.3.2, in Fedora 31 we are about to update to a newer version of pytest. In order to be able to test babel, we need pytest 4.3 support. This adds support for pytest 4.3 without breaking support for 3.3.2.
* Skip alt=... for week data (minDays, firstDay, weekendStart, weekendEnd)Aarni Koskela2019-03-011-0/+6
| | | | Fixes #624
* fixes #619 wrong weeknumber for 31.12.2018 (#621)BT-sschmid2019-03-011-0/+9
| | | | | | | | The weeknumber was calculated to 53, but by definition the value must compute to 1. the fix will compute the weeknumber by using date.isocalendar if locale.first_week_day == 0. Also the computation of the year format 'YYYY' is replaced by isocalendar.
* Replace odict with Python's collection.OrderedDictJon Dufresne2019-01-251-14/+0
| | | | | | | The odict class duplicates collection.OrderedDict from Python's standard lib. Simplify the code by using builtin Python features. https://docs.python.org/3/library/collections.html#collections.OrderedDict
* Remove unused imports throughout testsJon Dufresne2019-01-243-4/+2
|
* Download CLDR 34.0Alberto Mardegan2019-01-241-2/+2
|
* Merge pull request #564 from cedk/skip-empty-msgidAarni Koskela2018-08-201-0/+23
|\ | | | | Skip empty message when writing mo file
| * Test empty translation uses fallbackCédric Krier2018-08-191-0/+23
| |
* | Merge pull request #599 from fuzzmz/fix-repeated-suggestions-for-0Aarni Koskela2018-08-191-0/+4
|\ \ | | | | | | don't repeat suggestions in parse_decimal strict
| * | don't repeat suggestions in parse_decimal strictSerban Constantin2018-08-071-0/+4
| | | | | | | | | | | | | | | | | | Don't repeat suggestions for `0.00` in languages which use commas as delimiters combined with strict mode.