11<template >
22 <section v-show =" isActive" id =" error-handling" class =" mb-16" >
33 <div class =" mb-8" >
4- <h1 class =" text-3xl font-bold text-gray-900 mb-4" >Error Handling </h1 >
5- <p class =" text-lg text-gray-600" >HTTP status codes and error responses </p >
4+ <h1 class =" text-3xl font-bold text-gray-900 mb-4" >{{ t('documentation.errorHandling.title') }} </h1 >
5+ <p class =" text-lg text-gray-600" >{{ t('documentation.errorHandling.subtitle') }} </p >
66 </div >
77
88 <div class =" bg-white rounded-2xl shadow-lg border border-gray-200 overflow-hidden" >
99 <div class =" bg-gradient-to-r from-red-600 to-rose-600 px-8 py-6" >
10- <h2 class =" text-2xl font-bold text-white mb-2" >Error Handling </h2 >
11- <p class =" text-red-100" >HTTP status codes and error responses </p >
10+ <h2 class =" text-2xl font-bold text-white mb-2" >{{ t('documentation.errorHandling.title') }} </h2 >
11+ <p class =" text-red-100" >{{ t('documentation.errorHandling.subtitle') }} </p >
1212 </div >
1313
1414 <div class =" p-8" >
1515 <!-- Status Codes -->
1616 <div class =" mb-8" >
17- <h3 class =" text-xl font-semibold text-gray-900 mb-4" >HTTP Status Codes </h3 >
17+ <h3 class =" text-xl font-semibold text-gray-900 mb-4" >{{ t('documentation.errorHandling.httpStatusCodes') }} </h3 >
1818 <div class =" grid gap-4" >
1919 <div class =" flex items-center p-4 bg-green-50 border border-green-200 rounded-lg" >
2020 <div class =" w-16 h-8 bg-green-500 text-white text-sm font-bold rounded flex items-center justify-center mr-4" >200</div >
2121 <div >
22- <div class =" font-semibold text-gray-900" >OK </div >
23- <div class =" text-sm text-gray-600" >Request successful </div >
22+ <div class =" font-semibold text-gray-900" >{{ t('documentation.errorHandling.statusCodes.200.title') }} </div >
23+ <div class =" text-sm text-gray-600" >{{ t('documentation.errorHandling.statusCodes.200.description') }} </div >
2424 </div >
2525 </div >
2626
2727 <div class =" flex items-center p-4 bg-red-50 border border-red-200 rounded-lg" >
2828 <div class =" w-16 h-8 bg-red-500 text-white text-sm font-bold rounded flex items-center justify-center mr-4" >400</div >
2929 <div >
30- <div class =" font-semibold text-gray-900" >Bad Request </div >
31- <div class =" text-sm text-gray-600" >Invalid parameters or malformed request </div >
30+ <div class =" font-semibold text-gray-900" >{{ t('documentation.errorHandling.statusCodes.400.title') }} </div >
31+ <div class =" text-sm text-gray-600" >{{ t('documentation.errorHandling.statusCodes.400.description') }} </div >
3232 </div >
3333 </div >
3434
3535 <div class =" flex items-center p-4 bg-red-50 border border-red-200 rounded-lg" >
3636 <div class =" w-16 h-8 bg-red-500 text-white text-sm font-bold rounded flex items-center justify-center mr-4" >404</div >
3737 <div >
38- <div class =" font-semibold text-gray-900" >Not Found </div >
39- <div class =" text-sm text-gray-600" >Endpoint or resource not found </div >
38+ <div class =" font-semibold text-gray-900" >{{ t('documentation.errorHandling.statusCodes.404.title') }} </div >
39+ <div class =" text-sm text-gray-600" >{{ t('documentation.errorHandling.statusCodes.404.description') }} </div >
4040 </div >
4141 </div >
4242
4343 <div class =" flex items-center p-4 bg-yellow-50 border border-yellow-200 rounded-lg" >
4444 <div class =" w-16 h-8 bg-yellow-500 text-white text-sm font-bold rounded flex items-center justify-center mr-4" >429</div >
4545 <div >
46- <div class =" font-semibold text-gray-900" >Too Many Requests </div >
47- <div class =" text-sm text-gray-600" >Rate limit exceeded </div >
46+ <div class =" font-semibold text-gray-900" >{{ t('documentation.errorHandling.statusCodes.429.title') }} </div >
47+ <div class =" text-sm text-gray-600" >{{ t('documentation.errorHandling.statusCodes.429.description') }} </div >
4848 </div >
4949 </div >
5050
5151 <div class =" flex items-center p-4 bg-red-50 border border-red-200 rounded-lg" >
5252 <div class =" w-16 h-8 bg-red-600 text-white text-sm font-bold rounded flex items-center justify-center mr-4" >500</div >
5353 <div >
54- <div class =" font-semibold text-gray-900" >Internal Server Error </div >
55- <div class =" text-sm text-gray-600" >Server encountered an unexpected error </div >
54+ <div class =" font-semibold text-gray-900" >{{ t('documentation.errorHandling.statusCodes.500.title') }} </div >
55+ <div class =" text-sm text-gray-600" >{{ t('documentation.errorHandling.statusCodes.500.description') }} </div >
5656 </div >
5757 </div >
5858 </div >
5959 </div >
6060
6161 <!-- Error Response Format -->
6262 <div >
63- <h3 class =" text-xl font-semibold text-gray-900 mb-4" >Error Response Format </h3 >
63+ <h3 class =" text-xl font-semibold text-gray-900 mb-4" >{{ t('documentation.errorHandling.errorResponseFormat') }} </h3 >
6464 <div class =" bg-gray-50 rounded-xl p-6" >
6565 <div class =" grid lg:grid-cols-2 gap-6" >
6666 <div >
67- <h4 class =" font-semibold text-gray-900 mb-3" >Error Response </h4 >
67+ <h4 class =" font-semibold text-gray-900 mb-3" >{{ t('documentation.errorHandling.errorResponse') }} </h4 >
6868 <div class =" bg-gray-900 rounded-lg p-4 font-mono text-sm" >
6969 <div class =" text-blue-400" >{</div >
7070 <div class =" ml-2" >
8282 </div >
8383
8484 <div >
85- <h4 class =" font-semibold text-gray-900 mb-3" >Error Fields </h4 >
85+ <h4 class =" font-semibold text-gray-900 mb-3" >{{ t('documentation.errorHandling.errorFields') }} </h4 >
8686 <div class =" space-y-3 text-sm" >
8787 <div class =" flex" >
8888 <code class =" bg-white px-2 py-1 rounded text-blue-600 mr-3 font-mono" >status</code >
89- <span class =" text-gray-600" >Always "error" for error responses </span >
89+ <span class =" text-gray-600" >{{ t('documentation.errorHandling.fieldDescriptions.status') }} </span >
9090 </div >
9191 <div class =" flex" >
9292 <code class =" bg-white px-2 py-1 rounded text-blue-600 mr-3 font-mono" >code</code >
93- <span class =" text-gray-600" >HTTP status code</span >
93+ <span class =" text-gray-600" >{{ t('documentation.errorHandling.fieldDescriptions. code') }} </span >
9494 </div >
9595 <div class =" flex" >
9696 <code class =" bg-white px-2 py-1 rounded text-blue-600 mr-3 font-mono" >message</code >
97- <span class =" text-gray-600" >Human-readable error message</span >
97+ <span class =" text-gray-600" >{{ t('documentation.errorHandling.fieldDescriptions. message') }} </span >
9898 </div >
9999 <div class =" flex" >
100100 <code class =" bg-white px-2 py-1 rounded text-blue-600 mr-3 font-mono" >details</code >
101- <span class =" text-gray-600" >Additional error information </span >
101+ <span class =" text-gray-600" >{{ t('documentation.errorHandling.fieldDescriptions.details') }} </span >
102102 </div >
103103 </div >
104104 </div >
111111</template >
112112
113113<script setup lang="ts">
114+ import { useI18n } from ' vue-i18n'
115+
114116interface Props {
115117 isActive: boolean
116118}
117119
118120defineProps <Props >()
121+ const { t } = useI18n ()
119122 </script >
0 commit comments