mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	docs: Add note for importing _() function in translating.md.
This commit is contained in:
		@@ -236,6 +236,13 @@ You can instead use:
 | 
			
		||||
{% trans %}This string will have {{ value }} inside.{% endtrans %}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
A string in Python can be marked for translation using the `_()` function,
 | 
			
		||||
which can be imported as follows:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
from django.utils.translation import ugettext as _
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Zulip expects all the error messages to be translatable as well.  To
 | 
			
		||||
ensure this, the error message passed to `json_error` and
 | 
			
		||||
`JsonableError` should always be a literal string enclosed by `_()`
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user