mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	i18n: Recognize a little more Handlebars syntax in makemessages.
Usually we write translation expressions as `{{t ... }}`, but `{{ t ... }}`
is equally valid as far as Handlebars is concerned, and it matches how we
usually write simple variable substitutions, as `{{ ... }}`.  So occasionally
someone writes `{{ t ... }}`; currently there are two examples of this
in the codebase, in `settings/bot-{settings,list-admin}.handlebars`.
Probably it'd be good to pick a style and enforce it uniformly, but
until we do, the other style shouldn't break translation.
			
			
This commit is contained in:
		@@ -53,8 +53,8 @@ strip_whitespace_left = re.compile(u"\\s+(%s-\\s*(endtrans|pluralize).*?-?%s)" %
 | 
			
		||||
                                   BLOCK_TAG_START, BLOCK_TAG_END), re.U)
 | 
			
		||||
 | 
			
		||||
regexes = ['{{#tr .*?}}([\s\S]*?){{/tr}}',  # '.' doesn't match '\n' by default
 | 
			
		||||
           '{{t "(.*?)"\W*}}',
 | 
			
		||||
           "{{t '(.*?)'\W*}}",
 | 
			
		||||
           '{{\s*t "(.*?)"\W*}}',
 | 
			
		||||
           "{{\s*t '(.*?)'\W*}}",
 | 
			
		||||
           "i18n\.t\('([^\']*?)'\)",
 | 
			
		||||
           "i18n\.t\('(.*?)',.*?[^,]\)",
 | 
			
		||||
           'i18n\.t\("([^\"]*?)"\)',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user