Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using i18n compatibility layer #247

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Facet definitions."""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

{{ facet_imports|imports }}
{{ vars.facets|imports }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{{ vars.search_options|imports }}
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _
from . import facets


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-model-builder
version = 4.0.70
version = 4.0.71
description = A utility library that generates OARepo required data model files from a JSON specification file
authors = Miroslav Bauer <[email protected]>, Miroslav Simek <[email protected]>
readme = README.md
Expand Down
28 changes: 14 additions & 14 deletions tests/test_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_include_invenio():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _


from invenio_records_resources.services.records.facets import TermsFacet
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_nested():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.nested_facet import NestedLabeledFacet
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_object():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet

Expand Down Expand Up @@ -255,7 +255,7 @@ def test_nest_obj():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.nested_facet import NestedLabeledFacet
Expand Down Expand Up @@ -312,7 +312,7 @@ def test_array():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet

Expand Down Expand Up @@ -384,7 +384,7 @@ def test_array_object():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.nested_facet import NestedLabeledFacet
Expand Down Expand Up @@ -453,7 +453,7 @@ def test_array_nested():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.nested_facet import NestedLabeledFacet
Expand Down Expand Up @@ -523,7 +523,7 @@ def test_not_searchable():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.nested_facet import NestedLabeledFacet
Expand Down Expand Up @@ -592,7 +592,7 @@ def test_top_facets():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.nested_facet import NestedLabeledFacet
Expand Down Expand Up @@ -650,7 +650,7 @@ def test_searchable_true():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet

Expand Down Expand Up @@ -703,7 +703,7 @@ def test_enum():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet
from oarepo_runtime.services.facets.enum import EnumTermsFacet
Expand Down Expand Up @@ -757,7 +757,7 @@ def test_customizations_args_class():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from blah import MyFacetClass

Expand Down Expand Up @@ -808,7 +808,7 @@ def test_customizations_field():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from blah import MyFacetClass

Expand Down Expand Up @@ -856,7 +856,7 @@ def test_facets_group():
\"""Facet definitions.\"""

from invenio_search.engine import dsl
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _

from invenio_records_resources.services.records.facets import TermsFacet

Expand Down
12 changes: 6 additions & 6 deletions tests/test_search_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_sort():
assert strip_whitespaces(data) == strip_whitespaces(
"""
from invenio_records_resources.services import SearchOptions as InvenioSearchOptions
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _
from . import facets


Expand Down Expand Up @@ -147,7 +147,7 @@ def test_search_class():
assert strip_whitespaces(data) == strip_whitespaces(
"""
from invenio_records_resources.services import SearchOptions as InvenioSearchOptions
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _
from . import facets


Expand Down Expand Up @@ -200,7 +200,7 @@ def test_search_options_base_class():
assert strip_whitespaces(data) == strip_whitespaces(
"""
from blah import BaseSearchOptions
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _
from . import facets


Expand Down Expand Up @@ -247,7 +247,7 @@ def test_facet_groups():
},
"b3": {
"type": "keyword",
"facets": {"searchable": True, "facet-groups": ['default']},
"facets": {"searchable": True, "facet-groups": ["default"]},
},
"c": {
"type": "keyword",
Expand Down Expand Up @@ -308,7 +308,7 @@ def test_facet_groups():
assert strip_whitespaces(data) == strip_whitespaces(
"""
from blah import BaseSearchOptions
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _
from . import facets


Expand Down Expand Up @@ -414,7 +414,7 @@ def test_replace_sort_options():
assert strip_whitespaces(data) == strip_whitespaces(
"""
from invenio_records_resources.services import SearchOptions as InvenioSearchOptions
from flask_babelex import lazy_gettext as _
from oarepo_runtime.i18n import lazy_gettext as _
from . import facets


Expand Down