qTranslate remove default directory from link

/ru - default directory, how can I remove it this link: https://cambridge.ua/ru/teachers/ should be: https://cambridge.ua/teachers/ <ul class="language-chooser language-chooser-text qtranxs_language_chooser" id="qtranslate-chooser"> <li class="lang-ru active"><a href="https://cambridge.ua/ru/teachers/" hreflang="ru" title="RU (ru)" class="qtranxs_text qtranxs_text_ru"> <span>RU</span></a></li> <li class="lang-en"><a href="https://cambridge.ua/en/teachers/" hreflang="en" title="EN (en)" class="qtranxs_text qtranxs_text_en"> <span>EN</span></a></li> <li class="lang-uk"><a href="https://cambridge.ua/uk/teachers/" hreflang="uk" title="UK (uk)" class="qtranxs_text qtranxs_text_uk"> <span>UK</span></a></li> </ul> <div class="qtranxs_widget_end"></div>
Category: Web

When there are two identical entries in a .po file, how does the translation mechanism determine which one to use?

I was trying to translate some plugin when I see in their .po file there are two "Sign in"s. I believe Wordpress uses __ to parse text that needs to be translated. So when codes like __('Sign in', 'buddyboss-theme') is executed, how does it know which "Sign in" entry in the .po file is the one to look for?
Category: Web

custom post type WYSIWG removes paragraphs when displayed

I have a WordPress 5.2.3 instance that is multilingual with the help of the qtranslate-x plugin. I created a custom post type with a translatable WYSIWG field. The visual WYSIWG editor generally works, but when I display the content of the field on a page, the paragraphs are removed. This is how it looks like in the editor: This is how the page is rendered (direct link: https://crossroads-festival.org/de/film/your-turn): As you can see, the paragraphs are lost when the field is …
Category: Web

How to merge two .PO language files?

I have a .po file that works with the theme and it contains 1259 characters, and i translated many words in it. That been said, after the theme was updated i found out that the new .po files contains 1898 (460 more characters). So i would like to know if there is a safe and efficient way to merge these two files, that means keeping the integrity of manual translations i did + the new terms that were added by …
Category: Web

Bulk assign posts to a category using SQL (MySQL)

I am migrating a wordpress site from QTranslate-X to WPML (2 multi-lingual plugins). In the migration, all my posts that belonged to a given category (healthy in English, sain in French) were correctly assigned in English but the link was lost in French. I wrote a SQL script to determine the list of French post IDs from the English posts that belong to the healthy category. That gave me a list of IDs (101, 102...). I then proceeded to run …
Category: Web

Script for q translate

Would like to add this script on my website just on the top of the memu right side, how can i do that? Here's the code: <!-- GTranslate: https://gtranslate.io/ --> <a href="https://jimbere.org" title="French" class="glink nturl notranslate" style="float:right;"><img src="//jimbere.org/wp-content/plugins/gtranslate/flags/24/fr.png" height="24" width="24" alt="French" /></a> <a href="https://jimbere.org/test/news" title="English" class="glink nturl notranslate" style="float:right;margin-right:3px"><img src="//jimbere.org/test/wp-content/plugins/gtranslate/flags/24/en.png" height="24" width="24" alt="English"/></a> <a href="https://jimbere.org/test/amayagwa" title="English" class="glink nturl notranslate" style="float:right;margin-right:3px"><img src="//jimbere.org/test/wp-content/uploads/2019/04/burundi-flag-icon-32.png " height="24" width="24" alt="Kirundi"/></a> <a href="https://jimbere.org/amayagwa" title="English" class="glink nturl notranslate" style="float:right;margin-right:3px"><img src="//jimbere.org/test/wp-content/uploads/2019/04/burundi-flag-icon-32.png" alt="Kirundi" / style=" position: absolute; width: 26px;height: …
Category: Web

Strange wp-admin problem for all users/adminstrators except the original one?

I don't get this but for all wp admin users except the original main user i get a strange error which causes the visual editor to fail: load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,heartbeat,autosave,suggest&load[]=,wp-ajax-response,jquery-color,wp-lists,postbox,jquery-ui-menu,wp-a11y,jquery-ui-autocomplete,tags-suggest,tags-box,underscore,w&load[]=ord-count,post,editor-expand,thickbox,shortcode,backbone,wp-util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-req&load[]=uest,media-views,media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,svg-painter,wp-auth-check&ver=4.9.5:690 Uncaught TypeError: Cannot read property 'hasClass' of undefined at HTMLDocument.<anonymous> (load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,heartbeat,autosave,suggest&load[]=,wp-ajax-response,jquery-color,wp-lists,postbox,jquery-ui-menu,wp-a11y,jquery-ui-autocomplete,tags-suggest,tags-box,underscore,w&load[]=ord-count,post,editor-expand,thickbox,shortcode,backbone,wp-util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-req&load[]=uest,media-views,media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,svg-painter,wp-auth-check&ver=4.9.5:690) at HTMLDocument.dispatch (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:3) at HTMLDocument.r.handle (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:3) at Object.trigger (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:3) at Object.a.event.trigger (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:9) at HTMLDocument.<anonymous> (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:3) at Function.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:2) at a.fn.init.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:2) at a.fn.init.trigger (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-sortable,moxiejs,&load[]=plupload&ver=4.9.5:3) at Object.<anonymous> (load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,heartbeat,autosave,suggest&load[]=,wp-ajax-response,jquery-color,wp-lists,postbox,jquery-ui-menu,wp-a11y,jquery-ui-autocomplete,tags-suggest,tags-box,underscore,w&load[]=ord-count,post,editor-expand,thickbox,shortcode,backbone,wp-util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-req&load[]=uest,media-views,media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,svg-painter,wp-auth-check&ver=4.9.5:48) I have given All users (4) the same role administrator, but only the "main" …
Category: Web

how to get the qtranslate-x meta_value in wp_postmeta using WP_Query?

How do I get all the posts where the value in wp_postmeta.meta_value is the selected city? I now use the code below, but this doesn't work 100% because I use the LIKE method. So if I select "York" I get "York" and "New York". The meta_value is sometimes translated with qtranslate-x and somethimes not. So I have in the database: meta_value = 'York' meta_value = '[:en]New York[:es]Nueva York[:]' The english value is always filled. $metaFilter = array( 'city_clause' => array( …
Category: Web

Translating Website

How to translate my website into another language like Malayalam. Can You suggest something. There is a problem when I used GTranslate plugin, that is it doesn't translate correctly. There is any chance of content editing/ changing the content when translating a page?
Category: Web

Multilingual XML sitemaps when using qTranslate-X

I am taking over a multilingual website that a previous developer left unfinished, and I found that he had used qTranslate-X as a localization plugin, in order to create handle the multilingual part of it. The problem I find now is how to create a XML sitemap that has all the pages in their different language versions: Yoast SEO can generate sitemaps, but it doesn't work with qTranslate-X. The plugin they recommend in order to make both play nice together …
Category: Web

How to translate content in category.php or index.php with qtranslate?

I was wondering how to translate content under index.php (or category.php with qtranslate?). I'm using twenty twelve theme. My code on index.php: <?php /** * The main template file. * @package WordPress * @subpackage Twenty_Twelve * @since Twenty Twelve 1.0 */ ?> <?php get_header(); ?> <?php $page_id = 1500; $page_data = get_page( $page_id ); echo apply_filters('the_content', $page_data->post_content); ?> <section id="last-articles_homepage"> <h1>Latest News</h1> ... I would like to translate the content inside the <section> and <h1> tag for example in french.
Category: Web

Creating multilingual glossary for WP

I'm trying to create multilingual glossary using WP & WPML & custom post type. And I found solution to achieve this. Link to the page example - link 1) Added to functions.php function get_ajax_url() { if (is_page(array(2017,2021,2023,2027))) { wp_enqueue_script( 'ajax-script', get_template_directory_uri() . '/js/alphabet.js', array('jquery') ); wp_localize_script( 'ajax-script', 'my_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); } } add_action( 'wp_enqueue_scripts', 'get_ajax_url' ); alphabet.js file contains this script: jQuery(document).ready(function($) { jQuery('.alphabet').click(function(){ var data = { action: 'get_by_char', char: this.id }; jQuery.post(my_ajax_object.ajaxurl, …
Category: Web

qtranslate loading the wrong language

I have the following problem. I'm translating a website in 2 languages - Bulgarian and English. Let say that I search a page in Bulgarian. The results that google disply are in Bulgarian language, but when I click on one of the links(google results) it loads the English version of the page, not Bulgarian. I'm looking for a solution for this problem, but I can't find anything.
Category: Web

JSON in oembed not being internationalized (using QTranslateX)

I'm using the QTranslateX plugin at its latest version, 3.4.6.8, in a fresh WordPress 4.7.1 installation. At the moment everything is working OK. But I've seen that in JSON-oembed pages there's some content not being internationalized. Take a look at this example on my site. The title property on the JSON object returned by that shows [:es]Noticias[:en]News[:] (i.e. the title before QTranslateX applies i18n) instead of Noticias. I've discovered this issue while trying to post a message in LinkedIn. When …
Category: Web

404 errors problem with multilangual permalink pages

I am suffering an unexpected issue with “Plugin: Qtranslate Slug”; Some of my pages will automatically redirected to 404 error page. I tried a lot of this in slug but the issue is not resolved. This error mostly occurred on child pages. In terms of solving the problem I need to remove database field value which holding slug value. After remove column values page working fine. Can anyone please help me to override this problem; it’s very urgent? I also …
Category: Web

Custom values are not translated

I'm trying to translate my plugin. Inside plugin's root folder I have 'inc' folder, where located registration.php file. This file has a code, which adds custom fields to comment form. (I use right solution from this answer) and here is a part of a code, which should be translated. $myfields['code'] = sprintf( '<p class="comment-form-code"> <label for="code">%s <span class="required">*</span></label><br/> <input id="code" name="code" type="text" tabindex="5" /> </p>', __('Personal Code', 'kvkoolitus') ); $myfields['phone'] = sprintf( '<p class="comment-form-phone"> <label for="phone">%s <span class="required">*</span></label><br/> <input id="phone" …
Category: Web

How to get Post title by locale with Qtranslate-X

I need to send 2 emails, when new comment is posted and when new comment is approved. Site is multilingual and uses qtranslate-x plugin. Here is code, which sends email when comment is posted. In this case 'get_the_title($post->ID)' returns post title on one language as expected. function kvkoolitus_email_comment_posted( $comment_ID, $comment_approved ) { if( 0 === $comment_approved ){ $comment = get_comment( $comment_ID ); $post = get_post( $comment->comment_post_ID ); $blog_mail = get_option('admin_email'); $comment_text = $comment->comment_content; $email = $comment->comment_author_email; $to = $blog_mail; $from …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.