Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api to retrieve localization #141

Open
Postremus opened this issue Jan 20, 2025 · 2 comments
Open

Add api to retrieve localization #141

Postremus opened this issue Jan 20, 2025 · 2 comments

Comments

@Postremus
Copy link

Description

In my application I needed to retrieve the translations from keycloak.

I defined the themeapi myself, and used the restclientbuilder to invoke it. However, could this project maybe offer inbuild?

 @Produces(MediaType.APPLICATION_JSON)
    @Path("resources")
    interface ThemeAPI {

        @GET
        @Path("/{realm}/{themeType}/{locale}")
        List<KeySource> getLocalizationTexts(@PathParam("realm") String realmName, @QueryParam("theme") String theme,
                @PathParam("locale") String localeString, @PathParam("themeType") String themeType, @QueryParam("source") boolean showSource);
    }

Discussion

No response

Motivation

No response

Details

No response

@mposolda
Copy link
Contributor

@Postremus I belive this is already available? Can you check the admin console? The admin console uses admin REST API under the covers, so if the functionality is available in the admin console, it is available in admin REST API as well. It is maybe just calling proper endpoint might do the trick?

@Postremus
Copy link
Author

Postremus commented Jan 21, 2025

Yes, there is an API available, however it is not an admin rest api.

<keycloak-url>/resources/<realm>/<themeType>/<locale>

I did not find anything in the admin-client, or any of the other clients in this project, to access this resource.

I can access the realm localizations using keycloak.realm().localizations(). However, I would prefer to work directly with the effective translations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants