Language Pack not working
now, you can change the language in the back-end in the general configuration page, at the bottom of the page
now, you can change the language in the back-end in the general configuration page, at the bottom of the page
you don’t need to edit functions.php (moreover don’t edit this line or it will break the localisation of the theme, because arcade, is the code used to know where to search translations) according to the line you read in functions.php, you have to put fr_CA.mo and fr_CA.po in wp-content/themes/arcade-basic/library/languages
PO/MO files’ content depends on the theme/plugin developer. So you bought a half-ready theme… One way is translate strings in php files, but with this you loose the chance to update that, because updates will overwrite your changes. I suggest you: translate the strings with po/mo, than send the updated files to the developer too, … Read more
Translating WordPress plugins is an experimental project. Not all plugins listed in the repo are available yet. Quoting the translating WordPress page, The project currently contains only a couple of experimental plugins for translation.
sprintf() can be used to break the string up so that the translatable string can be isolated from the HTML: function new_excerpt_more( $more ) { return sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/206823/%1$s”><span class=”readmore”>%2$s</span></a>’, get_permalink( get_the_ID() ), __( ‘Read More’, ‘your-textdomain’ ) ); } add_filter( ‘excerpt_more’, ‘new_excerpt_more’ );
Ok, I just figured it out. Sometimes writing it down gives you a clearer perspective about your own problem. I didn’t know this before, but _x() provides context, and I was providing a context that does not exist. So I just eliminated the whole context thing from the equation by switching the _x()s for regular … Read more
WP has very good support for this. You will be Internationalizing and then Localizing your theme. Internationalization is often abbreviated as “i18n” because there are 18 letters between the ‘i’ and the ‘n’. The Codex provides a great reference on what needs to be done here: https://codex.wordpress.org/I18n_for_WordPress_Developers Much of the work involves wrapping strings with … Read more
For some reason, strtotime didn’t recognise the date format d.m.y. m/d-y is save. Then it worked.
There are multiple ways to do this: 1. Add multiple columns to the table with the strings you have to localize. E.g. one column for German, one for English, and so on. And then get the string from the appropriate column. This is perfect if the number of languages stays more or less constant (you … Read more
Please note that translate_user_role doesn’t work in the front-end currently. Here is a workaround, you can place this in your theme: add_action( ‘init’, ‘load_admin_textdomain_in_front’ ) function load_admin_textdomain_in_front() { if ( ! is_admin() ) { load_textdomain( ‘default’, WP_LANG_DIR . ‘/admin-‘ . get_locale() . ‘.mo’ ); } }