mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
Allow for templates/settings to be read and compiled.
This allows for the handlebars templates in the template/settings subdirectory to be found and compiled.
This commit is contained in:
committed by
Tim Abbott
parent
82764d0215
commit
3efe3601b8
@@ -19,7 +19,8 @@ STATIC_PATH = 'static/'
|
||||
|
||||
def get_templates():
|
||||
# type: () -> List[str]
|
||||
return glob.glob(os.path.join(STATIC_PATH, 'templates/*.handlebars'))
|
||||
return (glob.glob(os.path.join(STATIC_PATH, 'templates/*.handlebars')) +
|
||||
glob.glob(os.path.join(STATIC_PATH, 'templates/settings/*.handlebars')))
|
||||
|
||||
def run():
|
||||
# type: () -> None
|
||||
|
||||
@@ -146,9 +146,9 @@ class Command(makemessages.Command):
|
||||
translation_strings = {} # type: Dict[str, str]
|
||||
dirname = self.get_template_dir()
|
||||
|
||||
for filename in os.listdir(dirname):
|
||||
if filename.endswith('handlebars'):
|
||||
with open(os.path.join(dirname, filename), 'r') as reader:
|
||||
for dirpath, dirnames, filenames in os.walk(dirname):
|
||||
for filename in [f for f in filenames if f.endswith(".handlebars")]:
|
||||
with open(os.path.join(dirpath, filename), 'r') as reader:
|
||||
data = reader.read()
|
||||
data = data.replace('\n', '\\n')
|
||||
translation_strings.update(self.extract_strings(data))
|
||||
|
||||
Reference in New Issue
Block a user