loco translate plugin edits file in plugin folder

I thought (and hoped) that the translations were written in the folder wp-content/languages/loco/plugins/my-plugin. They are, but only when you create the file in that location. Any users wishing to customize your provided translations should create a new translations file and not edit yours. Opening your provided PO file and starting to edit will not automatically … Read more

Change template copy with po/mo files

i had a similar question posted some time ago: why is translation not working on theme? it might be the solution to put your translation files into the right location (languages directory in wp-content/languages/themes/) and prefix them with the theme name like themename-pt_PT.po

Replace text string on individual page

I can’t comment so I’ll answer and slightly adjust Bhagyashree’s which is exactly what you’ll need to do based on your question. Except you may want to know how to include the 2 pages rather than duplicating the function. And also passing in an array of strings to replace. function replace_some_text( $content ) { // … Read more

Transliterating search term in another language

If you have PHP’s Intl extension installed, you can use the wonderful Transliterator class. I get some pretty good results, like this: $t = Transliterator::create(‘Latin-Greek’, Transliterator::FORWARD ); var_dump( [ ‘alfa’ => $t->transliterate(‘alfa’), ‘alpha’ => $t->transliterate(‘alpha’), ] ); Both these greeklish forms give me “άλφα”. I don’t know how it knows where to put the accent, … Read more

Child Theme Translations with PoEdit

Found a solution that works for me: add_action( ‘after_setup_theme’, ‘avia_lang_setup’ ); function avia_lang_setup() { $lang = apply_filters(‘parent-theme-slug’, get_template_directory() . ‘/lang’); load_theme_textdomain(‘avia_framework’, $lang); load_child_theme_textdomain( ‘child-theme-text-domain’, get_stylesheet_directory() . ‘/lang’ ); } Note: Exchange “parent-theme-slug” (typically the parent theme name in small letters) and “child-theme-text-domain” (child theme text domain of your choice)

Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu

For anyone having the same trouble, I am now using a workaround from the accepted answer on the following question: https://wordpress.stackexchange.com/a/30723/181214 I am using the solution beyond the “EDIT: Another Option” which is working fine for slugs, names, singular names etc. function get_labels() { // return a default slug if(!defined(‘WPLANG’) || !WPLANG || ‘de_DE’ == … Read more

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