-
AuthorPosts
-
September 18, 2018 at 2:18 pm #1011296
Hi,
I would like to translate some words in conformation email generated by Contact Form.
Please give me the link to fitting Forum topic or PHP code to change the texts:
1. subject of confimation email – now I have “Thank you for your Message!”
2. Head of informations – now I have “Your Message:”
Thank you in advance
Jakub KortykaSeptember 18, 2018 at 5:05 pm #1011394Hey Jakub,
You need to go the enfold/lang/ folder look for your language and look for the phrase there and add your translation.
Then you will need to move this file to your child theme while preserving folder structure.
Best regards,
VictoriaSeptember 18, 2018 at 5:33 pm #1011418Thank you Victoria
is it possible to add some lines in General styling/Quick CSS ?
I rather don’t want to create child theme.
Where can I find enfold/lang/?
Best regards
JakubSeptember 18, 2018 at 6:02 pm #1011436Hi studio_trzypunkty,
This is not a css issue, it is a localization issue and it cannot be addressed by css.
You can do it in the parent theme, but make a document somewhere where you record the changes you made, so that when the next update comes and the files changes, you go and do the translation again.
Best regards,
VictoriaSeptember 19, 2018 at 1:25 pm #1011800Hi Victoria
thank you.
I found the enfold/lang on serwer and maid some changes but ater uploading I can not see any differences.
Automatic email with content “Your message:” which is sent to person who filled the Contact Form – has no changes.
What do you think – what did I wrong?
best regards
JakubSeptember 19, 2018 at 3:42 pm #1011866Hi Jakub,
Can you please send us your language file? You can post it on https://pastebin.com/ and give us the link here.
Best regards,
VictoriaSeptember 19, 2018 at 3:55 pm #1011875Hi
the link
https://pastebin.com/qCf0yNynfoe me most important line for now:
Your message: = Twoja wiadomość
Sending = Wysyłanie
Thank you for your message = Dziękujemy za wiadomośćI can not find line:
One or more fields have an error. Please check and try again.best regards
JakubSeptember 19, 2018 at 3:58 pm #1011877Maybe my Enfold doesn.t know he should use the language file?
And uses only enfold.pot?
JakubSeptember 19, 2018 at 4:01 pm #1011880OK – the line
“One or more fields have an error. Please check and try again.”
comes form Contact Form 7 plugin
That can I change in plugin setting.
JakubSeptember 19, 2018 at 4:08 pm #1011884September 19, 2018 at 5:05 pm #1011924Hi Victoria
I use poedit – maybe here is the problem.
The look of the content is different.
Thank you and sorry – I am not a programmer and I have some problems with this technical things.
Your image you have sent me – is it *.po file?
In what kind of application?best regards
JakubSeptember 20, 2018 at 2:53 pm #1012340Hi,
If you don’t use a child theme I’d recommend to create a small plugin, otherwise the code will be removed on every theme update.You can use following code for the plugin to translate the “Your message” text to “Twoja wiadomość”:
<?php /* Plugin Name: Enfold Custom Code Description: Enfold Custom Code Version: 1.0 Author: InoPlugs Plugin URI: https://inoplugs.com Author URI: https://inoplugs.com */ function avf_form_autorespondermessage_mod($message) { $message = str_replace('Your Message:', 'Twoja wiadomość:', $message); return $message; } add_filter('avf_form_autorespondermessage', 'avf_form_autorespondermessage_mod', 10, 1);
Add this code to a text file and save it as enfold_custom.php Then upload this text file via ftp to the wp-content/plugins/ directory. Afterwards go to the wordpress admin panel > Plugins and activate the new plugin.
If you want to install it as a plugin via wordpress you need to use a tool like 7zip to convert the enfold_custom.php to a zip file (the file extension must then be .zip – enfold_custom.zip).
Best regards,
PeterSeptember 20, 2018 at 3:36 pm #1012358Hi Peter
Thank you for explanation. I think I will try this solution.
But I am still courious why the changes in *.po file are inevective. It seems to me quite comfortable solution to edit *.po and upload it via ftp.
But there is no effect of this activity. I think theme doesn’t know it shoud use this PL.po
As I know – there is only one place where I have checked the polish language of website – the main settings in WP panel. Is it enough?And one more thing – as I see – in this code there is a specifically indicated the area where we want to make some changes. Here – in avf_form_autorespondermessage ($message)
If I would like to make some changes in different areas – I would have to correctly indicate the right section of code. Am I right?best regards
JakubSeptember 21, 2018 at 11:26 am #1012716Hi,
1) The po file is the readable version of the translation but wordpress can’t interpret it. You can use a plugin like loco ( https://wordpress.org/plugins/loco-translate/ ) or a desktop software like Poedit ( https://poedit.net/ ) to edit the po file. Then click save and the plugin/Poedit should generate two files. One file is the (readable) version with the file extension .po, the other file is a compiled version of the translation with the extension .mo. You need to upload both files to the wp-content/themes/enfold/lang/ folder – i.e. for German upload the files de_DE.po and de_DE.mo). Both files are important because you can’t edit the mo directly but you need the po file to make changes to your translations. However wordpress requires the mo file to embed the translated text strings into your website.2) You can add custom code to the plugin code I posted above – just add it to the very bottom.
If I would like to make some changes in different areas – I would have to correctly indicate the right section of code. Am I right?
Yes Enfold offers many actions and filters (see https://www.wpbeginner.com/glossary/filter/ and https://www.wpbeginner.com/glossary/action/ ) which can be used to modify or extend the theme code. The filters are documented here: https://kriesi.at/documentation/enfold/hooks-and-filters/ – if you search for them (in the forum) you’ll find sample code snippets for most of them.
Best regards,
PeterSeptember 21, 2018 at 11:52 am #1012722Hi Peter
thanks a lot.
Your explanation are very helpfull.
I used poedit but I missed to upload mo file. Now I expect everyting will work correctly.
And I will try the custom plugin solution soon.I think we can close this topic. Thank you one more.
Best regards
JakubSeptember 21, 2018 at 12:11 pm #1012728Hi!
Great, glad I could help yxou :)Best regards,
Peter -
AuthorPosts
- The topic ‘Text translation in confirmation email’ is closed to new replies.