Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Multilanguage support
Tagged: e-store, eMember, estore, Languages, Multi language, multible language, multilanguage, multilingual, multiple languages, qTranslate, translate, Translation, wpml
- This topic has 40 replies, 14 voices, and was last updated 6 years, 6 months ago by admin.
-
AuthorPosts
-
October 18, 2011 at 5:00 pm #456512345678.itMember
Hi there, i’ve just bought store+member and i’m in testing phase
Everything works correctly . Only design should be tuned up a little .
The only one problem is that i cannot manage to make it work in multilanguage. I’ve read that i18n settings is usefull to use eStore with ML plugin . Currently i’m using qtranslate … any suggestions ???
Thank you
Andrea Testa
12345678.it webdesigner
October 18, 2011 at 5:13 pm #3764612345678.itMemberwhich are the supported ml plugins ???
October 19, 2011 at 1:26 am #37647adminKeymasterMultilingual support is not one of our advertised feature of this plugin so there is no support for it. However, we can try to accommodate a feature to see if it will help you.
We can make it so if the URL of the page has something like the following (qTranslate adds this) then eStore will load the corresponding language file regardless of what you have set in the settings:
http://example.com/some-url/?lang=de
Let me know if that will help and I will tell you what to do.
October 19, 2011 at 12:36 pm #3764812345678.itMemberyes qtranslate add ?lang=de and switch language …. you can give a look at italiabike.com and use user keymaster and password keymaster to give a look at my site …. this is the page i’m using to test the chart and languages
[http://italiabike.com/cms/?p=665&lang=it]
i need it in 3 different languages as you see from flags …. it pt en with en default
q translate edit everything correcly but not eStore
October 19, 2011 at 1:02 pm #3764912345678.itMemberI’ve got different options for the url . Via permalink settings and qtranslate settings i can obtain [http://italiabike.com/cms/it/category/senza-categoria/] but if it easier for you to fix it with ?lang=de link no problem
October 19, 2011 at 2:22 pm #3765012345678.itMemberi’m trying this solution
//includes
$lingua= qtrans_getLanguage();
switch ($lingua) {
case “en”:
$language_file = “languages/eng.php”;;
break;
case “it”:
$language_file = “languages/ita.php”;;
break;
case “pt”:
$language_file = “languages/eng.php”;;
break;
}
include_once($language_file);
could this be the right way ???
October 19, 2011 at 11:43 pm #37651adminKeymasterTry the following:
1. Open the “wp_eStore1.php” file and find the following block of code:
$cart_language = get_option('eStore_cart_language');
if (!empty($cart_language))
$language_file = "languages/".$cart_language;
else
$language_file = "languages/eng.php";
include_once($language_file);2. Once you find it replace it with the following block of code:
function wp_eStore_load_qTranslate_lang()
{
$cart_language = qtrans_getLanguage();
switch ($cart_language)
{
case "en":
$language_file = "languages/eng.php";;
break;
case "it":
$language_file = "languages/ita.php";;
break;
case "de":
$language_file = "languages/ger.php";;
break;
}
if(empty($language_file))
{
$cart_language = get_option('eStore_cart_language');
if (!empty($cart_language)){
$language_file = "languages/".$cart_language;
}
else{
$language_file = "languages/eng.php";
}
}
include_once($language_file);
}
add_action('init', 'wp_eStore_load_qTranslate_lang');3. Now, when you select a language from the qTranslate widget eStore will load the corresponding language file specified inside the “switch” statement.
October 20, 2011 at 7:18 am #3765212345678.itMemberat first sight is seems to be working like a charm i’ll let you know asap mi final response
November 13, 2011 at 1:45 pm #37653ntarantinoMemberWill this work for the WPML plugin as well?
November 13, 2011 at 5:38 pm #37654garthwrightMemberDoes anybody knows how do I add new language file for estore? I have already edited the file in wp-content/plugins/wp-cart-for-digital-products/languages/eng.php and created new one rus.php.
I have changed all the sentences and words. But what do I do next?
How do I make it work with qtranslate?
What is the “switch” statement?
thank you.
November 13, 2011 at 10:31 pm #37655adminKeymasterThe easiest is to reuse one of the existing language options that you won’t need. For example, if you don’t need the “Dutch” language then just copy and paste the content of the “rus.php” into the “nld.php” file. Now when you select “Dutch” in the eStore settings menu it will read that file which actually has your custom language. Let me know if that make sense.
Alternatively, you can send us the “rus.php” file that you created and we can add it to the plugin. You can get in touch with us via our contact form.
November 14, 2011 at 1:08 pm #37656garthwrightMemberYes that works but then all the other texts will be in dutch in wp. Where I can add the rus.php into the plugin?
How long it could take if I send you the russian file to get it implemented?
November 15, 2011 at 12:14 am #37657adminKeymaster“all the other texts will be in dutch in wp” – NO, that language file is only for eStore and only affects eStore’s language (it has nothing to do with WordPress).
January 26, 2012 at 2:29 pm #37658akaigotchiMemberHi,
I am currently using WPML on my platform. The URL scheme in WPML currently outputs the language as a folder / path. As setting eStore to i18n did not show any result at all (everything remained in English no matter what language I chose) I made up my mind about a different “solution”:
– I added a function get_current_language() to my theme’s functions.php that returns the value of WPML’s ICL_LANGUAGE_CODE constant
– I modified wp_estore1.php (latest version) around line 40 to
/* if (!empty($cart_language))
$language_file = “languages/”.$cart_language;
else
$language_file = “languages/eng.php”; */
$language_file = ‘languages/’.get_current_language().’.php’;
Result: PHP threw me an error saying that there was no function get_current_language()
Can you pls help me here? BTW, I noticed that my i18n.php file is all English, no other language than that inside.. Is that intended?
Thanks for your help in advance!
Best Regards
Thorsten
January 27, 2012 at 4:50 am #37659adminKeymasterPlease post the content of the following function so I can take a look:
get_current_language()
-
AuthorPosts
- You must be logged in to reply to this topic.