diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_ca.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_ca.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_ca.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_ca.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_de.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_de.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_de.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_de.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_en.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_en.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_es.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_es.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_es.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_es.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_fr.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_fr.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_fr.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_fr.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_ja.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_ja.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_ja.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_ja.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_lt.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_lt.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_lt.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_lt.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_no.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_no.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_no.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_no.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_pt_BR.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_pt_BR.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_pt_BR.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_pt_BR.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_ru.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_ru.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_ru.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_ru.properties diff --git a/js/apps/admin-ui/maven-resources/theme-resources/messages/messages_zh_CN.properties b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_zh_CN.properties similarity index 100% rename from js/apps/admin-ui/maven-resources/theme-resources/messages/messages_zh_CN.properties rename to js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_zh_CN.properties diff --git a/services/src/main/java/org/keycloak/services/resources/ThemeResource.java b/services/src/main/java/org/keycloak/services/resources/ThemeResource.java index eb8758891c..d06407c1ec 100644 --- a/services/src/main/java/org/keycloak/services/resources/ThemeResource.java +++ b/services/src/main/java/org/keycloak/services/resources/ThemeResource.java @@ -103,15 +103,23 @@ public class ThemeResource { } @GET - @Path("/{realm}/{theme}/{locale}") + @Path("/{realm}/{themeType}/{locale}") @Produces(MediaType.APPLICATION_JSON) - public Response getLocalizationTexts(@PathParam("realm") String realmName, @PathParam("theme") String theme, - @PathParam("locale") String localeString, @QueryParam("source") boolean showSource) throws IOException { + public Response getLocalizationTexts(@PathParam("realm") String realmName, @QueryParam("theme") String theme, + @PathParam("locale") String localeString, @PathParam("themeType") String themeType, + @QueryParam("source") boolean showSource) throws IOException { final RealmModel realm = session.realms().getRealmByName(realmName); session.getContext().setRealm(realm); List result; - Theme theTheme = session.theme().getTheme(Theme.Type.valueOf(theme.toUpperCase())); + Theme theTheme; + final Theme.Type type = Theme.Type.valueOf(themeType.toUpperCase()); + if (theme == null) { + theTheme = session.theme().getTheme(type); + } else { + theTheme = session.theme().getTheme(theme, type); + } + final Locale locale = Locale.forLanguageTag(localeString); if (showSource) { Properties messagesByLocale = theTheme.getMessages("messages", locale); @@ -139,6 +147,7 @@ enum Source { THEME, REALM } + class KeySource { private String key; private String value;