Skip to content
Permalink
Browse files

Added support for server defined default language

  • Loading branch information...
carlosbpf committed Mar 8, 2019
1 parent ca80ebb commit 541bc4043a616f9c0333d43d5151aad543c3e12b
@@ -28,7 +28,7 @@ function startView {
fi
rm ${OUT_FILE} > /dev/null 2>&1
exec java -Xmx${maxMem} -Xms1G -XX:-OmitStackTraceInFastThrow \
-jar ${VIEW}-1.0-SNAPSHOT.war > ${OUT_FILE} & echo $! > ${PID_FILE}
-Duser.language=en -Duser.country=US -jar ${VIEW}-1.0-SNAPSHOT.war > ${OUT_FILE} & echo $! > ${PID_FILE}
fi
}

@@ -14,7 +14,8 @@
public final class I18nUtils {

public static final String MEMBER_LOCALE_SESSION_IDENTIFIER = "memberLocale";
public static final Locale DEFAULT_LOCALE = Locale.US;

public static final Locale DEFAULT_LOCALE = Locale.getDefault();
public static final String DEFAULT_LANGUAGE = DEFAULT_LOCALE.getLanguage();

private static final Map<String, String> codeToLocale = new HashMap<>();
@@ -9,6 +9,7 @@
import org.xcolab.client.admin.attributes.platform.PlatformAttributeKey;
import org.xcolab.client.admin.enums.ServerEnvironment;
import org.xcolab.commons.servlet.ManifestUtil;
import org.xcolab.util.i18n.I18nUtils;

import java.util.Optional;

@@ -41,5 +42,8 @@ public void run(ApplicationArguments applicationArguments) {
log.warn("Running in NON PRODUCTION environment. For production use, please set the"
+ " server environment to {}.", ServerEnvironment.PRODUCTION);
}

log.info("Running with default locale : {}", I18nUtils.DEFAULT_LOCALE.getCountry() + "_" + I18nUtils.DEFAULT_LOCALE.getLanguage());

}
}

0 comments on commit 541bc40

Please sign in to comment.
You can’t perform that action at this time.