Cloned DMOJ
This commit is contained in:
parent
f623974b58
commit
49dc9ff10c
513 changed files with 132349 additions and 39 deletions
18
judge/jinja2/language.py
Normal file
18
judge/jinja2/language.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from django.utils import translation
|
||||
|
||||
from . import registry
|
||||
|
||||
|
||||
@registry.function('language_info')
|
||||
def get_language_info(language):
|
||||
# ``language`` is either a language code string or a sequence
|
||||
# with the language code as its first item
|
||||
if len(language[0]) > 1:
|
||||
return translation.get_language_info(language[0])
|
||||
else:
|
||||
return translation.get_language_info(str(language))
|
||||
|
||||
|
||||
@registry.function('language_info_list')
|
||||
def get_language_info_list(langs):
|
||||
return [get_language_info(lang) for lang in langs]
|
Loading…
Add table
Add a link
Reference in a new issue