Can’t we use strings defined as PHP constants if we want to translate them in a plugin?

I think this is happening because Constants cannot be redefined later. Once they are set, they are fixed. http://php.net/manual/en/language.constants.php I’m not exactly sure how WP language constructs work, but part of me thinks that they are defined, then changed later on the fly when plugins/themes use them. I don’t have a reference for this but … Read more

Make theme translatable for WPML

You don’t have to make anything special for WPML, using the regular translation code should be enough. See I18n for WordPress Developers in the Codex. Code preparation style.css Add Text Domain and Domain Path to your theme’s style.css. Example: /* * Theme Name: My awesome theme * Text Domain: my_awesome_theme * Domain Path: /languages */ … Read more

Translate wordpress plugin [closed]

Do not create a PO file manually. The synchronization must be automatic, or you will waste much time. Each you change a string, you have to change it in two files now. Poedit has a built-in PHP parser. Use it to read your project files. And you don’t have to edit WPLANG to create a … Read more

month name translation

Use date_i18n(): date_i18n( ‘Y. F j.’, strtotime( get_the_time( “Y-m-d” ) ) ); From the function’s description: Retrieve the date in localized format, based on timestamp. If the locale specifies the locale month and weekday, then the locale will take over the format for the date. If it isn’t, then the date format string will be … Read more

Change language of comments template

There are two options: Replace all default strings for the comment form. Look at wp-includes/comment-template.php for available filters (there are many). Set your blog’s default language to English, install the plugin WP Native Dashboard, load the Italian language files and set the admin language to Italian. Here is a screen shot of the plugin settings:

How to load theme textdomain from plugin?

You are completely loading your language file wrong in your plugin, and your file naming is also wrong. load_theme_textdomain(‘my_plugin’, plugin_dir_path( __FILE__ ) . ‘/languages’); should be load_plugin_textdomain(‘my_plugin’, false, dirname(plugin_basename(__FILE__)) . ‘/lang/’); Also, your mo and po files should be named my_plugin-en_US.mo and my_plugin-en_US.po. Go have a look at this tutorial also, this will help you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)