Files
dash-api/lib/python3.11/site-packages/i18n/loaders/json_loader.py
2025-09-07 22:09:54 +02:00

15 lines
394 B
Python

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))