The language attribute just sets the language of the email with regards to labels.
It doesn't mean that it will take this specific template if the recipient language is French.
You need to create Custom Labels for the text you want to have translated. You can then set translated values for each of the languages that you support in those labels. In your example then the French value will be displayed.
You can also make it dynamic based on the language of the recipient with something like this:
<messaging:emailTemplate recipientType="Contact"
relatedToType="Account"
language="{!recipient.language__c}"
subject="{!$Label.email_subject}"
replyTo="[email protected]" >
<messaging:htmlEmailBody >
<html>
<body>
<p>{!$Label.email_greeting} {!recipient.name}--</p>
<p>{!$Label.email_body}</p>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
This takes a custom field on Contact, language__c
, which contains language keys like fr, en, de
etc.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_messaging_emailTemplate.htm
Update:
You can use parameters in your label. This way you don't need 2 labels in your example, one for 'Dear' and one for the rest of the text, but just 1.
If you define your label as 'Dear {0}, This should all be in French. But its not.'
, you can then use the following code to merge the {!relatedTo.Applicant_Name__c}
into the label like this:
<apex:outputText value="{!$Label.YourLabelName}" >
<apex:param value="{!relatedTo.Applicant_Name__c}" />
</apex:outputText>