get_the_date() for translating date format
Try below code. echo get_the_date(__(‘M d’)); Output: Feb 09 echo get_the_date(__(‘M d, Y’)); Output: Feb 09, 2017
Try below code. echo get_the_date(__(‘M d’)); Output: Feb 09 echo get_the_date(__(‘M d, Y’)); Output: Feb 09, 2017
Assuming you stick with add_rewrite_rule(), if language and title where set as meta data on the /en/ post, then you can simplify the search down to a simple WP_Meta_Query() for /:lang/:title/ and pull the actually ID of the translated post there. Translations for /en/best-restaurants-in-tokyo: “/it/migliori-ristoranti-a-tokyo” => 4016 “/fr/meilleurs-restaurants-à-tokyo” => 4017
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
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
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
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
If you know that you or the client will NEVER need to be translated there is no need to replace all the strings within your theme with gettext. Regarding the performance issue I found a benchmark comparing the 3 gettex methods. It also compared using the default local vs a different local and the differences … Read more
You can wrap it inside double quotes: esc_html_e(“I couldn’t find the page you are looking for.”, “themename”);
I am not confident without downloading Estonian copy of WP source, but from look at GlotPress it seems that locale code for it is simply et, not et_EE.
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: