Multilingual Catalog Indexes for Plone
Project description
.. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
This text does not appear on pypi or github. It is a comment.
==============================================================================
plone.app.multilingualindexes
==============================================================================
.. image:: https://travis-ci.org/plone/plone.app.multilingualindexes.svg?branch=master
:target: https://travis-ci.org/plone/plone.app.multilingualindexes
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/python/black
.. image:: https://coveralls.io/repos/github/plone/plone.app.multilingualindexes/badge.svg?branch=master
:target: https://coveralls.io/github/plone/plone.app.multilingualindexes?branch=master
Indexes optimized to query multilingual content made with plone.app.multilingual.
Features
--------
``tgpath`` Index (Translation Group Path)
Utility and index to get the path of an item as UUIDs of its translationgroup.
``language_or_fallback`` Index
Index to query items and get one fallback if not available in the current language.
Fallbacks can be configured in control-panel and are stored in the registry.
Integration with ``Collections``
Both indexes are available in Collections and other places using ``plone.app.querystring`` under the hood.
Both indexes do only need activation.
``tgpath`` is available as a switch ``Language independent location``.
If this is selected, the normal path will be converted to a tgpath!
If no path is selected this switch has no effect.
.. figure:: https://raw.githubusercontent.com/plone/plone.app.multilingualindexes/master/docs/querystring_tgpath.png
:scale: 100 %
:alt: Querystring selection with Translationgroup path
``language_or_fallback`` is available as ``Fallback languages``.
If a path is selected together with this option, the path will be converted to a ``tgpath``.
If the ``tgpath`` or ``language_or_fallback`` is used in a Collection, the ``path`` will be set to the portal.
Thus the usal automatically added fixation to the current ``INavigationRoot`` wont be set,
because language root folders are navigation roots.
.. figure:: https://raw.githubusercontent.com/plone/plone.app.multilingualindexes/master/docs/querystring_fallback.png
:scale: 100 %
:alt: Querystring selection with Language fallback and (optional) location.
Behind the scenes
-----------------
Fallback Index
It is in fact a simple FieldIndex.
Fallback detection happens on index time.
On query time it has the same functionality and performance as the normal Language index.
.. figure:: https://raw.githubusercontent.com/plone/plone.app.multilingualindexes/master/docs/querystring_fallback.png
:scale: 100 %
:alt: Browse the index to get a feeling what fallbacks are in there.
Translation Group Index
It is in fact a normal ExtendendPathIndex.
Just the path it indexes consists out of the translation group uids.
If an item is not translatable and thus is not part of an translationgroup,
then its normal id is taken as patyh element.
Path example: ``/Plone/f5843e426b5d47cdb44af587b322f7ea/320b1ffbf0f64603803043d48bd57516``.
In order to query the index, you need to use the translationgroup path instead of the id path::
from plone.app.multilingualindexes.tgpath import tg_path
import plone.api
plone.api.content.find(
tgpath='/'.join(tg_path(context)),
language_or_fallback=plone.api.portal.get_current_language()
)
Installation
------------
Install plone.app.multilingualindexes by adding it to your buildout::
[buildout]
...
eggs =
plone.app.multilingualindexes
and then running ``bin/buildout``
Contribute
----------
- Issue Tracker: https://github.com/plone/plone.app.multilingualindexes/issues
- Source Code: https://github.com/plone/plone.app.multilingualindexes
License
-------
The project is licensed under the GPLv2.
Contributors
============
- Jens W. Klein, jk@kleinundpartner.at
- Peter Holzer, peter.holzer@agitator.com
- Patrick Gerken, gerken@patrick-gerken.de
- Georg "Gogo" Bernhard
Changelog
=========
3.0.2 (2021-11-22)
------------------
- Make request caching more test friendly (where there is no request). [jensens]
3.0.1 (2021-11-17)
------------------
- Fix import for Plone 6 and add CI [jensens]
3.0.0 (2021-11-16)
------------------
- Drop Python 2 Support [jensens]
- Switch CI to GitHub Actions.
[gogobd]
- InitializeClass has moved, fixing issue https://github.com/plone/plone.app.multilingualindexes/issues/13
[gogobd]
2.1 (2020-08-04)
----------------
- Patch that allows for using multiple paths, fixing issue https://github.com/plone/plone.app.multilingualindexes/issues/9
[gogobd]
- User PATH_INDICES as suggested by jensens
[gogobd]
2.0 (2019-07-12)
----------------
- Patch CMFCore because of https://github.com/zopefoundation/Products.CMFCore/issues/79
[jensens]
- Fix bugs on rename/move/delete (wrong fallbacks)
[jensens]
- Drop support of Plone 5.1
[jensens]
- Python 3 compatibility
[jensens]
- Refactor index to be less complex on indexing.
[jensens]
- Bugfix: Use latest plone.app.multilingual and add subscribers to ensure in-/rein-/unindexing.
[jensens]
- Fixing "RuntimeError: the bucket being iterated changed size" (issue #3)
[gogobd]
- Depend on ``Products.CMFPlone`` instead of ``Plone`` to not fetch unnecessary dependencies.
[thet]
1.0 (2016-10-15)
----------------
- Initial release.
[jensens]
If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
This text does not appear on pypi or github. It is a comment.
==============================================================================
plone.app.multilingualindexes
==============================================================================
.. image:: https://travis-ci.org/plone/plone.app.multilingualindexes.svg?branch=master
:target: https://travis-ci.org/plone/plone.app.multilingualindexes
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/python/black
.. image:: https://coveralls.io/repos/github/plone/plone.app.multilingualindexes/badge.svg?branch=master
:target: https://coveralls.io/github/plone/plone.app.multilingualindexes?branch=master
Indexes optimized to query multilingual content made with plone.app.multilingual.
Features
--------
``tgpath`` Index (Translation Group Path)
Utility and index to get the path of an item as UUIDs of its translationgroup.
``language_or_fallback`` Index
Index to query items and get one fallback if not available in the current language.
Fallbacks can be configured in control-panel and are stored in the registry.
Integration with ``Collections``
Both indexes are available in Collections and other places using ``plone.app.querystring`` under the hood.
Both indexes do only need activation.
``tgpath`` is available as a switch ``Language independent location``.
If this is selected, the normal path will be converted to a tgpath!
If no path is selected this switch has no effect.
.. figure:: https://raw.githubusercontent.com/plone/plone.app.multilingualindexes/master/docs/querystring_tgpath.png
:scale: 100 %
:alt: Querystring selection with Translationgroup path
``language_or_fallback`` is available as ``Fallback languages``.
If a path is selected together with this option, the path will be converted to a ``tgpath``.
If the ``tgpath`` or ``language_or_fallback`` is used in a Collection, the ``path`` will be set to the portal.
Thus the usal automatically added fixation to the current ``INavigationRoot`` wont be set,
because language root folders are navigation roots.
.. figure:: https://raw.githubusercontent.com/plone/plone.app.multilingualindexes/master/docs/querystring_fallback.png
:scale: 100 %
:alt: Querystring selection with Language fallback and (optional) location.
Behind the scenes
-----------------
Fallback Index
It is in fact a simple FieldIndex.
Fallback detection happens on index time.
On query time it has the same functionality and performance as the normal Language index.
.. figure:: https://raw.githubusercontent.com/plone/plone.app.multilingualindexes/master/docs/querystring_fallback.png
:scale: 100 %
:alt: Browse the index to get a feeling what fallbacks are in there.
Translation Group Index
It is in fact a normal ExtendendPathIndex.
Just the path it indexes consists out of the translation group uids.
If an item is not translatable and thus is not part of an translationgroup,
then its normal id is taken as patyh element.
Path example: ``/Plone/f5843e426b5d47cdb44af587b322f7ea/320b1ffbf0f64603803043d48bd57516``.
In order to query the index, you need to use the translationgroup path instead of the id path::
from plone.app.multilingualindexes.tgpath import tg_path
import plone.api
plone.api.content.find(
tgpath='/'.join(tg_path(context)),
language_or_fallback=plone.api.portal.get_current_language()
)
Installation
------------
Install plone.app.multilingualindexes by adding it to your buildout::
[buildout]
...
eggs =
plone.app.multilingualindexes
and then running ``bin/buildout``
Contribute
----------
- Issue Tracker: https://github.com/plone/plone.app.multilingualindexes/issues
- Source Code: https://github.com/plone/plone.app.multilingualindexes
License
-------
The project is licensed under the GPLv2.
Contributors
============
- Jens W. Klein, jk@kleinundpartner.at
- Peter Holzer, peter.holzer@agitator.com
- Patrick Gerken, gerken@patrick-gerken.de
- Georg "Gogo" Bernhard
Changelog
=========
3.0.2 (2021-11-22)
------------------
- Make request caching more test friendly (where there is no request). [jensens]
3.0.1 (2021-11-17)
------------------
- Fix import for Plone 6 and add CI [jensens]
3.0.0 (2021-11-16)
------------------
- Drop Python 2 Support [jensens]
- Switch CI to GitHub Actions.
[gogobd]
- InitializeClass has moved, fixing issue https://github.com/plone/plone.app.multilingualindexes/issues/13
[gogobd]
2.1 (2020-08-04)
----------------
- Patch that allows for using multiple paths, fixing issue https://github.com/plone/plone.app.multilingualindexes/issues/9
[gogobd]
- User PATH_INDICES as suggested by jensens
[gogobd]
2.0 (2019-07-12)
----------------
- Patch CMFCore because of https://github.com/zopefoundation/Products.CMFCore/issues/79
[jensens]
- Fix bugs on rename/move/delete (wrong fallbacks)
[jensens]
- Drop support of Plone 5.1
[jensens]
- Python 3 compatibility
[jensens]
- Refactor index to be less complex on indexing.
[jensens]
- Bugfix: Use latest plone.app.multilingual and add subscribers to ensure in-/rein-/unindexing.
[jensens]
- Fixing "RuntimeError: the bucket being iterated changed size" (issue #3)
[gogobd]
- Depend on ``Products.CMFPlone`` instead of ``Plone`` to not fetch unnecessary dependencies.
[thet]
1.0 (2016-10-15)
----------------
- Initial release.
[jensens]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file plone.app.multilingualindexes-3.0.2.tar.gz
.
File metadata
- Download URL: plone.app.multilingualindexes-3.0.2.tar.gz
- Upload date:
- Size: 180.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7bc8224106ba45c833b022d086dba4fe848ca74ae7828b5003cd026ff5bfce5 |
|
MD5 | 81c20d944337cc56877ab7eaf70dee39 |
|
BLAKE2b-256 | 23bb94a039b3bc58070f0c73de2b5dbd965dfb6bbc25462d2c9cff4386611391 |
File details
Details for the file plone.app.multilingualindexes-3.0.2-py3-none-any.whl
.
File metadata
- Download URL: plone.app.multilingualindexes-3.0.2-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b43be5dc7bee8b14c85956d22eb9d1bfe8a81eeea1d9f780fc691c69f6c6bd |
|
MD5 | 57c67b0f863c9726a275657afa6938af |
|
BLAKE2b-256 | c299940e1bafc3823bba847a4c7ec3bbbd043d5e1ef87beefbd57055fd6d8229 |