Kawai Wiki

Compare Revisions

Ignore whitespace Rev 138 → Rev 139

/trunk/src/main/java/org/kawai/model/Language.java
14,13 → 14,19
private final int id;
private final String name;
private final Locale loc;
private final String imageFile;
 
public Language(int code, String name, String locale) {
public Language(int code, String name, String locale, String imageFile) {
this.id = code;
this.name = name;
this.loc = getLocaleFromString(locale);
this.imageFile = imageFile;
}
public Language(int code, String name, String locale) {
this(code, name, locale, null);
}
public static void add(Language language) {
LANGUAGES.add(language);
}
42,6 → 48,10
return loc;
}
public String getImageFile() {
return imageFile;
}
@Override
public String toString() {
return name;
/trunk/src/main/java/org/kawai/AppManager.java
33,6 → 33,7
import org.mentawai.filter.MentaContainerFilter;
import org.mentawai.filter.TransactionFilter;
import org.mentawai.filter.ValidationFilter;
import org.mentawai.i18n.LocaleManager;
import org.mentawai.transaction.JdbcTransaction;
 
public class AppManager extends ApplicationManager {
129,12 → 130,17
 
@Override
public void loadLocales() {
Language en = new Language(1, "English", "en");
Language.add(en);
Language pt = new Language(2, "Portuguese", "pt");
Language.add(pt);
addLocale(en.getLocale());
addLocale(pt.getLocale());
List<String[]> languages = props.getArrays("languages");
for(int i = 0; i < languages.size(); i++) {
String[] array = languages.get(i);
Language l = new Language(i + 1, array[0], array[1], array[2]);
Language.add(l);
addLocale(l.getLocale());
}
LocaleManager.stopLocaleScan();
}
@Override
/trunk/src/main/webapp/WEB-INF/conf/default/appManager.properties
8,5 → 8,8
# kCodes Tags
kcodes = Code, ContextPath, PageLink
 
# Languages supported
languages = [ ["English", "en", "flag_usa.gif"] , ["Portuguese", "pt", "flag_brazil.gif"] ]