Dies ist das technische Support-Forum für WPML - das mehrsprachige WordPress-Plugin.

Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team beantwortet Anfragen im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.

Heute stehen keine Supporter zur Arbeit im German-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

This thread is resolved. Here is a description of the problem and solution.

Problem:
In the slider settings of the motoslider plugin there is a string for that publsihed status that could not be translated.

This seems not a string the authors thought would be translated.
It is retrieve as option and can't be shown by WPML in that spot.

Solution:
The plugin author has been contacted about this, but as a very dirty hack for urgent cases the template for this admin view can be edited to retrieve the translated value directly from the template cell itself:

You would need to replace in the file /wp-content/plugins/motopress-slider/views/slides.php
in line 32 this content:

<td><?php echo (isset($slide['options']['status']) && $slide['options']['status']) ? $slide['options']['status'] : 'published' ; ?></td>

with this other one:

<td>
    <?php 
        $translate_string = (isset($slide['options']['status']) && $slide['options']['status']) ? $slide['options']['status'] : 'published' ; 
        if ($translate_string == 'published') {
            _e('Published', 'motopress-slider');
        } else {
            _e('Draft', 'motopress-slider');
        };
   ?>
</td>

Those strings are already part of the plugin and are shown when editing the slide.

Relevant Documentation:

Schlagwörter: 

This topic contains 17 Antworten, has 2 Teilnehmer.

Last updated by Claudio Donati vor 11 Monate, 3 Wochen.

Assigned support staff: Cristina.

Autor Beiträge
Oktober 19, 2018 um 3:01 pm #2832500

Claudio Donati

Dear wpml Team,

i have problems to transalte this: see Screenshot

please can you help me?

Oktober 22, 2018 um 12:05 pm #2837906

Cristina

Hallo Claudio,

what exactly is the problem here?

Is it the slider itself that cannot be translated or do you want to translate the word "published" in the backend?

To translate MotoPress Slider, you need to create a slider for each language. For this you also need to duplicate / translate the images first.

We have some documentation that may help you here:
https://wpml.org/documentation/theme-compatibility/running-multilingual-sites-with-template-monsters-themes-and-wpml/#4

I am enabling the debug information box for your next answer in case you need some more help with this.

Kind regards,
Cristina

Oktober 22, 2018 um 12:21 pm #2837932

Claudio Donati

Hello Christina, i need only to translate the word "published"... but i can`t find the string 🙁

Oktober 22, 2018 um 12:25 pm #2837975

Claudio Donati

the translated one is here (see attachement)

Oktober 22, 2018 um 12:25 pm #2837998

Claudio Donati

but i will translate this string (see attachement)

Oktober 22, 2018 um 1:54 pm #2838321

Cristina

Hallo Claudio,

this string is marked with original language english.

If the site has default language german, the original language for this strings maybe should be german too, otherwise the english default word may be interpreted as german.

If you select this string and change the default language for it (using the button below the list, it activates when the checkbox is marked), it may show correctly and allow you to translate to italian too.

Does that work?

Kind regards,
Cristina

Oktober 22, 2018 um 2:02 pm #2838333

Claudio Donati

i have tesetd but the issue is always there... con you please test this forme? I can send you my credentials....

Oktober 22, 2018 um 3:27 pm #2838648

Cristina

Hello Claudio,

I am activating the private reply for this.

Please make a backup of the site just in case I need to change anything. I can make a clean test before to see how it should behave. In that case I just need to download the plugin or theme to check.

Kind regards,
Cristina

Oktober 22, 2018 um 9:29 pm #2839872

Cristina

Hallo Claudio,

this particular string seems to not have been coded in a translatable way.

The only translatable string I found in the plugins files was the one you already translated in String Translation.

This seems not a string the authors thought would be translated.
I think its located as option in json options file that then is read by the slide options code and can't be scanned by WPML as its not wrapped with a gettext function.

Kind regards,
Cristina

Oktober 23, 2018 um 6:49 am #2841096

Claudio Donati

So there is no way to translate that?

Oktober 23, 2018 um 9:01 am #2841618

Cristina

Hello Claudio,

you would need to rewrite the code where it is located to make it translatable.

You have to look in the plugin files, where there are several points where "published" is defined.

One of them is the value for the slide options page, and this value is retrieved from a list of values. This list is in json format, which means the values are presented in pairs. The status retrieves the value "published" for each slide. And that value is then used to show in the slide options admin page.

I have also testet if exporting the .po file and translating that word with POedit and importing the .po file again would help, but it does not.

So in the end you would need to:

- find where exactly this word is defined for that place in the slideoptions
- change the original code to make that word translatable
- find a way to use this variable in the json file that lists all status states for each slide

This is a customization of the plugins code that may work or not.

I can escalate this to the compatibility team, but it will take a bit of time, as they also need to contact the author for that.

Kind regards,
Cristina

Oktober 23, 2018 um 9:23 am #2841678

Claudio Donati

"I can escalate this to the compatibility team, but it will take a bit of time, as they also need to contact the author for that. "

yes, I would be very grateful for that!

Oktober 25, 2018 um 11:32 am #2849564

Cristina

Hi Claudio,

this is escalated, as soon as I have some feedback I will post here. The thread will not close until I get any response.

Kind regards,
Cristina

Oktober 25, 2018 um 1:13 pm #2849918

Claudio Donati

Thank you very much!!

Oktober 30, 2018 um 6:38 pm #2863322

Cristina

Hello Claudio,

my colleagues have checked this string and is it not really translatable as it is now, so we have contacted the author about this.

If you really need this string translated, we can offer a dirty hack as workaround, but this is just a temporary solution for an urgent case:

You would need to replace in the file /wp-content/plugins/motopress-slider/views/slides.php
in line 32 this content:

 <td><?php echo (isset($slide['options']['status']) && $slide['options']['status']) ? $slide['options']['status'] : 'published' ; ?></td>

with this other one:

<td>
    <?php 
        $translate_string = (isset($slide['options']['status']) && $slide['options']['status']) ? $slide['options']['status'] : 'published' ; 
        if ($translate_string == 'published') {
            _e('Published', 'motopress-slider');
        } else {
            _e('Draft', 'motopress-slider');
        };
   ?>
</td>

Those strings are already part of the plugin and are shown when editing the slide, so you would get a second translation here.

Kind regards,
Cristina