Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8610277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:05:35+00:00 2026-06-12T04:05:35+00:00

I have completed my plugin, now want to provide a multilingual features for my

  • 0

I have completed my plugin, now want to provide a multilingual features for my users. I goggled about it, but it’s hard to implement.

I’ve seen WordPress translation but need basic steps to follow and translate my plugin.

I have done these

  1. downloaded POEdit.
  2. created ‘french.po’ file in plugin dir
  3. complied ‘french.po’ -> ‘french.mo’

Need to do

  1. How to define msgid & msgstr in po file?
  2. How to load po/mo file in plugin?
  3. How to replace labels/text through po/mo file?
  4. how to use __e() & ___() to replace ‘msgstr’ in plugin pages?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:05:36+00:00Added an answer on June 12, 2026 at 4:05 am

    With a plugin called, Codestyling Localization, you don’t need to use POEdit.

    I’ll show you an example of using ‘localizationsample’ as the text domain. In this case, the language files are in the /lang/ directory. They don’t need to be those names in your actual plugin; they are just examples.

    Steps

    1. Add these lines in the plugin comment header to be recognized by Codestyling Localization.

      Text Domain: localizationsample
      Domain Path: /lang

    2. Create a directory named lang in your plugin directory.

    3. Install and activate the Codestyling Localization plugin.

    4. Go to Tools -> Localization

    5. Find your plugin and click on Add New Language

    6. Select the language (country) to localize in the radio button and press Create po-file At this point make sure a .po file is created in the lang folder.

    7. Press Rescan -> scan now This is recommended since in my system without doing this, the plugin always shows an error saying “not all items are using the same text domain.”

    8. Press Edit This will bring you another page listing the messages available to be translated. Those messages are the ones passed to the functions __() and _e() in the plugin code.

    9. Click on Edit in the table next to Copy then you’ll get a dialog box to type your translation for each message. Finish translating.

    10. Press generate mo-file At this point, you should see a .mo file being created in the lang folder.

    11. Change your locale specified in wp-config.php to reflect the translation. The default is define('WPLANG', '');

    Sample plugin

    /*  
        Plugin Name: Sample Localization
        Description: Demonstrates how to localize your plugin.
        Text Domain: localizationsample
        Domain Path: /lang
    */
    
    // Localization
    add_action('init', 'localizationsample_init');
    function localizationsample_init() {
        $path = dirname(plugin_basename( __FILE__ )) . '/lang/';
        $loaded = load_plugin_textdomain( 'localizationsample', false, $path);
        if ($_GET['page'] == basename(__FILE__) && !$loaded) {          
            echo '<div class="error">Sample Localization: ' . __('Could not load the localization file: ' . $path, 'localizationsample') . '</div>';
            return;
        } 
    } 
    
    // Add Admin Menu 
    add_action('admin_menu','localizationsample_menu');
    function localizationsample_menu() { 
        add_options_page(
            'Localization Demo',            // admin page title
            'Localization Demo',            // menu item name
            'manage_options',               // access privilege
            basename(__FILE__),                         // page slug for the option page
            'localization_demo_adminpanel'  // call-back function name
        );
    }
    function localization_demo_adminpanel() {
    
        echo '<div class="wrap"><div id="icon-themes" class="icon32"></div>';
        echo '<h2>' . __('Hi there!', 'localizationsample') . '</h2>'; 
        echo '<p>';
        _e('Hello world!', 'localizationsample');
        echo '</p>';
        echo '</div>'; // end of wrap
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have completed the assignment (yes it is for a programming class), but I
I am a beginner in I phone development.I have completed an application.Now i am
I have written my own java.util.List implementation, and now i want to store it
I have worked with SQL for several years now, primarily MySQL/PhpMyAdmin, but also Oracle/iSqlPlus
I have successfully installed the Facebook registration plugin on my website, but I'm left
tl;dr-edition: I have a compilation I know that will fail, but want the subset
I have setup Maven project locally without eclipse, it is completed succefully. Now i
I have recently installed clang_complete plugin for VIM. Everything looks fine except in popup
I have completed my program and would like to send that program in its
I have completed every step in XMonad's tutorial for Mac. However, I cannot start

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.