qtranslate

Get Woocommerce customer order language

我的未来我决定 提交于 2021-01-29 00:42:21
问题 I'm developing a complementary plugin for woocommerce . I have a sql request that gets all the order and customer info, but i need to get the language from the order. How can i detect the language was using a customer when he made an order? Is it registered somewhere? In other CMS like prestashop it's stored as id_lang in orders and customer tables. 回答1: Without getting into which plugin you will chose and how it operates, here is how you would save some extra data to the order. // save the

Get Woocommerce customer order language

余生长醉 提交于 2021-01-29 00:40:50
问题 I'm developing a complementary plugin for woocommerce . I have a sql request that gets all the order and customer info, but i need to get the language from the order. How can i detect the language was using a customer when he made an order? Is it registered somewhere? In other CMS like prestashop it's stored as id_lang in orders and customer tables. 回答1: Without getting into which plugin you will chose and how it operates, here is how you would save some extra data to the order. // save the

Simple Regular Expression to return text from Wordpress title - qtranslate plugin

可紊 提交于 2020-01-13 18:12:37
问题 I am using qtranslate wordpress plugin to store blog content in multiple languages. Now I need to extract content from qtranslate tags. $post_title = "<!--:en-->English text<!--:--><!--:it-->Italian text<!--:-->"; What would be the php code & regular expression to return text and language from this string? Thanks a lot! 回答1: Try something like: <?php $post_title = "<!--:en-->English text<!--:--><!--:it-->Italian text<!--:-->"; $regexp = '/<\!--:(\w+?)-->([^<]+?)<\!--:-->/i'; if(preg_match_all

How do I add a custom link with empty navigation label to menu in WordPress?

老子叫甜甜 提交于 2020-01-03 06:39:09
问题 I added a custom link to menu in WordPress, as shown below. How do I remove the text Language: ? In other word, how do I add a custom link with empty navigation label? I try to use empty string "" , but it does work. 回答1: This looks like a custom plugin or template. The part where it says "Language:" is most likely uneditable without creating a child template or modifying the source code. Can you give me a list of the plugins you are using ? 回答2: what if you leave it blank without quotes 回答3:

How to translate Wordpress content of post or page with .po files [closed]

≯℡__Kan透↙ 提交于 2019-12-20 02:59:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . For Wordpress/WooCommerce, I want to find a plugin to translate content of post, pages, custom post-types, like based on .po files, not WPML because a lot of paragraph need to reuse that. What can I use for this purpose? 回答1: You can't translate content of posts or pages with something based on .po / .mo files,

Wordpress problems with qTranslate and AJAX

可紊 提交于 2019-12-13 05:30:39
问题 I'm using wordpress with qTranslate and a custom theme. The theme brings along a autocomplete search. My problem is that the post/page titles aren't translated. I checked stackoverflow/google and there seems to be a problem with AJAX requests and qTranslate. That's why I added to the url parameter of my php file the following: ?lang='.qtrans_getLanguage() I checked the console and the parameter is passed correctly (for each language) to the javascript file. What I need now is to read this url

QFileDialog dynamic translation

耗尽温柔 提交于 2019-12-12 05:34:06
问题 This question has unfortunately been asked before but I'm going insane here. In my Qt Application the user is able to dynamically change the language which works perfect for all my own translations. It does not work for my calls to QFileDialog. The respective code: void myapp::change_language(std::string& lang_str){ // my own translations works qApp->removeTranslator(&this->app_lang); this->app_lang.load(QString::fromStdString(lang_str)); qApp->installTranslator(&this->app_lang); // system

Wordpress - Qtranslate to show only available languages

♀尐吖头ヾ 提交于 2019-12-11 12:20:49
问题 I want to display in which other languages current page is translated to. For example if current page is in english, and translation is available in french or on some other language, then script should output link to translated page in french. If there isn't translation available, then it should not output anything. How this can be done. Right now i use function <?php if (function_exists('qts_language_menu')) qts_language_menu('both'); ?> which return all languages, no matter if page have

For each language another permalink (Wordpress+qTranslate)

一曲冷凌霜 提交于 2019-12-11 01:34:41
问题 I need a plugin for wordpress who makes it possible to have for each language another permalink. I need this for pages in wordpress (and with compatibility with qTranslate). For example: DE: http://example-page.com/de/treten-sie-mit-uns-in-kontakt EN: http://example-page.com/en/contact-us Thanks 回答1: qtranslate slug could do the trick. http://wordpress.org/extend/plugins/qtranslate-slug-with-widget/ 来源: https://stackoverflow.com/questions/10304527/for-each-language-another-permalink

Rewrite Rule to enforce default lang code in URL

旧街凉风 提交于 2019-12-10 11:25:09
问题 I am running a WP Blog with qtranslate. It allows me to create posts in multiple languages. 1 . Example URL without qtranslate: www.mysite.com/post1 2 . Example URL with localized content: www.mysite.com/ en /post1 (english - my default and fallback) www.mysite.com/ de /post1 Unfortunately search engines etc. still remember my old links (1.) and these are still access-able. So "www.mysite.com/post1" now shows my english content without a redirect. But what it should do is to 301 users to "www