You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# it's not enough for all errors, but for 400 bad request as a startmsgid"ClientError.error_message"msgstr"Bad request."# obviously error_message field is dynamic then you might need more messages# uncomment more strings and specify IDs for them# msgid "ClientError.error_message.2"# msgstr ""# msgid "ClientError.error_message.3"# msgstr ""
ru_RU.po will be identical but user fills in russian translations.
Describe alternatives you've considered
And even more crazy idea. It's really boring to document hundreds of errors in every project. What about multilingual API Error Codes Book file? I think that 99% of APIs use static codes for errors and most of time they are hardcoded. We can generate .po file with error codes mapped to HTTP Status Codes from official standard. We can add template for custom errors like msgid "error_555" etc. If developer uses error code 555 he uncomments this line and adds appropriate message translation.
After that PHP user can use translations with gettext extension like:
Is your feature request related to a problem? Please describe.
Imagine multilingual API. There are hardcoded messages which should be translated. The first thing comes to mind is error messages.
Describe the solution you'd like
en_US.po
file:ru_RU.po
will be identical but user fills in russian translations.Describe alternatives you've considered
And even more crazy idea. It's really boring to document hundreds of errors in every project. What about multilingual API Error Codes Book file? I think that 99% of APIs use static codes for errors and most of time they are hardcoded. We can generate
.po
file with error codes mapped toHTTP Status Codes
from official standard. We can add template for custom errors likemsgid "error_555"
etc. If developer uses error code 555 he uncomments this line and adds appropriate message translation.After that PHP user can use translations with
gettext
extension like:cc special invite to @jimschubert
The text was updated successfully, but these errors were encountered: