de.sstoehr.pustefix.i18n.input.AbstractReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pustefix-i18n-maven-plugin Show documentation
Show all versions of pustefix-i18n-maven-plugin Show documentation
A maven plugin to work with PO translation files with Pustefix framework
package de.sstoehr.pustefix.i18n.input;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import de.sstoehr.pustefix.i18n.model.Locale;
import de.sstoehr.pustefix.i18n.model.Message;
public abstract class AbstractReader implements Reader {
protected Map locales = new LinkedHashMap<>();
@Override
public void addLocale(Locale locale, File file) {
locales.put(locale, file);
}
@Override
public List read() {
Map messages = new LinkedHashMap<>();
for (Map.Entry locale : locales.entrySet()) {
this.readSingle(locale.getKey(), locale.getValue(), messages);
}
List list = new ArrayList<>(messages.values());
return Collections.unmodifiableList(list);
}
abstract void readSingle(Locale locale, File file, Map messages);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy