Post by ciprianivan » Thu Jun 06, 2019 5:35 pm

Hello, I was wondering how to change the API response language. After some searching, i found out that specifying the header 'X-Oc-Merchant-Language' would be the answer. But, It does not seem to work.
Is there another way to do it? I'm using Opencart 3.0.2

Newbie

Posts

Joined
Thu Jun 06, 2019 5:32 pm

Post by straightlight » Thu Jun 06, 2019 7:01 pm

Vague posting. Please read the forum rules.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by thekrotek » Thu Jun 06, 2019 7:15 pm

There're like billion APIs all over internet. You need to be more specific.

And if you're talking about OpenCart API, then in returns you data in your current language.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member
Online

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Thu Jun 06, 2019 7:25 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Fri Jun 07, 2019 8:24 am

Rule #4 is incomplete on that link as compared to the original forum rules. It does not dictate the Commercial Support section of the forum for custom codes.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Fri Jun 07, 2019 4:14 pm

straightlight wrote:
Fri Jun 07, 2019 8:24 am
Rule #4 is incomplete on that link as compared to the original forum rules. It does not dictate the Commercial Support section of the forum for custom codes.
Ah ha, it does mention that further down though.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Fri Jun 07, 2019 7:44 pm

paulfeakins wrote:
Fri Jun 07, 2019 4:14 pm
straightlight wrote:
Fri Jun 07, 2019 8:24 am
Rule #4 is incomplete on that link as compared to the original forum rules. It does not dictate the Commercial Support section of the forum for custom codes.
Ah ha, it does mention that further down though.
While it may or may not be located further down, step #4 is still incomplete since this information should of been provided there. My previous reply did not dictated that you did not addressed the Commercial Support section of the forum period but rather indicating that you did not indicated the Commercial Support section of the forum on step 4 since this is the most relative step. Doesn't matter, still, the official forum rules are there for those reasons in case.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Fri Jun 07, 2019 7:46 pm

Meanwhile the OP has gone quiet?

If they could provide further info we are all ready to help!

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by tolinho » Mon Sep 16, 2019 10:45 pm

Hi,
I came across this thread because I searched for the exact same title.
But I will try and explain the issue a bit better :)

In Opencart fresh install 3.0.3.2 with two language installed and all files translated (EN - en-gb; PT - pt-pt)

With admin, set to a secondary language, PT.
When I update order status the success message displayed to admin will be in English (Success: You have modified orders!).
I guess because it loaded the catalog/language/en-gb/api/order.php for the default language in opencart that is en-gb
$_['text_success'] = 'Success: You have modified orders!';
Via: catalog/controller/api/order.php
$this->load->language('api/order');

My question is:
Is where a way to set the API response language?
Sure I can edit the english file and edit the text has I need, but that is not the correct way

Thanks.

New member

Posts

Joined
Sat Jul 21, 2012 2:01 am

Post by thekrotek » Mon Sep 16, 2019 11:49 pm

API is making calls to frontend functions, so yes, your frontend language will be used to display messages. There's no any kind of option to change that, only if you create a modification of sorts.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member
Online

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 21 guests