Posted: September 26, 2013 at 4:24 am
|
I’m attempting to follow what Josh has pointed out in https://eventespresso.com/topic/localization-of-invoice/ post. Where is located the custom_functions.php file? Thank you, B D |
Hi, custom_functions.php is part of the Custom Files Add-on The function mentioned within the thread you have linked to can also be placed within your theme’s functions.php file if you would like. |
|
|
Thanks. I have placed it within my child theme’s functions.php file, but nothing happens… B D |
Can you either paste the function here or onto pastebin so we can view it please? |
|
|
I have tested with the following (after ‘Bill To:’ I however need to add other strings): function mycustom_filter_gettext( $translated, $original, $domain ) { // Add some more strings here // See if the current string is in the $strings array add_filter( ‘gettext’, ‘mycustom_filter_gettext’, 10, 3 ); |
Hi, In this case I would advise you to edit the file directly. If you copy the invoice folder to wp-uploads/espresso/gateways and edit the files there they will be kept after EE updates. So once the folder it copied the file to edit would be wp-content/uploads/espresso/invoice/template.php. |
|
|
September 26, 2013 at 11:16 am Thank you. This way it works. However, one issue remains: the date format. More precisely, my WP date format contains the name of the month, that I cannot change/translate in this file. Is there a way to render this translatable? (of course, alternatively I can change the date format to contain only numbers, but I’d rather keep the format with the name of the month). Thank you in advance, B D |
September 26, 2013 at 12:13 pm You can make the date display according to the selected date format option in WP>Settings by editing the template and changing any instance of:
to:
|
|
|
Thank you Josh. This works fine. However, if my WP date format is “26 September 2013” (in French, in my case), the name of the month appears in the pdf invoice still in English, untranslated. Is there any way to translate the name of the monthts, and where? |
September 27, 2013 at 11:30 am In that case you’d change it from using the regular old date function to using the WordPress date internationalization function. so
can be changed to:
|
|
The support post ‘Invoice localization php file’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.