the website I work on was developped in french(FR) and I recently developped the multilingual aspect to translate the website in english(EN), for this, I used the translator bundle. Here are my configs files :
translation.yaml
services.yaml
I also created a messages.en.xlf file with all my customs messages translated from french to english, and it works.
Here is my problem : I want to translate all the default form errors.
My form with default locale: FR
My form with default locale EN
The language change has been detected and the tittle has been translated. But my error message is still the same.
What can I do about it ? Do I have to manually translate all the displayed messages with some JS ?
Thankx.
This validation and error messages come from HTML5 and language is based on your browser settings.
If you want to force english try adding this into your template:
<meta http-equiv="Content-Language" content="en">
Actually, you're doing right. It's juste because this is not a Symfony message, so you can't translate it.
This message come from your browser. Only displayed when an input has required attribute.
Related
I've been building a TYPO3 website. I wanted to use the multi-language capacity of TYPO3 and get acquainted with the CMS. I'm using V.9.5.6 at the moment with the Introduction Package.
I followed the manual on multi-language setup here : https://docs.typo3.org/m/typo3/guide-frontendlocalization/9.5/en-us/Index.html
When switching languages, the page refreshes but no visible changes occur.
I deleted the original "German" et "Dansk" languages, then added "French" and "German". I used the contact page as proving grounds.
I added translations in germand and french from the original english page I built. There's only a header and a contact form. In english, it reads "contact form". In german and french it should read respectively "Kontaktieren Sie uns" and "Contactez-nous".
The languages UIDs are 2 for German and 3 for French. The template, in the languages section, has "auto" for the list of languages and it pulls correctly the 2 I added, in the correct order.
In a properly setup website, if default language is English, and I click on the "German" or "French" language button at the bottom, the page should refresh and display the content translated in the language I selected and have the selected language in bold at the bottom of the page.
When clicking on the bottom links, it adds the correct L= parameter and the page loads but no visible change occur on the page. Even the language link at the bottom of the page has "Default" in bold instead of whatever I clicked.
There is NO error message when clicking on the language buttons.
I'm pretty sure this is not the standard behavior of a TYPO3 multi-lingual installation. What can cause the CMS to not fetch a translated content OR fail to get the language change information from the parameters passed in the URL ?
I'll try to answer this vague question.
Usually there are three pitfalls you should look at:
realurl (or routes in v9) here is a nice gist: https://gist.github.com/koehlersimon/9dcbabb6b1b2adcbc84db96fd144fb08
TypoScript settings for the languages: https://docs.typo3.org/m/typo3/guide-frontendlocalization/9.5/en-us/TyposcriptConfiguration/Index.html#typoscript-configuration
proper .htaccess in connection with [1.]
I also suggest to update to v 9.5.9
There have been plenty bugfixes since v 9.5.6 and updating within branch 9.5.X is really easy and non-breaking!
I made a newsletter form with double opt-in in powermail.
There is no problem in the standard language (german).
When I fill it out on my english page I get a confirmation mail.
Opening the link inside opens the confirmation page with no error but there is no mail afterwards.
The german and english form / configuration are identical.
I tried changing the sender and receiver values but nothing works.
I appreciate any help, advice or idea :)
TYPO3 Version 8.7.9
Powermail Version 6.1.0
Try to not use config.sys_language_mode=strict. At the moment the situation is that powermail always stores mails with sys_language_uid=0. If you are using the strict mode for language fallback in general, powermail is not able to read the answers in a different language.
This behaviour isn't that easy to fix.
After some research I found this Extension which lead me to this github Issue:
https://extensions.typo3.org/extension/powermail_optin_fix/
https://github.com/einpraegsam/powermail/issues/213
This Extension solved my problem!
DI Michael Ganner wrote:
When using OptIn on translated pages, the {powermail_all} marker in
the 2nd mail and 2nd confirmation page (after clicking the
confirmation-link) is empty. Reason: The answers of the mail are not
loaded in other languages than the default one.
I "solved" the issue quick and dirty by adding the function
'gugler_addAnswers' to the FormController. This function is called in
FormController->optinConfirmAction():
On my site where Danish is default language and English is second language, I have a PowerMail form.
But the error messages at mandatory fields will only show in default language, Danish.
Why?
if i'm not mistaken, the lang files for powermail errors comes from the jquery validation language file.
So, probably this file is not loaded.
Not an answer, but could give you a clue
I have my default language set as English (US) in the facebook app settings.
The "detailed description" field is filled with english language content.
In the section "Translate your app for additional languages" I have "detailed description" field with original english gray fade color text.
When I paste there the text translated into polish and trying to save it, I get the error message:
"Błąd
Oryginalne zdanie, na którym oparte jest tłumaczenie już nie istnieje.
There was a problem saving your changes. Please try again later."
which means:
"Error
Original sentence, the translation is based on doesn't exist any more.
There was a problem saving your changes. Please try again later."
The rest of the translated fields are saveable for translation, only the "detailed description" doesn't allow to save translation. Do you have any idea, what is going on. Does anyone had this kind of problem. I couldn't google any solution to this one.
I've had this kind of problem before with the translation features on FB.
Firstly - if you use completely different text for testing purposes does that save?
If you get the same error with any text at all entered it would suggest the problem is not the content by that Facebook has a bug with the system.
You can report bugs to Facebook at:
https://developers.facebook.com/bugs/
If alternative content works - try editing your content, it may be that there's a special character or similar (perhaps not even visible) that is breaking things. Pasting the text into a plain text editor like notepad and copying back out can help strip those kind of things.
I am trying to make this decision on what content (Messages) to be displayed based on the useragent. Everything works correctly when I user query param, or a meta tag. it also works correctly in Firefox. In firefox I change the language from english to french, reload the page and everything comes up correctly. This is baed on the useragent. If I load the page in chrome/IE I get the default (English) only. If I set my system language to French (my other language) everything seems to work as well. Any ideas why setting the language in chrome and IE have no affect no the content? I verified the headers and the requests are being made for French content? What am I missing?
My gwt.xml file is based on the one I found here http://code.google.com/p/google-web-toolkit/source/browse/releases/2.3/user/src/com/google/gwt/i18n/I18N.gwt.xml
It was my understanding that all I needed to add was the following to my gwt.xml
set-configuration-property name="locale.useragent" value="Y"
Also I found the following Why does GWT ignore browser locale? which seems to indicate it won't work in IE but what about chrome?
See http://code.google.com/p/google-web-toolkit/issues/detail?id=4228
TL;DR: there's no reliable way of getting the info you're looking at in JavaScript, the navigator object gives you the locale of the browser (i.e. the one used for the browser's own menus et al.), not the user's language preferences (except in Firefox).
Your best bet is to use a dynamic host page and generate the appropriate <meta> on the server depending on the request headers (i.e. content negotiation).