Whole file

solaluset/i18nice

The author described this change as fix bug when static refs aren't expanded. It counts as a record because the check below fails on the code as it stood at 292d9d633 and passes on a23a5eefe, with nothing else changed between the two runs.

Fix saved2023-08-11
Sharing licenceMIT · LICENSE
Change size+2 1

What the code was meant to do, written into the code itself as a save note

fix bug when static refs aren't expanded

The change

168168 file_content = load_resource(path, None, False)
169169 for loc, dic in file_content.items():
170170 if isinstance(dic, dict):
171- load_translation_dic(
171+ loaded = load_translation_dic(
172172 dic,
173173 get_namespace_from_filepath(os.path.join(directory, f)),
174174 loc,
175175 )
176+ formatters.expand_static_refs(loaded, loc)
176177 else:
177178 raise I18nFileLoadError(
178179 f"Cannot identify locales for {path!r}:"

The check that tells the two apart

failpass·i18n/tests/loader_tests.py::TestFileLoader::test_load_everything

Check file i18n/tests/loader_tests.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it292d9d633d2781798a7f752382c3884dbf334674
Broken version dated2023-08-11
Modulei18n.resource_loader
Units changedrecursive_load_everything
Fingerprint50c3a1a20d94cc8d
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in solaluset/i18nice