Author Topic: multilanguage feature  (Read 145329 times)

esteve

  • Jr. Member
  • **
  • Posts: 65
Re: multilanguage feature
« Reply #30 on: July 22, 2005, 12:19:55 pm »
hi,

sorry to say I have not visited this forum 3 months ago... :)

I don't know which questions are open, or solved, my comments:

-mambelfish can translate only those items, which has id. So SQL query should contain id.
If you have no translation in your cart, modify ps_product.php line 1018:
Code: [Select]
//instead of
//      $q = "SELECT `$field_name` FROM #__pshop_product WHERE product_id='$product_id'";
//use this
      $q = "SELECT product_id, `$field_name` FROM #__pshop_product WHERE product_id='$product_id'";
This function uses cache (to spare mysql), so product name will be showed on selected language only at first time, after that it comes from cache. Suggestion: disable cache (comment out an if condition some lines earlier), or do nothing (and user'll see things in cart only on 1 language).

-to translate payment methods:
payment method table is also non-standard (sorry to say :), if Soeren will have 3 free months he would change all column names of id to "id" :))
that's why add 2 lines to a function in components\com_mambelfish\classes\mambelfish.class.php (line: 178)
Code: [Select]
//MOD by ei
function help_non_standard_tables(&$content){
      if (!isset( $content->id )) {
//it would be better to parse from xml
if (isset( $content->product_id ))
$content->id = $content->product_id;
elseif (isset( $content->category_id ))
$content->id = $content->category_id;
elseif (isset( $content->payment_method_id ))   //<-----
$content->id = $content->payment_method_id; //<----

  }
  }


and its xml file:
Code: [Select]
<?xml version="1.0" ?>
<mambelfish type="contentelement">
  <name>phpShop Payment methods</name>
  <author>EI</author>
  <version>1.0</version>
  <description>Definition for phpShop component (Payment methods)</description>
  <reference>
  <table name="pshop_payment_method">
  <field type="referenceid" name="payment_method_id" translate="0">ID</field>
  <field type="titletext" name="payment_method_name" translate="1">Name</field>
  </table>
  </reference>
</mambelfish>

If there is any other open questions, feel free to ask, I'll try answer it. (sooner or later :))

all the best,
Steve

Nicram

  • Beginner
  • *
  • Posts: 7
    • Nicrams HomePage
Re: multilanguage feature
« Reply #31 on: July 22, 2005, 12:32:17 pm »
Hello there.
I'm using mambo wiuth newest path (4.5.2.3), newest mambo-phpshop (1.2 stable p3).
& i'm using newset released mambelfish (1.5).

I got some problems with modifications.
Can someone just make .zip archive with all patched already files & put link to that file here please ?:)

It will be much easier than searching for errors/mistakes :)

esteve

  • Jr. Member
  • **
  • Posts: 65
Re: multilanguage feature
« Reply #32 on: July 22, 2005, 13:16:50 pm »
Hi Nicram,

here you are the patched files. (mostly mambelfish 1.5)

all the best,
Steve


[attachment deleted by admin]

Nicram

  • Beginner
  • *
  • Posts: 7
    • Nicrams HomePage
Re: multilanguage feature
« Reply #33 on: July 23, 2005, 03:04:42 am »
It's working very well!

Thank You very very very much :)

Nicram

  • Beginner
  • *
  • Posts: 7
    • Nicrams HomePage
Re: multilanguage feature
« Reply #34 on: July 23, 2005, 03:14:51 am »
I was happy too fast.
Everything working fine excluding product category translation.
It is translated in mambel fish in administration panel.
But when i change language on website there is still native language used for category names. But the rest is translated fine...

Please help :)

esteve

  • Jr. Member
  • **
  • Posts: 65
Re: multilanguage feature
« Reply #35 on: July 25, 2005, 10:01:09 am »
Hi,

hmmm, a tipical mambelfish mistake: is translation published? :)
Where is the problem: in menu (tree or list), in navigation list (middle of the page), in pathway?

Anyway: mambelfish can translate only if sql statement contains id (category_id), so I put id into some sql statments in ps_product_category.php. It may help, but there was no need to that in my mambo.
(this php is added to zip, nothing else)

Steve

[attachment deleted by admin]

Nicram

  • Beginner
  • *
  • Posts: 7
    • Nicrams HomePage
Re: multilanguage feature
« Reply #36 on: July 25, 2005, 12:08:32 pm »
Well i published translation. The problem is in content panel.
The best way will be if You look:
http://matrox.poleko.pl/ Just selec english language (i translated only into english & one product category into german language just for testing). Then choose this little gold angel in the centre of menu:)

There is catalog with products & product list.
After using newest path that You attach it is still not working:/
I've check SQL & everywhere are int in product_category_xrefs of phpshop. & there is something like category_id (i mean this name extactly).

Hi,

hmmm, a tipical mambelfish mistake: is translation published? :)
Where is the problem: in menu (tree or list), in navigation list (middle of the page), in pathway?

Anyway: mambelfish can translate only if sql statement contains id (category_id), so I put id into some sql statments in ps_product_category.php. It may help, but there was no need to that in my mambo.
(this php is added to zip, nothing else)

Steve

esteve

  • Jr. Member
  • **
  • Posts: 65
Re: multilanguage feature
« Reply #37 on: July 25, 2005, 12:48:22 pm »
Hi,

I've visited your site, but as i can judge nothing was translated only static phpshop texts (price, details, etc). These come from "administrator\components\com_phpshop\languages\", mambelfish has nothing to do with them...

Could you tell me the result of following sql:

Code: [Select]
SELECT * FROM `mos_mbf_content`
where reference_table='pshop_category'
or reference_table='pshop_product'

Other suggestion: when I select a language, it takes me to the root. Don't you want to use this, instead of static images and links:
Code: [Select]
<?php echo mosLoadComponent'mambelfish' ); ?>
This would shows flags, and put on them the link of the given page. (Or you can use mambelfish module, and you'll be able to set some parameters, too.)

Steve

Nicram

  • Beginner
  • *
  • Posts: 7
    • Nicrams HomePage
Re: multilanguage feature
« Reply #38 on: July 25, 2005, 14:56:24 pm »

Well yes, it is still for testing thos ethings right there.

Your SQL command give this result: http://nicram.sytes.net/mos.png

Maybe it is important that I don't use mos_ in database but mambo_ (so i changed from SELECT * FROM `mos_mbf_content` to  SELECT * FROM `mambo_mbf_content`)

About static images.. I didn't check <?php echo mosLoadComponent( 'mambelfish' ); ?> even how it work, but i will try it now on local.

Hi,

I've visited your site, but as i can judge nothing was translated only static phpshop texts (price, details, etc). These come from "administrator\components\com_phpshop\languages\", mambelfish has nothing to do with them...

Could you tell me the result of following sql:

Code: [Select]
SELECT * FROM `mos_mbf_content`
where reference_table='pshop_category'
or reference_table='pshop_product'

Other suggestion: when I select a language, it takes me to the root. Don't you want to use this, instead of static images and links:
Code: [Select]
<?php echo mosLoadComponent'mambelfish' ); ?>
This would shows flags, and put on them the link of the given page. (Or you can use mambelfish module, and you'll be able to set some parameters, too.)

Steve

esteve

  • Jr. Member
  • **
  • Posts: 65
Re: multilanguage feature
« Reply #39 on: July 25, 2005, 16:35:38 pm »
Hi,

I could repro the bug, and now it is fixed. :)
My shop uses another catalog browser, that's why I did not see the error...

Only ps_product_category.php was modified.

Steve



[attachment deleted by admin]

Nicram

  • Beginner
  • *
  • Posts: 7
    • Nicrams HomePage
Re: multilanguage feature
« Reply #40 on: July 26, 2005, 00:56:29 am »
Hah, it's working very well now.
Thank You very much for all support :)

Soeren

  • Administrator
  • Hero Member
  • *
  • Posts: 3106
  • VirtueMart Starter
    • virtuemart.net
Re: multilanguage feature
« Reply #41 on: July 26, 2005, 16:47:27 pm »
Hello Steve,

I've incoroporated your changes for mambo-phpShop into the class files ps_product.php and ps_product_category.php.

Thanks-
ciao, Soeren
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

gwen

  • Full Member
  • ***
  • Posts: 332
Re: multilanguage feature
« Reply #42 on: July 26, 2005, 17:04:17 pm »
hi,

congratulation all for the discussion and the job...

do someone is able to make a resume about what is already done and what is really important to do for making phpshop working with mambelfish ?...it's quite hard with so much post...and the job that soeren has already done (big one as usualĀ  :D)

Gwen ex-dev team member

esteve

  • Jr. Member
  • **
  • Posts: 65
Re: multilanguage feature
« Reply #43 on: July 26, 2005, 17:36:17 pm »
Hi,

thanks Soeren for updating cvs!

Gwen: to use multilanguage feature use attachment of "Reply #39". (25.07.2005. 04:35:38 PM)
It contains mambelfish patch and xmls, and 2 phpshop files (which are already in phpshop cvs :))

Good luck!
Steve

gwen

  • Full Member
  • ***
  • Posts: 332
Re: multilanguage feature
« Reply #44 on: July 26, 2005, 18:50:14 pm »
great thanks steve... :D
Gwen ex-dev team member

VirtueMart Forum

Re: multilanguage feature
« Reply #44 on: July 26, 2005, 18:50:14 pm »