Uniform multi language labels in template mailbox

I have a multi language contact form. But when i receive de mail in my mailbox from de contact form, the labels are in English.
How can i get them in french er dutch?

In mail box:

Name: test
Message: qsqsq


Controller -> contact.php

<?php

return function($site, $pages, $page) {
    $form = uniform('contact-form', [
        'required' => [
            'name'  => '',
			'message' => '',
            '_from' => 'email'
        ],
        'actions' => [
            [
                '_action' => 'email',
                'to'      => $site->to()->html(),
                'sender'  => 'mail@mail.com,
                'subject' => $site->subject()->html(),
		'snippet' => 'uniform-email-default'
            ]
        ]
    ]);

    return compact('form');
};

Template -> contact.php

<form action="<?php echo $page->url()?>#form" method="post">
	<div class="row">
		<div class="col-md-6">
			<label for="name" class="required"><?php echo l::get('name') ?></label>
			<input<?php e($form->hasError('name'), ' class="erroneous"')?> type="text" name="name" id="name" value="<?php $form->echoValue('name') ?>" />
		</div>
		<div class="col-md-6">
			<label for="email" class="required"><?php echo l::get('email') ?></label>
			<input<?php e($form->hasError('_from'), ' class="erroneous"')?> type="email" name="_from" id="email" value="<?php $form->echoValue('_from') ?>" />
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<label for="message" class="required"><?php echo l::get('message') ?></label>
			<textarea<?php e($form->hasError('message'), ' class="erroneous"')?> name="message" id="message"><?php $form->echoValue('message') ?>
</textarea>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<label class="uniform__potty" for="website">Please leave this field blank</label>
			<input type="text" name="website" id="website" class="uniform__potty" />
			<a name="form"></a>
			<?php if ($form->hasMessage()): ?>
			<div class="message <?php e($form->successful(), 'success' , 'error')?>">
				<?php $form->echoMessage() ?>
			</div>
			<?php endif; ?>
			<button type="submit" name="_submit" value="<?php echo $form->token() ?>"<?php e($form->successful(), ' disabled')?>><?php echo l::get('submit') ?></button>
		</div>
	</div>
</form>

Uniform-email-default.php

<?php

foreach ($form as $field => $value) {
	if (str::startsWith($field, '_')) {
		continue;
	}

	if (is_array($value)) {
		$value = implode(', ', array_filter($value, function ($i) {
			return $i !== '';
		}));
	}

	echo ucfirst($field).': '.$value."\n";
}

You could change the email snippet and instead of directly echoing the field, you could get a language variable:

Instead of

echo ucfirst($field).': '.$value."\n";

you could put this line into your snippet:

echo l::get($field).': '.$value."\n";

In your language files you then define the language variable for the field strings.

Thx.

Is it possible to get the labels in bold and a new line like this:

Name:
test
Message:
qsqsq

<?php

foreach ($form as $field => $value) {
	if (str::startsWith($field, '_')) {
		continue;
	}

	if (is_array($value)) {
		$value = implode(', ', array_filter($value, function ($i) {
			return $i !== '';
		}));
	}

	echo l::get($field).': '.$value."\n";
}

Are you sending this as a plain text email or as html? If you send an html email you can add the respective html tags, otherwise you cannot have bold text in a plain text mail.

You can, however, put a new line command after the label:

echo l::get($field).':\n'.$value."\n";

Thx.

How can I make it for sending as HTML text?

From the docs:

For the HTML snippet to work, a html-mail email service is used that is not provided by this repo.
GitHub - mzur/kirby-uniform: A versatile Kirby plugin to handle web form actions.

You would have to write your own service, I guess, it’s similar to the procedure described here Is there a way to send HTML emails? - #2 by Luke