i have just built my first wordpress plugin for wordpress, and even when it isn't an excellent "code poetry" ) it really works because it should. It is a wordpress plugin that transform the default wordpress gallery while using GalleryView 3. jquery wordpress plugin (http://spaceforaname.com/galleryview).

The only real factor i am unable to do is localization. Localization with this wordpress plugin in means converting the admin interface, where someone can configure the jquery wordpress plugin choices to alter the part of the resulting gallery.

I have attempted to follow along with the countless lessons present on the internet, read lots of posts relating to this problem on forums and adopted the guidelinees of codex... but nonetheless without any luck.

this is exactly what i have done:

  1. every text lines are in the gettext function ( __ and _e )
  2. using poedit i produced the .po and .mo file checking the wordpress plugin directory (everythig went ok), i quickly added translations on that file.
  3. i named the .po file like this Title-OF-THE-Wordpress plugin-it_IT.po (the .mo file was produced with similar title)
  4. i have place the translations files within the wordpress plugin folder/languages (title from the folder is identical from the wordpress plugin as well as the translations files)
  5. then i have attempted to include the load_wordpress plugin_textdomain function within the primary wordpress plugin file. I have attempted due to there being no method of getting it working.

The only real factor on wich i am unsure is always that the wordpress plugin i have produced isn't within class+constructor funcions... simply because i am still not too good in coding.

But i have place the load_wordpress plugin_textdomain in a init add_action, such as this:

add_action('init', 'gw_load_translation_file')

function gw_load_translation_file() Wordpress_Wordpress plugin_DIR in which the translation files will sit:

$wordpress plugin_path = dirname(wordpress plugin_basename( __FILE__ ) .'/languages' )

load_wordpress plugin_textdomain( 'gallery-view-for-wordpress', false, $wordpress plugin_path )

the lines above aren't in the logic, they're just within the primary wordpress plugin file, like this.

it is really an illustration of my utilization of gettext functions:

<h3><?php _e('Panel Options','gallery-view-for-wordpress') ?></h3>

what did i not understand?

My mistake was on language files path declaration.

this fixed:

$wordpress plugin_path = dirname( wordpress plugin_basename( __FILE__ ) ) . '/languages/'

it was wrong:

$wordpress plugin_path = dirname(wordpress plugin_basename( __FILE__ ) .'/languages' )

I had been clarified on Wordpress Stack Exchange

Unlike these statement, I have been successful by using this filename: gallery-view-for-wordpress-it_IT.mo

Strange, though - styles use just it_IT.mo.