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

com.github.czyzby.autumn.mvc.component.i18n.dto.LocaleChangingAction Maven / Gradle / Ivy

Go to download

MVC framework based on LibGDX using Autumn for components management and LML as view templates.

There is a newer version: 1.9.1.9.6
Show newest version
package com.github.czyzby.autumn.mvc.component.i18n.dto;

import java.util.Locale;

import com.github.czyzby.autumn.mvc.component.i18n.LocaleService;
import com.github.czyzby.lml.parser.action.ActorConsumer;

/** Allows to change current application's locale.
 *
 * @author MJ */
public class LocaleChangingAction implements ActorConsumer {
    private final LocaleService localeService;
    private final Locale locale;

    public LocaleChangingAction(final LocaleService localeService, final Locale locale) {
        this.localeService = localeService;
        this.locale = locale;
    }

    @Override
    public Void consume(final Object actor) {
        localeService.setCurrentLocale(locale);
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy