Implement localization for API responses and error messages
- Added localization support for API responses in English and Spanish. - Introduced a middleware to set the API locale based on the Accept-Language header. - Updated various exception messages and validation responses to use localized strings. - Created new language files for English and Spanish translations. - Refactored existing code to replace hardcoded messages with localized strings. - Added tests to verify localization functionality and response correctness.
This commit is contained in:
@@ -31,7 +31,7 @@ class TenantIntegrationControllerTest extends TestCase
|
||||
Mockery::on(fn (Integration $argument) => $argument->is($integration)),
|
||||
['api_key' => 'secret']
|
||||
)
|
||||
->andReturn(new TenantIntegration());
|
||||
->andReturn(new TenantIntegration);
|
||||
});
|
||||
|
||||
$this->postJson('/api/test-tenant/integrations/test_integration', [
|
||||
@@ -40,7 +40,8 @@ class TenantIntegrationControllerTest extends TestCase
|
||||
],
|
||||
])->assertOk()
|
||||
->assertExactJson([
|
||||
'message' => 'integration configured correctly',
|
||||
'code' => 'integration.configured',
|
||||
'message' => 'Integración configurada correctamente.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user