done
This commit is contained in:
14
lib/python3.11/site-packages/i18n/loaders/json_loader.py
Normal file
14
lib/python3.11/site-packages/i18n/loaders/json_loader.py
Normal file
@ -0,0 +1,14 @@
|
||||
import json
|
||||
|
||||
from .loader import Loader, I18nFileLoadError
|
||||
|
||||
class JsonLoader(Loader):
|
||||
"""class to load yaml files"""
|
||||
def __init__(self):
|
||||
super(JsonLoader, self).__init__()
|
||||
|
||||
def parse_file(self, file_content):
|
||||
try:
|
||||
return json.loads(file_content)
|
||||
except ValueError as e:
|
||||
raise I18nFileLoadError("invalid JSON: {0}".format(e.strerror))
|
Reference in New Issue
Block a user