Close

Account

Documentation

Forum

Menu

issue with translation not picked up

  • Post count: 67
    huwcole
    July 6, 2016 at 4:43 pm #21068

    hi
    I have an issue with the salary range paid hourly, weekly, monthly yearly.
    I have translated the words into german and all works fine when adding a job. but when the job is displayed on the page see:

    Web Entwickler / PHP Entwickler – Schwerpunkt Magento

    you can see that it does not pick up the translation at all. it still says monthly.

    I think it is the job-detail.php page.

    any idea why it is not picking up the translation??

    Post count: 67
    huwcole
    July 8, 2016 at 8:16 pm #21116

    something seems to go wrong here:
    wp-content\themes\jobplanet-themes\fragment\job-detail.php”

    line 70
    <span class=”salary-range-detail”><?php echo esc_html( vp_metabox(‘jobplanet_job.salary_range’)); ?></span>

    vp_metabox finction seems to pick up an array in
    wp-content\plugins\jobplanet-plugin\lib\metabox\job-metabox.php”

    array(
    ‘type’ => ‘select’,
    ‘name’ => ‘salary_range’,
    ‘label’ => esc_html(__(‘Salary Range’, ‘jobplanet-plugin’)),
    ‘items’ => array(
    array(
    ‘value’ => ‘hourly’,
    ‘label’ => esc_html(__(‘Hourly’, ‘jobplanet-plugin’)),
    ),
    array(
    ‘value’ => ‘weekly’,
    ‘label’ => esc_html(__(‘Weekly’, ‘jobplanet-plugin’)),
    ),
    array(
    ‘value’ => ‘monthly’,
    ‘label’ => esc_html(__(‘Monthly’, ‘jobplanet-plugin’)),
    ),
    array(
    ‘value’ => ‘yearly’,
    ‘label’ => esc_html(__(‘Yearly’, ‘jobplanet-plugin’)),
    ),
    ),
    ‘default’ => array(
    ‘yearly’
    ),
    )

    but it is not picking up the label values.

    instead it is picking up the value stored in the database table postmeta.
    I tested it by changing the value directly in the database table and it displays whatever you enter.

    thanks

    Post count: 67
    huwcole
    July 10, 2016 at 12:03 am #21135

    hi

    came up with my own solution

    wp-content\themes\jobplanet-themes\fragment\job-detail.php”

    that function vp_metabox() in
    <span class="salary-range-detail"><?php echo esc_html( vp_metabox('jobplanet_job.salary_range')); ?></span>

    is definitely picking up the value from database via the get_the_value() function
    in wp-content\plugins\jplugin\framework\includes\wpalchemy\MetaBox.php

    so i replaced

    <span class="salary-range-detail"><?php echo esc_html( vp_metabox('jobplanet_job.salary_range')); ?></span>

    with

    and now it works
    `

    Post count: 2229
    Jegbagus
    July 12, 2016 at 2:15 am #21159

    hi huwcole, yes you right. its picking up the value not translated version. and its great you able to solve the issues. we going to include your change into our code too. so you won’t need to change it again in next version.

    Thank you

You must be logged in to reply to this topic.