| Class | Line # | Actions | |||||
|---|---|---|---|---|---|---|---|
| Translation | 32 | 0 | - | 0 | 0 |
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | package org.xwiki.localization; | |
| 21 | ||
| 22 | import java.util.Locale; | |
| 23 | ||
| 24 | import org.xwiki.rendering.block.Block; | |
| 25 | ||
| 26 | /** | |
| 27 | * A translation is a specific {@link Locale} and {@link TranslationBundle}. | |
| 28 | * | |
| 29 | * @version $Id: 46f6f8ecf7db66fa32f57b27b03413331f509e65 $ | |
| 30 | * @since 4.3M2 | |
| 31 | */ | |
| 32 | public interface Translation | |
| 33 | { | |
| 34 | /** | |
| 35 | * @return the bundle from which this translation comes | |
| 36 | */ | |
| 37 | TranslationBundle getBundle(); | |
| 38 | ||
| 39 | /** | |
| 40 | * @return the locale of the translation | |
| 41 | */ | |
| 42 | Locale getLocale(); | |
| 43 | ||
| 44 | /** | |
| 45 | * @return the key of the translation | |
| 46 | */ | |
| 47 | String getKey(); | |
| 48 | ||
| 49 | /** | |
| 50 | * @return the raw source of the translation as it is stored | |
| 51 | * @since 5.0M1 | |
| 52 | */ | |
| 53 | Object getRawSource(); | |
| 54 | ||
| 55 | /** | |
| 56 | * Execute the transformation (resolve any variable or parameter in its content) and produce a Block to insert in an | |
| 57 | * XDOM or to render as it is. | |
| 58 | * <p> | |
| 59 | * The variables are resolved using the current {@link TranslationBundleContext} bundles. | |
| 60 | * | |
| 61 | * @param parameters the parameters | |
| 62 | * @return the result translation | |
| 63 | */ | |
| 64 | Block render(Object... parameters); | |
| 65 | ||
| 66 | /** | |
| 67 | * Execute the transformation (resolve any variable or parameter in its content) and produce a Block to insert in an | |
| 68 | * XDOM or to render as it is. | |
| 69 | * <p> | |
| 70 | * The variables are resolved using the current {@link TranslationBundleContext} bundles. | |
| 71 | * | |
| 72 | * @param locale the locale for which this translation is rendered | |
| 73 | * @param parameters the parameters | |
| 74 | * @return the result translation | |
| 75 | */ | |
| 76 | Block render(Locale locale, Object... parameters); | |
| 77 | } |