mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #2202 -- Cleaned up technique of splitting arguments, based upon a suggestion from SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -437,15 +437,12 @@ def pluralize(value, arg='s'): | |||||||
|     is used instead. If the provided argument contains a comma, the text before |     is used instead. If the provided argument contains a comma, the text before | ||||||
|     the comma is used for the singular case. |     the comma is used for the singular case. | ||||||
|     """ |     """ | ||||||
|  |     if not ',' in arg:  | ||||||
|  | 	    arg = ',' + arg | ||||||
|     bits = arg.split(',') |     bits = arg.split(',') | ||||||
|     if len(bits) == 2: |     if len(bits) > 2: | ||||||
|         singular_suffix = bits[0] |  | ||||||
|         plural_suffix = bits[1] |  | ||||||
|     elif len(bits) == 1: |  | ||||||
|         singular_suffix = '' |  | ||||||
|         plural_suffix = bits[0] |  | ||||||
|     else: |  | ||||||
|         return '' |         return '' | ||||||
|  |     singular_suffix, plural_suffix = bits[:2] | ||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         if int(value) != 1: |         if int(value) != 1: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user