-
Notifications
You must be signed in to change notification settings - Fork 0
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
I18n for Errors #4
Comments
Hey @tembra , |
@johannesschobel sorry for late answer. I like your idea of use Something like this: <?php
use Mytdt\JsonApi\Errors\MyJsonApiErrors;
class AppErrorCodes extends MyJsonApiErrors
{
const RESOURCE_NOT_FOUND = 1;
protected static $errors = [
self::RESOURCE_NOT_FOUND => [
'title' => 'Resource not found',
'detail' => 'The requested resource was not found'
'languages' => [
'pt_BR' => [
'title' => 'Recurso não encontrado',
'detail' => 'O recurso solicitado não foi encontrado.'
]
],
];
} Then when return error object all we need to do is verify which language to use and get properly If you feel comfort to implement something like this or have another vision/way to do so, you're welcome to contribute to this package and send a PR. |
Hey @tembra ,
I just wanted to drop a line and ask, if it is possible to add an "internationalization" (i18n) feature for your plugin.
I really like it and use it in my current project. However, I need to output exceptions in different languages (depending on the user's
Accept-Language
).Can you give me a feedback on this topic?
Cheers from Germany
The text was updated successfully, but these errors were encountered: