DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
@DefaultLocale @Generate(format = "com.google.gwt.i18n.rebind.format.PropertiesFormat") public interface ValidationMessages extends Messages {
@DefaultLocale("en") public interface ValidationMessages extends ConstantsWithLookup {
@DefaultLocale("en") public interface ValidationMessages extends ConstantsWithLookup {
@DefaultLocale("en") public interface ValidationMessages extends ConstantsWithLookup {
@DefaultLocale("en") public interface ValidationMessages extends ConstantsWithLookup {
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
String defaultLocale = null; if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } else { defaultLocale = DefaultLocale.DEFAULT_LOCALE;
String defaultLocale = null; if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } else { defaultLocale = DefaultLocale.DEFAULT_LOCALE;
public void accept(MessageInterfaceVisitor cv, GwtLocale locale) throws MessageProcessingException { String defaultLocale = DefaultLocale.DEFAULT_LOCALE; DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } GwtLocale sourceLocale; try { sourceLocale = factory.fromString(defaultLocale); } catch (IllegalArgumentException e) { // ignore specified default sourceLocale = factory.fromString(DefaultLocale.DEFAULT_LOCALE); } cv.visitMessageInterface(this, sourceLocale); for (Message msg : getMessages()) { MessageTranslation trans = msg.getTranslation(locale); MessageVisitor mv = cv.visitMessage(msg, trans != null ? trans : msg); if (mv != null) { msg.accept(mv); } } cv.endMessageInterface(this); }
@DefaultLocale("en_US") interface MessagesResource extends Messages { @DefaultMessage("ID") String id(); @DefaultMessage("Type") String type(); @DefaultMessage("Name") String name(); @DefaultMessage("Description") String description(); @DefaultMessage("Attributes") String attributes(); @DefaultMessage("Save") String save(); @DefaultMessage("Update") String update(); @DefaultMessage("Cancel") String cancel(); @DefaultMessage("Revert") String revert(); }
protected Locale getLocale() { if (GwtConfig.get().getModuleRunner().getLocale() != null) { return GwtConfig.get().getModuleRunner().getLocale(); } DefaultLocale annotation = GwtReflectionUtils.getAnnotation(proxiedClass, DefaultLocale.class); if (annotation != null) { String[] localeCodes = annotation.value().split("_"); switch (localeCodes.length) { case 1: return new Locale(localeCodes[0]); case 2: return new Locale(localeCodes[0], localeCodes[1]); default: throw new GwtTestI18NException("Cannot parse Locale value in annoted class [" + proxiedClass.getSimpleName() + "] : @" + DefaultLocale.class.getSimpleName() + "(" + annotation.value() + ")"); } } else { return null; } }
public void accept(MessageInterfaceVisitor cv, GwtLocale locale) throws MessageProcessingException { String defaultLocale = DefaultLocale.DEFAULT_LOCALE; DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } GwtLocale sourceLocale; try { sourceLocale = factory.fromString(defaultLocale); } catch (IllegalArgumentException e) { // ignore specified default sourceLocale = factory.fromString(DefaultLocale.DEFAULT_LOCALE); } cv.visitMessageInterface(this, sourceLocale); for (Message msg : getMessages()) { MessageTranslation trans = msg.getTranslation(locale); MessageVisitor mv = cv.visitMessage(msg, trans != null ? trans : msg); if (mv != null) { msg.accept(mv); } } cv.endMessageInterface(this); }
protected Locale getLocale() { if (GwtConfig.get().getModuleRunner().getLocale() != null) { return GwtConfig.get().getModuleRunner().getLocale(); } DefaultLocale annotation = GwtReflectionUtils.getAnnotation(proxiedClass, DefaultLocale.class); if (annotation != null) { String[] localeCodes = annotation.value().split("_"); switch (localeCodes.length) { case 1: return new Locale(localeCodes[0]); case 2: return new Locale(localeCodes[0], localeCodes[1]); default: throw new GwtTestI18NException("Cannot parse Locale value in annoted class [" + proxiedClass.getSimpleName() + "] : @" + DefaultLocale.class.getSimpleName() + "(" + annotation.value() + ")"); } } else { return null; } }
@DefaultLocale("en_US") interface MessagesResource extends Messages { @DefaultMessage("Documents") String documents(); @DefaultMessage("Refresh") String refresh(); @DefaultMessage("Add") String add(); @DefaultMessage("Remove") String remove(); @DefaultMessage("ID") String id(); @DefaultMessage("Type") String type(); @DefaultMessage("Name") String name(); @DefaultMessage("Please add or select a document.") String detailSummary(); }
/** * The <code>ExtendedValueBoxEditorMessages</code> class contains the messages for extended value * box editor. * * @author Manfred Tremmel * @version $Rev$, $Date$ */ @DefaultLocale("en") public interface ExtendedValueBoxEditorMessages extends Messages { /** * parse exception locale message. * * @param pvalue value that caused the problem * @return parseExceptionMessage */ @DefaultMessage("Bad value ({0})") String parseExceptionMessage(final String pvalue); }
/** * Constant for labeling the simple pager navigational {@link ImageButton}s */ @DefaultLocale("en_US") public interface ImageButtonsConstants extends Constants { @DefaultStringValue("Fast forward") String fastForward(); @DefaultStringValue("First page") String firstPage(); @DefaultStringValue("Last page") String lastPage(); @DefaultStringValue("Next page") String nextPage(); @DefaultStringValue("Previous page") String prevPage(); }
/** * Constant for labeling the simple pager navigational {@link ImageButton}s */ @DefaultLocale("en_US") public interface ImageButtonsConstants extends Constants { @DefaultStringValue("Fast forward") String fastForward(); @DefaultStringValue("First page") String firstPage(); @DefaultStringValue("Last page") String lastPage(); @DefaultStringValue("Next page") String nextPage(); @DefaultStringValue("Previous page") String prevPage(); }