Webservices API language load seems stuck in en-GB

27 views
Skip to first unread message

GhiaMar

unread,
Jul 5, 2022, 11:49:00 AM7/5/22
to Joomla! General Development
Hi!

Attached I send a screenshot showing that Joomla webservices language load somehow defaults to en-GB despite I have set both, front and back languages to default to es-ES

Is there any way to set webservices language to es-ES or it's expected that all webservices language be en-GB?

Thanks!


Sin nombre.png

MarkRS

unread,
Jul 6, 2022, 7:55:04 AM7/6/22
to Joomla! General Development
I'm really not sure what that image shows, but based on your previous conversations I'm guessing it's for an API.

No, I don't think the API router recognises grw normal Joomla language system. Personally on my app I've stuffed language information in the header and then extracted it from there.

GhiaMar

unread,
Jul 6, 2022, 9:16:20 AM7/6/22
to Joomla! General Development
Hi @MarkRS! thanks for the reply!

The message subject states that I'm working with the webservices API.

Checking the api/languages folder I can see that both languages are there but they are quite little in lang files, I guess that's because most of the lang constant get loaded from the component itself, like in my case, that a table check produces some lang output that gets loaded from my administrator/com_component/language/en-GB, but it should look for administrator/com_component/language/es-ES as as long as I understand, is the admin language set.

Maybe Joomla should add another setting to set default language for API applications

GhiaMar

unread,
Jul 6, 2022, 9:17:35 AM7/6/22
to Joomla! General Development
Forgot to add the api/languages screenshot
Captura de pantalla de 2022-07-06 10-13-27.png

MarkRS

unread,
Jul 6, 2022, 9:52:19 AM7/6/22
to Joomla! General Development
Yes, I haven't quite  understood the webservices things yet, I'm getting there :)

Check the API router as compared to the main one(s). I think you'll find the problem is there. If not, I'd be interested to know where/why it is.

So yes, I think it would be a good idea to log this as an issue/bug in the github repository.

GhiaMar

unread,
Jul 6, 2022, 9:56:29 AM7/6/22
to Joomla! General Development
The webservice plugins clearly load all language files but only for en-GB not taking into account the default admin language

shumisha

unread,
Jul 7, 2022, 7:07:25 AM7/7/22
to Joomla! General Development
>  but only for en-GB not taking into account the default admin language

That's because the API is a separate application. Just like you have the installation application, the admin application, the frontend application, the API has been implemented as a separate Joomla application.
And so it's not aware of the Joomla frontend or backend, and their language.

When you use the API, I think it helps understanding how it works if you consider that you are using from an app on a mobile phone: it does not know anything about the site context.
That's also why if you logged-in to the admin or frontend, and building a component with the API, your API calls are not going to be "logged-in". Sessions are not shared between the API application and the others.

GhiaMar

unread,
Jul 7, 2022, 8:37:38 AM7/7/22
to Joomla! General Development
Thanks @shumisha ! I'm aware, after reading webservices docs, that it's a complete separate application, but despite that, I somehow missed this part of the docs https://docs.joomla.org/Joomla_Api_Specification#Language_Negotiation which states that lang negotiation is not supported.
Reply all
Reply to author
Forward
0 new messages