Author Topic: BUG: Language not being applied to custom fields  (Read 4525 times)

bombayx

  • Beginner
  • *
  • Posts: 17
  • Skype Name: norwaiz
  • VirtueMart Version: 2.6.0
Re: BUG: Language not being applied to custom fields
« Reply #15 on: April 08, 2014, 22:06:26 pm »
The english language keys/strings for Mr. and Mrs. are in the file your-root-folder\components\com_virtuemart\language\en-GB\en-GB.com_virtuemart_shoppers.ini
Search for:
COM_VIRTUEMART_SHOPPER_TITLE_MISS="Miss"
COM_VIRTUEMART_SHOPPER_TITLE_MR="Mr"
COM_VIRTUEMART_SHOPPER_TITLE_MRS="Mrs"

If those are not yet in your (slovak?) xx-XX.com_virtuemart_shoppers.ini, just copy the above keys/strings into it and replace the strings (for example "Miss") with the salutations in your language.

Maybe you don't get my point, here, how can I translate to a second language that string? This string is shown on he site ...

Joomla 2.5.19
PHP 5.5
multi-language shop

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3470
  • using Matomo instead of Google Analytics
Re: BUG: Language not being applied to custom fields
« Reply #16 on: April 08, 2014, 22:35:59 pm »
Sorry, I misunderstood your question. If you want to translate 'Velkost', you have to enter a language key. Instead of 'Velkost' enter something like com_virtuemart_velkost. Then go to your Joomla language file override folders or use the Joomla language manager and add that key followed by a string to your english and (slovak?) override files.

For example:
COM_VIRTUEMART_PRODUCT_SIZE="Velkost" (place this one into the (slovak?) site and perhaps also into the administrator language override files)

COM_VIRTUEMART_PRODUCT_SIZE="Size" (place this one into the (english) site and perhaps also into the administrator language override files)

It is pretty similar to the way described in this tutorial (which is now obsolete concerning the Mr./Mrs. translation):
http://docs.virtuemart.net/tutorials/36-multilingual-store/105-using-language-keys-in-form-fields.html
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

bombayx

  • Beginner
  • *
  • Posts: 17
  • Skype Name: norwaiz
  • VirtueMart Version: 2.6.0
Re: BUG: Language not being applied to custom fields
« Reply #17 on: April 09, 2014, 19:35:09 pm »
Sorry, I misunderstood your question. If you want to translate 'Velkost', you have to enter a language key. Instead of 'Velkost' enter something like com_virtuemart_velkost. Then go to your Joomla language file override folders or use the Joomla language manager and add that key followed by a string to your english and (slovak?) override files.

For example:
COM_VIRTUEMART_PRODUCT_SIZE="Velkost" (place this one into the (slovak?) site and perhaps also into the administrator language override files)

COM_VIRTUEMART_PRODUCT_SIZE="Size" (place this one into the (english) site and perhaps also into the administrator language override files)

It is pretty similar to the way described in this tutorial (which is now obsolete concerning the Mr./Mrs. translation):
http://docs.virtuemart.net/tutorials/36-multilingual-store/105-using-language-keys-in-form-fields.html

Many thanks. Worked!
Joomla 2.5.19
PHP 5.5
multi-language shop

taenny

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.6.12.2
Re: BUG: Language not being applied to custom fields
« Reply #18 on: April 19, 2014, 17:45:55 pm »
Hello,

I had the exact same question - thanks for sharing the answer!

I am also trying to translate all available values of my custom field for both front- and backend - in the example above represented by "XXS" etc, which I already named according to my own needs COM_VIRTUEMART_PRODUCT_USED,...
Translation of the title works well by placing it in the joomla language override section in the backend. Doing the same thing for the values of my custom field doesn't do the trick.

There is a thread in here (even sticky), which describes this scenario (http://forum.virtuemart.net/index.php?topic=96758.0) but I failed to locate the "ini" file, in which I am supposed to write my strings into. (tried xx-XX.com_virtuemart_shoppers.ini)
I also tried inserting those language keys into the joomla language override folder (/mydomain/language/overrides) with no effect.
Joomla Version: 2.5.18
VM Version: 2.6.0

Am I missing something? Any hints would be very much appreciated!
Vm Version: 2.6.12.2
Joomla: 2.5.27
Php: 5.5
MySQL: 5.5

taenny

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.6.12.2
Re: BUG: Language not being applied to custom fields
« Reply #19 on: April 27, 2014, 20:43:40 pm »
Resolved it on my own but I guess it is only a workaround.
Since no type of language override  (neither file nor backend entries) worked for the custom field values (Type:String, Is a list) I took a look at the code.

I created a template override for the productdetails view and changed in default_customfields.php around line 39

Code: [Select]
<?php echo $field->display ?> to
Code: [Select]
<?php echo JText::_($field->custom_value); ?>
Creating a language override now takes effect.
Still wonder though, whether this is truly necessary..

I know this thread is in the bug report section and this is obviously no bug per se but I thought others might also run into this when using default templates.
Vm Version: 2.6.12.2
Joomla: 2.5.27
Php: 5.5
MySQL: 5.5

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: BUG: Language not being applied to custom fields
« Reply #20 on: April 28, 2014, 14:49:19 pm »

I am also trying to translate all available values of my custom field for both front- and backend - in the example above represented by "XXS" etc, which I already named according to my own needs COM_VIRTUEMART_PRODUCT_USED,...
Translation of the title works well by placing it in the joomla language override section in the backend. Doing the same thing for the values of my custom field doesn't do the trick.

should be in the frontend language.


Resolved it on my own but I guess it is only a workaround.
Since no type of language override  (neither file nor backend entries) worked for the custom field values (Type:String, Is a list) I took a look at the code.

I created a template override for the productdetails view and changed in default_customfields.php around line 39

Code: [Select]
<?php echo $field->display ?> to
Code: [Select]
<?php echo JText::_($field->custom_value); ?>
Creating a language override now takes effect.
Still wonder though, whether this is truly necessary..

I know this thread is in the bug report section and this is obviously no bug per se but I thought others might also run into this when using default templates.


Seems that the vmText is missing for type string, "is a list".
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/