cPanel & WHM Version 94 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Ability to set language for cpanel API errors

jpratt shared this idea 8 years ago
Open Discussion

Currently the error messages from a Cpanel API call return in the language set by the customer. As a hosting provider, we don't want the API errors to be displayed in whatever language the customer set in their cpanel. We need them in English.

Please update your system so that API calls are not dependent on the cpanel language, but rather on our setting.

For example, we might get an error such as this:

Cpanel API returned

error: ubercompinformatica-com-br.dumaugames.com.br é propriedade de outro

usuário.

or

Cpanel API returned error: 此域已存在,没有被添加

I guess that means we have to temporarily change the customer's language to understand it or use translate.google.com?

Comments (6)

photo
1

At the API level, how do you propose making a distinction between errors that should be displayed to the user, and hence localized, and errors that should not be localized?


Many parts of our UI use our various API functions. Users tend to like seeing messages in their chosen language. If API error messages were in a language the user could not control, then the user could miss vital information.

photo
1

One option is to allow admins to enable a dual language display --the error in each language (one the admin chooses, one the user chooses--if the languages are different).


Another option is to distinguish the errors that are not seen by the user, and only seen at the admin level?

photo
2

From my co-worker:

"I would think that, when the language to report errors in needs changed, it would be added as an API2 parameter that all API calls could have, say, 'api_locale=en'. This would be the second option described."

photo
1

That is really what we are looking for: errors that are not for the user but are useful for debugging at the dev/admin level. We need this in our language to be useful.

photo
1

Hi,


There should be a way to translate the errors. Using the cPanel API on our website don't look professionnal for this reason if we compare with other solutions.

photo
1

api_locale=en parameters should be there. just add the parameter and let people translate the errors, so the same errors will be sent to the user, no matter if they are in cPanel or if they are using an external interface using the api!

Leave a Comment
 
Attach a file