diff --git a/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo b/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo index 5d3fbc1..e6c7505 100644 Binary files a/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo and b/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo differ diff --git a/sphinx_proof/translations/locales/it/LC_MESSAGES/proof.mo b/sphinx_proof/translations/locales/it/LC_MESSAGES/proof.mo index e8968d4..1a865d9 100644 Binary files a/sphinx_proof/translations/locales/it/LC_MESSAGES/proof.mo and b/sphinx_proof/translations/locales/it/LC_MESSAGES/proof.mo differ diff --git a/tests/test_locale_convert.py b/tests/test_locale_convert.py new file mode 100644 index 0000000..51aa875 --- /dev/null +++ b/tests/test_locale_convert.py @@ -0,0 +1,19 @@ +from sphinx_proof.translations._convert import convert_json + + +def test_convert(tmp_path, monkeypatch): + # Generate folder structures needed + path_translation = tmp_path / "translations" + path_jsons = path_translation / "jsons" + path_compiled = path_translation / "locales" + path_jsons.mkdir(parents=True) + (path_jsons / "test.json").write_text( + '[{"language":"English","symbol":"en","text":"Text"},' + '{"language":"Other","symbol":"ot","text":"Translate"}]' + ) + monkeypatch.setattr("subprocess.check_call", lambda args: None) + convert_json(path_translation) + assert (path_compiled / "ot").exists() + path_lc = path_compiled / "ot" / "LC_MESSAGES" + assert (path_lc / "proof.po").exists() + assert "Translate" in (path_lc / "proof.po").read_text("utf8")