xcomponent 0.8.3__tar.gz → 0.8.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xcomponent-0.8.3 → xcomponent-0.8.4}/CHANGELOG.md +4 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/Cargo.lock +1 -1
- {xcomponent-0.8.3 → xcomponent-0.8.4}/Cargo.toml +1 -1
- {xcomponent-0.8.3 → xcomponent-0.8.4}/PKG-INFO +1 -1
- {xcomponent-0.8.3 → xcomponent-0.8.4}/pyproject.toml +1 -1
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/i18n.rs +19 -2
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/adapters/test_babel.py +30 -1
- {xcomponent-0.8.3 → xcomponent-0.8.4}/uv.lock +1 -1
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/build-sdist.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/build-wheels.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/publish-doc.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/publish-pypi.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/release.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/tests-artifacts.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.github/workflows/tests.yml +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.gitignore +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/.python-version +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/Justfile +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/LICENSE +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/README.md +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/docs/Makefile +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/docs/source/conf.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/docs/source/develop/.gitkeep +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/docs/source/index.md +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/docs/source/user/changelog.md +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/docs/source/user/getting_started.md +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/scripts/get_version.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/scripts/write_changelog.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/adapters/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/adapters/babel.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/py.typed +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/service/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/service/catalog.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/python/xcomponent/xcore.pyi +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/catalog/catalog.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/catalog/mod.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/context.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/ast/eval.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/ast/mod.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/ast/model.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/ast/parse.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/grammar.pest +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/mod.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/parser.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/expression/tokens.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/lib.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/markup/grammar.pest +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/markup/mod.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/markup/parser.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/src/rust/markup/tokens.rs +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/i18n/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/i18n/babel.ini +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/i18n/fr.mo +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/i18n/fr.po +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/i18n/mydomain.pot +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/functionals/i18n/test_l10n.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/adapters/__init__.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/conftest.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_binary_eq.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_binary_op.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_binary_op_bool.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_default_values.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_field_access.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_for_expr.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_func.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_if_expr.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_let.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_nested.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_render_comment.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_script.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_str_dedent.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_str_method.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_types.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/expression/test_unary.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_core.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_named_component.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_attributes.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_context.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_globals.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_globals_obj.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_globals_obj2.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_nested_dict.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_nested_node.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_node.py +0 -0
- {xcomponent-0.8.3 → xcomponent-0.8.4}/tests/unittests/test_render_script.py +0 -0
|
@@ -301,8 +301,25 @@ fn extract_from_ast(ast: AST) -> PyResult<Vec<ExtractedMessage>> {
|
|
|
301
301
|
}
|
|
302
302
|
AST::Literal(Literal::XNode(XNode::Fragment(node))) => {
|
|
303
303
|
for child in node.children() {
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
match child {
|
|
305
|
+
XNode::Expression(expr) => {
|
|
306
|
+
res.extend(extract_expr_i18n_messages(expr.expression())?);
|
|
307
|
+
}
|
|
308
|
+
XNode::Element(node) => {
|
|
309
|
+
for child in node.attrs().values() {
|
|
310
|
+
if let XNode::Expression(expr) = child {
|
|
311
|
+
res.extend(extract_expr_i18n_messages(expr.expression())?);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
for child in node.children() {
|
|
315
|
+
if let XNode::Expression(expr) = child {
|
|
316
|
+
res.extend(extract_expr_i18n_messages(expr.expression())?);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
_ => {
|
|
321
|
+
warn!("Ignoring {:?} while extracting messages", child);
|
|
322
|
+
}
|
|
306
323
|
}
|
|
307
324
|
}
|
|
308
325
|
}
|
|
@@ -331,7 +331,36 @@ empty_comment: list[str] = []
|
|
|
331
331
|
empty_comment,
|
|
332
332
|
),
|
|
333
333
|
],
|
|
334
|
-
id="nested
|
|
334
|
+
id="nested diamond",
|
|
335
|
+
),
|
|
336
|
+
pytest.param(
|
|
337
|
+
"""
|
|
338
|
+
<BaseLayout>
|
|
339
|
+
{
|
|
340
|
+
if authenticated {
|
|
341
|
+
<>
|
|
342
|
+
{globals.username}
|
|
343
|
+
-
|
|
344
|
+
<A href={globals.request.route_path('sign_out')} hx-disable>
|
|
345
|
+
{globals.pgettext("Sign out header link", "Sign Out")}
|
|
346
|
+
</A>
|
|
347
|
+
</>
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
</BaseLayout>
|
|
351
|
+
""",
|
|
352
|
+
[
|
|
353
|
+
(
|
|
354
|
+
1,
|
|
355
|
+
"pgettext",
|
|
356
|
+
(
|
|
357
|
+
"Sign out header link",
|
|
358
|
+
"Sign Out",
|
|
359
|
+
),
|
|
360
|
+
empty_comment,
|
|
361
|
+
),
|
|
362
|
+
],
|
|
363
|
+
id="if nested diamond",
|
|
335
364
|
),
|
|
336
365
|
pytest.param(
|
|
337
366
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|