WordPress.org

Ready to get started?Download WordPress

Forums

Arconix Portfolio
[resolved] Localization (7 posts)

  1. Halibutt
    Member
    Posted 1 year ago #

    Hi there, and thanks for the awesome plugin. I recently translated it using poedit (to Polish). However, it seems the plugin file (plugin.php) doesn't call the languages subdirectory no matter what, which makes the translation not working. This tutorial suggests, that it should be called within the init section, but I can't seem to find it in the plugin.php either. Any ideas how to resolve it?

    http://wordpress.org/extend/plugins/arconix-portfolio/

  2. Halibutt
    Member
    Posted 1 year ago #

    Just to make it clear, adding the following code right under class Arconix_Portfolio doesn't seem to do the job.

    /**
    	* Action: init
    	*/
    	function ap_action_init()
    	{
    		// Localization
    		load_plugin_textdomain('arconix-portfolio', false, dirname(plugin_basename(__FILE__)) . '/languages');
    	}
  3. John Gardner
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Halibutt,

    Thank you for using my plugin and for the kind words. Unfortunately I have not yet prepared my plugin for translation, so I apologize for the trouble you're having.

    Can you try change the domain argument in the load_plugin_textdomain() function to acp instead of arconix-portfolio?

    Once I formally set up my plugin for transaltion I will be switching the text domain to arconix-portfolio so to prevent potential conflicts.

  4. Halibutt
    Member
    Posted 1 year ago #

    Sadly, I don't know where to put the load_plugin_textdomain() function, so whether it's arconix-portfolio, acp or anything else in the .po and .mo files doesn't change much, does it. I tried to put the entire clause in plugin.php by trial and error, but nothing seemed to work.

    Also, are you planning to release this new localizable version any time soon? It seems to me it's already localization-ready, all text clauses are properly marked (or are they?). The only thing it's lacking is the load_plugin_textdomain() thingie to make it work for all of us out there.

    The reason I'm asking is that I'm working on my new page right now and I'd really like to use your plugin as it seems to be the best out there. However, it's of no use to me if it's in a language my users will not recognize (hence the translation I made).
    Cheers

  5. John Gardner
    Member
    Plugin Author

    Posted 1 year ago #

    I don't know the exact state of translatable strings in my plugin, however I can basically walk you through the steps needed to add the necessary functions to enable translation until I do it myself.

    Place the following at the bottom of the __construct() function (before the closing '}') in the file plugin.php

    add_action( 'plugins_loaded', array( $this, 'i18n' ) );

    then somewhere outside the __construct() function, place the following:

    function i18n() {
        load_plugin_textdomain('acp', false, dirname(plugin_basename(__FILE__)) . '/languages');
    }

    Unfortunately I don't have a timetable for releasing a fully localized update to the plugin, but it is on my roadmap. I believe all the strings are properly set up, but I'm not 100% certain of that, so I don't want to rush out an update until I have a better grasp as to where that is.

  6. Halibutt
    Member
    Posted 1 year ago #

    Thank you, this worked like a charm. :) I'll let you know once I post the Polish translation (when my site is back up and running), feel free to use it anyway you see fit.

    It seems the only hard-coded non-translatable string is the word "Display" right next to the list of features (user-side). Everything else is now in my native language. Thanks again for your help - and for this great plugin :)

  7. Halibutt
    Member
    Posted 1 year ago #

    In case somebody stumbles on my last post, you can easily change this "Dislay" heading by including the heading="YOUR_NAME_HERE" in your [ portfolio ] code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic