/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { List } from "../../types/java/util/List"; import type { Node } from "../../types/javax/jcr/Node"; import type { Map } from "../../types/java/util/Map"; /** * Translation utility interface. * *
* An instance of the Sitevision class implementing this interface can be obtained via
* {@link senselogic.sitevision.api.Utils#getTranslationUtil()}.
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface.
*
* Note! The returned List is immutable/unmodifiable, * i.e. you must create a copy if you want to modify it (e.g. sort). *
* @return a list of all Locales that are set up for translations on the current site */ getSiteTranslationLocales(): List; /** * Gets the translation mappings for a given page node. * *
* Each entry in the returned map depicts a "translation", i.e. a localized version of the given aPageNode.
*
* Important note! The returned map is never null, but entry values in the map might be! *
*
* Tip! If you are only interested in non-null Nodes/values in the returned map, you can use
* {@link senselogic.sitevision.api.node.NodeFilterUtil} to filter them out!
* Below is a conceptual example of how it could be done in server-side JavaScript (e.g. WebApp, RESTApp, Script module).
*
var thePotentiallyTranslatedPageNode = ...,
* translationUtil = require('TranslationUtil'),
* nodeFilterUtil = require('NodeFilterUtil'),
* translationMappings,
* skipNullValuesFilter,
* filteredTranslationMappings;
*
* translationMappings = translationUtil.getTranslations(thePotentiallyTranslatedPageNode, false);
*
* skipNullValuesFilter = nodeFilterUtil.getNonNullFilter();
* filteredTranslationMappings = nodeFilterUtil.getFilteredValueMap(translationMappings, skipNullValuesFilter);
*
*
* Please note that determining the "is this page node translated at all?" state from the returned result
* depends on the aIncludePageNode value:
*
false, an empty map will be returned.
* true, a map with one entry (i.e. the aPageNode itself) will be returned.
* * Permission note! Current user must match have * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_TRANSLATIONS} and * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE} * on @aTranslationPageNode. *
* @param aOriginalPageNode the original page node to be configured as translated from on aTranslationPageNode. It will be configured as original in aTranslationPageNode as well if aOriginalPageNode doesn't have any original configured. * @param aTranslationPageNode the translation page node to be configured as translation of aOriginalPageNode * @return true if aTranslationPageNode could be configured as translation of aOriginalPageNode, false otherwise. * @since Sitevision 4.3.2 */ setTranslatedFrom( aOriginalPageNode: Node, aTranslationPageNode: Node ): boolean; } declare namespace TranslationUtil {} declare var translationUtil: TranslationUtil; export default translationUtil;