Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #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 Kortyka

    #1011394

    Hey 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,
    Victoria

    #1011418

    Thank 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
    Jakub

    #1011436

    Hi 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,
    Victoria

    #1011800

    Hi 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
    Jakub

    #1011866

    Hi 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,
    Victoria

    #1011875

    Hi
    the link
    https://pastebin.com/qCf0yNyn

    foe 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
    Jakub

    #1011877

    Maybe my Enfold doesn.t know he should use the language file?
    And uses only enfold.pot?
    Jakub

    #1011880

    OK – 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.
    Jakub

    #1011884

    Hi Jakub,

    Hm… It is supposed to look more like:
    Image 2018-09-19 at 17.06.40.png

    Try changing this file
    /enfold/lang/pl_PL.po

    Best regards,
    Victoria

    #1011924

    Hi Victoria
    I use poedit – maybe here is the problem.
    The look of the content is different.
    printscreen
    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
    Jakub

    #1012340

    Hi,
    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,
    Peter

    #1012358

    Hi 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
    Jakub

    #1012716

    Hi,
    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,
    Peter

    #1012722

    Hi 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
    Jakub

    #1012728

    Hi!
    Great, glad I could help yxou :)

    Best regards,
    Peter

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Text translation in confirmation email’ is closed to new replies.