I AM LISTENING TO
|
WHAT I LIKE
  • English
  • German


BLOG FILTER



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. Open wp-content/plugins/contact-form-7/classes.php
  2. Go to line 800 function message
  3. Change this

    to this

    See how I wrapped the gettext function for the return, that does all the magic.
  4. Next we have to make sure that the messages are being found by localization helpers like Codestyling Localization
  5. In your theme functions.php add a translation for each of the Contact 7 Form messages
  6. The first message in the Contact 7 Form admin says: Your message was sent successfully. Thanks.

     
  7. Do not change these messages in the Contact 7 Form admin anymore or the setup will break. These updates will have to be repeated with each plugin update, unless the author does something similar.
  8. Happy translating.

Cheers
Alex

readmore

word_cloud_language
The GitHub repository from Saša Stamenković provides a nice list of all countries with names and ISO 3166-1 codes.

Available formats are:

  • Text
  • JSON
  • YAML
  • XML
  • HTML
    • Select
    • Flags
  • CSV
  • SQL
    • MySQL
    • PostgreSQL
    • SQLite
    • SQL Server
  • PHP

Github

readmore

Geolocation
Sometimes when personalizing or translating interfaces, IP geolocation is required.

Maxmind Geolite Free

Besides their subscription based products Maxmind also provides a free IP Geolocation database set. The set is offered under the Creative Commons Attribution-ShareAlike 3.0 Unported License. The free databases maps IPv4 + IPv6 addresses and is being updated once a month. GeoLite Free Downloadable Databases

IP2Location Lite

Another free set of data is provided by IP2location Lite. It is free for personal or commercial use with attribution required

readmore

The JSON spec allows integers, fractional numbers, strings, arrays, but when it comes to dates things are handled differently. There really is no date format in the JSON spec. Would be nice if every JSON date output would conform to ISO8601 :)

Some of these can easily be converted to a PHP timestamp using strtotime(), others require some more magic.

Here is a way to transform the .NET variant, something that has been haunting me in a current project ;)

Due to the wide usage of JSON as an exchange format, I really hope we will see a spec update in the future :)

readmore

masonary
“Masonry is a JavaScript grid layout library. It works by placing elements in optimal position based on available vertical space, sort of like a mason fitting stones in a wall. ”

Still the best solution out there.

Masonary

readmore

pztv_phantomjs

PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.

PhantomJS

readmore
5. February 2014

Snap.svg Framework

pztv_snapsvg

The JavaScript SVG library for the modern web. Just what the doctor ordered ;)

Snap.svg

readmore

tablesorter

Nice jQuery plugin that easily enhances your tables and even provides a pager if needed. The plugin is also Bootstrap compliant.

Tablesorter

readmore

morris_js

morris.js is a really nice chart lib for jQuery, that provides line, bar and donut charts.

morris.js

readmore

pztv_phonejs

“PhoneJS contains everything you’ll need to create native client applications using HTML5 and JavaScript with a single codebase and deliver solutions that target today’s most popular smartphones and tablet devices.

With a touch-optimized user experience, natively rendered widgets, straightforward page navigation, view management, and data access layers, PhoneJS is a single page application (SPA) framework for your next iOS, Android and WindowsPhone application, ready for online publication or packaged as a store-ready native app using Apache Cordova (PhoneGap).”

Really thinking about using it for one of my upcoming projects. Best documentation I have seen for a long time. Will build a test app next year :)

PhoneJS

readmore