3
X'ícu ã @ sZ d Z ddlmZmZ dddhddhdd d
dhgZdd
Zdd Zdd Zdd Ze Z dS )zö
babel.messages.checkers
~~~~~~~~~~~~~~~~~~~~~~~
Various routines that help with validation of translations.
:since: version 0.9
:copyright: (c) 2013-2022 by the Babel Team.
:license: BSD, see LICENSE for more details.
é )ÚTranslationErrorÚ
PYTHON_FORMATÚiÚdÚuÚxÚXÚfÚFÚgÚGc C sd |j st|jtstddS | dkr*dS |j}t|ttfsD|f}t|| jkr`td| j dS )z0Verify the number of plurals in the translation.z/Found plural forms for non-pluralizable messageNz*Wrong number of plural forms (expected %d)) ZpluralizableÚ
isinstanceÚstringÚstrr ÚlistÚtupleÚlenÚnum_plurals)ÚcatalogÚmessageÚmsgstrs© r ú8/tmp/pip-build-gk9425m9/babel/babel/messages/checkers.pyr s r c C sl d|j krdS |j}t|ttfs(|f}|j}t|ttfsB|f}x$t||D ]\}}|rNt|| qNW dS )z9Verify the format string placeholders in the translation.z
python-formatN)ÚflagsÚidr