Over the past months I have been building a virtual competition, for one of my clients, for the tournament 2014 in Brazil.
The project had its challenges and I plan to dive into some of those areas in the future, as soon as the tournament is over ;)
Cheers
Alex
„Everyone loves the Google CDN right? Even Microsoft runs their own CDN. The problem is, they only host the most popular libraries. We host it all – JavaScript, CSS, SWF, images, etc!“
Still looking for a nice way to integrate this Terminal plugin it into some of my current websites :)
Debugging can be such a pain sometimes. Kint has saved my bacon more than once ;)
Find talent for the banking sector.
The Contact Form 7 for WordPress is a nice simple plugin to build contact forms fast. But when it comes to making it completely multilingual it lacks a bit.
I am currently creating a website with 13 different languages, that would mean to create the same contact form 13 times, not really practical :)
I am translating the form labels on the fly with some javascript magic, but for the messages I had to go a bit deeper.
1 2 3 4 5 6 7 8 |
public function message( $status ) { $messages = $this->messages; $message = isset( $messages[$status] ) ? $messages[$status] : ''; $message = $this->replace_mail_tags( $message, true ); return apply_filters( 'wpcf7_display_message', $message, $status); } |
1 2 3 4 5 6 7 8 |
public function message( $status ) { $messages = $this->messages; $message = isset( $messages[$status] ) ? $messages[$status] : ''; $message = $this->replace_mail_tags( $message, true ); return __(apply_filters( 'wpcf7_display_message', $message, $status ),'textdomain'); } |
1 2 3 4 5 |
$contact_form_msgs = array( 'msg_1' => __('Your message was sent successfully. Thanks.','textdomain'), 'msg_2' => __('Failed to send your message. Please try later or contact the administrator by another method.','textdomain'), 'msg_3' => __('Validation errors occurred. Please confirm the fields and submit it again.','textdomain'), ); |
Cheers
Alex
WPML for WordPress is a powerful plugin to build a multi-language setup. But it still comes short in some areas, especially when it comes to a custom integration into plugins or when using custom post-types.
Normally this function should return the id of the linked translated content, but has not worked for me in some cases (especially when AJAX is involved).
1 |
icl_object_id( $id, 'custom_post_type', false, $translation_lang ); |
A simple SELECT helps to get that id yourself :)
1 2 3 4 5 6 7 8 |
// original_id - main post id // $translation_lang - translated language code ... de, nl ... global $wpdb; $translation = $wpdb->get_results("SELECT * from wp_icl_translations where trid = (SELECT trid from wp_icl_translations where element_id = '".$original_id."' and element_type='post_page') and language_code='".$translation_lang."'"); $post = get_post($translation[0]->element_id, ARRAY_A); |
The GitHub repository from Saša Stamenković provides a nice list of all countries with names and ISO 3166-1 codes.
Available formats are: