MCPcopy
hub / github.com/django/django / all_locale_paths

Function all_locale_paths

django/utils/translation/trans_real.py:450–462  ·  view source on GitHub ↗

Return a list of paths to user-provides languages files.

()

Source from the content-addressed store, hash-verified

448
449
450def all_locale_paths():
451 """
452 Return a list of paths to user-provides languages files.
453 """
454 globalpath = os.path.join(
455 os.path.dirname(sys.modules[settings.__module__].__file__), "locale"
456 )
457 app_paths = []
458 for app_config in apps.get_app_configs():
459 locale_path = os.path.join(app_config.path, "locale")
460 if os.path.exists(locale_path):
461 app_paths.append(locale_path)
462 return [globalpath, *settings.LOCALE_PATHS, *app_paths]
463
464
465@functools.lru_cache(maxsize=1000)

Callers 1

check_for_languageFunction · 0.85

Calls 4

get_app_configsMethod · 0.80
joinMethod · 0.45
existsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected