[SOLVED] translate

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #6442
    Yourwp
    Participant

    hello,

    can i get some help with the translation of the labels?

    i read this:
    https://woopricecalculator.com/documentation#translation

    But as stated in the manual there was no example file in the specified folder.
    I created a file be_FR, and pasted the example, but i don’t understand how this should work.

    ‘label1’ => ‘label1_EN’,

    should ‘label1’ be the fieldname? fe woo_price_calc_n?

    tx for the help

    #6458
    Enrico
    Participant

    Hi,

    label1 is the Label of the field (Field Label), so if you create a new field with label ‘height’, label1 will be ‘height’.

    Example:

    en_GB.php:

    ‘Height’,
    );

    it_IT.php:

    ‘Altezza’,
    );

    label1 could be a dropdown item also. So if you create a new dropdown field, you can translate every item of the select field.

    Best regards,
    Enrico

    #6457
    Yourwp
    Participant

    Hello,

    tx! i managed to translate the labels.
    But the translation of the labels in the dropdown doesn’t seem to work.

    Also, on my phone (iphone) the labels are not translated.
    Maybe a phone uses expects something else then fr_FR?

    [hide]http://bit.ly/2oLH2Rs[/hide]

    #6456
    Enrico
    Participant

    Hi,

    It depends on what is your default language on your browser phone.

    If WooPriceCalculator can’t find the string in any of your files, it tries to check if en_US.php exists. If en_US.php doesn’t exists than WPC shows the label as it is.

    WPC translates based on the current language on the user browser (the same as WordPress does)

    Could you post your language file so that I can understand why dropdown label translation is not working?

    Best regards,
    Enrico

    #6455
    Yourwp
    Participant

    attached the fr-FR.php file

    concerning the translations, i use WPML for the translations
    it is weird that this works correct on my pc. When i swith the language it shouldn’t it use the language defined in the page instead of the browser lang?

    tx for the help!

    [attachment=62]fr_FR.zip[/attachment]

    #6454
    Yourwp
    Participant

    i noticed that the labels of the dropdowns are translated in the checkout.

    just not in the form. I use a custom theme.

    #6453
    Enrico
    Participant

    Hi,

    If you are using a custom theme, form templates are not managed by WPC anymore.

    You can use the function: $this->userTrans("TO TRANSLATE");

    For example in the default custom theme:


    This is a template example

    view['data'] as $field): ?>

    userTrans($field['field']->label); ?>:

    #6452
    Yourwp
    Participant

    Hello support,

    can you help a little bit more on this one? pleeease 😉

    this is what i have in my theme file for a dropdown.
    I don’t see where i should add you code? Above this form?

    view[‘data’][‘woo_price_calc_7’][‘class’]; ?>”>

#6451
Enrico
Participant

Hi Yourwp,

Try from:


view['fields']['woo_price_calc_2']['html']; ?>

to:


view['fields']['woo_price_calc_2']['html']; ?>

Where “woo_price_calc_2” is your field.

but you can just do:

userTrans($field['field']->label); ?>:

This code replace the previous one because $field['widget'] draws automatically all the html of the field.

Best regards,
Enrico

#6450
Yourwp
Participant

Tx for your help Enrico,

but i don’t see the change. See the screenshots, Everything is translated (labels, my customdescription i added in the theme)
but not the labels in the dropdown.

in the checkout it is translated.

this is my field now (noticed the html editor cleaned up to much in my previeous post):



view['fields']['woo_price_calc_7']['html']; ?>

#6449
Enrico
Participant

Hi,

Could you please send me your FTP and wp-admin access credentials to https://altoswebsolutions.com/contact-us?

Thanks,
Enrico

#6448
Yourwp
Participant

I just sent the credentials. Sorry this took a bit longer, but i had some issues with plugin updates.

tx support!

#6447
Enrico
Participant

Hi Yourwp!

Could you please send to me WP-admin credentials also?

Thanks,
Enrico

#6446
Yourwp
Participant

Just sent the credentials by mail.

Tx!!

#6445
Enrico
Participant

Hi,

I’ve solved the problem. There was mainly two problems:

1. A plugin problem, the dropdown items were not well translated
2. Language file is: “nl_NL.php”, so I created a “nl_NL.php” file and copied the contents from “be_FR.php”. You need to change the translations there.

I’ve updated your plugin to 1.2.24

Best regards,
Enrico

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.