Update the en/LC_MESSAGES/django.po (main and contrib) files with new/updated translatable strings.
(resources=None, languages=None, verbosity=0)
| 205 | |
| 206 | |
| 207 | def update_catalogs(resources=None, languages=None, verbosity=0): |
| 208 | """ |
| 209 | Update the en/LC_MESSAGES/django.po (main and contrib) files with |
| 210 | new/updated translatable strings. |
| 211 | """ |
| 212 | settings.configure() |
| 213 | django.setup() |
| 214 | if resources is not None: |
| 215 | print("`update_catalogs` will always process all resources.") |
| 216 | contrib_dirs = _get_locale_dirs(None, include_core=False) |
| 217 | |
| 218 | os.chdir(os.path.join(os.getcwd(), "django")) |
| 219 | print("Updating en catalogs for Django and contrib apps...") |
| 220 | call_command("makemessages", locale=["en"], verbosity=verbosity) |
| 221 | print("Updating en JS catalogs for Django and contrib apps...") |
| 222 | call_command("makemessages", locale=["en"], domain="djangojs", verbosity=verbosity) |
| 223 | |
| 224 | # Output changed stats |
| 225 | _check_diff("core", os.path.join(os.getcwd(), "conf", "locale")) |
| 226 | for name, dir_ in contrib_dirs: |
| 227 | _check_diff(name, dir_) |
| 228 | |
| 229 | |
| 230 | def lang_stats(resources=None, languages=None, verbosity=0): |
nothing calls this directly
no test coverage detected