Skip to content

Commit

Permalink
feat(contact): translate error message
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Jan 3, 2025
1 parent a725ded commit cf79293
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 40 deletions.
36 changes: 1 addition & 35 deletions apps/romainlanz.com/adonisrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,13 @@ export default defineConfig({
onBuildStarting: [() => import('@adonisjs/vite/build_hook')],
},

/*
|--------------------------------------------------------------------------
| Commands
|--------------------------------------------------------------------------
|
| List of ace commands to register from packages. The application commands
| will be scanned automatically from the "./commands" directory.
|
*/
commands: [
() => import('@adonisjs/core/commands'),
() => import('@adonisjs/bouncer/commands'),
() => import('@adonisjs/mail/commands'),
() => import('@tuyau/core/commands'),
],

/*
|--------------------------------------------------------------------------
| Service providers
|--------------------------------------------------------------------------
|
| List of service providers to import and register when booting the
| application
|
*/
providers: [
() => import('@adonisjs/core/providers/app_provider'),
() => import('@adonisjs/core/providers/hash_provider'),
Expand All @@ -54,30 +36,14 @@ export default defineConfig({
() => import('@tuyau/core/tuyau_provider'),
],

/*
|--------------------------------------------------------------------------
| Preloads
|--------------------------------------------------------------------------
|
| List of modules to import before starting the application.
|
*/
preloads: [
() => import('#start/routes'),
() => import('#start/kernel'),
() => import('#start/events'),
() => import('#start/global'),
() => import('#start/vine'),
],

/*
|--------------------------------------------------------------------------
| Tests
|--------------------------------------------------------------------------
|
| List of test suites to organize tests by their type. Feel free to remove
| and add additional suites.
|
*/
tests: {
suites: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default class DetectUserLocaleMiddleware {
* Using i18n for validation messages. Applicable to only
* "request.validateUsing" method calls
*/
static {
RequestValidator.messagesProvider = (ctx) => {
return ctx.i18n.createMessagesProvider();
};
}
// static {
// RequestValidator.messagesProvider = (ctx) => {
// return ctx.i18n.createMessagesProvider();
// };
// }

/**
* This method reads the user language from the "Accept-Language"
Expand Down
6 changes: 6 additions & 0 deletions apps/romainlanz.com/start/vine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import vine, { SimpleMessagesProvider } from '@vinejs/vine';

vine.messagesProvider = new SimpleMessagesProvider({
required: 'Le champ {{ field }} est obligatoire',
email: 'Le champ {{ field }} doit être une adresse email valide',
});

0 comments on commit cf79293

Please sign in to comment.