Return a list of paths to user-provides languages files.
()
| 448 | |
| 449 | |
| 450 | def 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) |
no test coverage detected