All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.granite.translation.api.TranslationConfig Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
/*************************************************************************
 * ADOBE CONFIDENTIAL
 * __________________
 *
 * Copyright 2014 Adobe
 * All Rights Reserved.
 *
 * NOTICE: All information contained herein is, and remains
 * the property of Adobe and its suppliers, if any. The intellectual
 * and technical concepts contained herein are proprietary to Adobe
 * and its suppliers and are protected by all applicable intellectual
 * property laws, including trade secret and copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe.
 **************************************************************************/
package com.adobe.granite.translation.api;

import org.apache.sling.api.resource.ResourceResolver;
import org.osgi.annotation.versioning.ProviderType;

import java.util.Map;

//
/**
 * This TranslationConfig interface is used to return the full list of Language Codes and Content Categories which are
 * stored within the system. These lists are used by the Translation API as the only acceptable inputs to their
 * respective parameters.
 */
@ProviderType
public interface TranslationConfig {

    /**
     * @deprecated  since 2.3.0, use {@link #getLanguages(ResourceResolver)} instead.
     * Returns a Map of the currently allowed language codes. The default location for the language codes is:
     * "/libs/wcm/core/resources/languages"
     * @return {@code Map} containing the list of allowed language codes and their respective labels
     *         (in English) {@code ()}
     * @throws TranslationException the translation exception
     */
    @Deprecated
    Map getLanguages() throws TranslationException;

    /**
     * Returns a Map of the currently allowed language codes. The default location for the language codes is:
     * "/libs/wcm/core/resources/languages"
     * @param resolver used for resolving language code path
     * @return {@code Map} containing the list of allowed language codes and their respective labels
     *         (in English) {@code ()}
     */
    Map getLanguages(ResourceResolver resolver);

    /**
     * Returns a Map of the currently allowed content categories The default location for the categories is:
     * "/libs/granite/translation/resources/categories".
     * @return {@code Map} containing the list of allowed content categories and their respective
     *         labels (in English) {@code ()}
     * @throws TranslationException the translation exception
     */
    Map getCategories() throws TranslationException;

    /** Name of the property on language nodes that contains the label. */
    static final String PROPERTY_LANGUAGE_LABEL = "language";

    /** Name of the property on category nodes that contains the label. */
    static final String PROPERTY_CATEGORY_LABEL = "category";

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy