Alpha script.LibreTranslate
#31
Think there's an extra right paren in there -- try instead:
xml:
<onfocus>RunScript(script.LibreTranslate,q='$ESCINFO[ListItem.Director]',property=a)</onfocus>

scott s.
.
Reply
#32
Hi,

Here is my try

See this is my custom skin, RED BOX shows director's name in English correctly now.
Image
Image

Tried your addon as below, but there is nothing displayed
xml:

<control type="button">
                            <description>hidden button to fetch data for usage in other ctrls or windows...</description>
                            <visible allowhiddenfocus="true">false</visible>
                            <onfocus>RunScript(script.LibreTranslate,q='$ESCINFO[ListItem.Director]',property=a)</onfocus>
</control>
<control type="label">
                    <left>1000</left>
                    <top>350</top>
                    <width>590</width>
                    <height>36</height>
                    <font>primal_13_Bold</font>
                    <textcolor>$VAR[ColorFontNormal]</textcolor>
                    <shadowcolor>$VAR[ColorFontShadow]</shadowcolor>
                    <selectedcolor>$VAR[ColorFontSelected]</selectedcolor>
                    <align>justify</align>
                    <aligny>center</aligny>
                    <label>$INFO[Container(903).Property(libreTranslate_a)]</label>
                    <!-- <label fallback="정보 없슴">$INFO[ListItem.Director]</label> -->
</control>
Image

Also, I tried another language setting on your addon set, but it has same behavior as this
Image

I guess this is not an issue regarding specific language encoding.
Reply
#33
I think it has something to do with the order and timing of the events. I think maybe ListItem.Director is not filled in before the runscript is executed. May need to look into modifying how/when the runscript actually runs.

That is why I had originally said to look at https://forum.kodi.tv/showthread.php?tid=350568 as it deals with timing issues with running scripts in the skin.
Reply
#34
Can you try altering your hidden button with animation (which plays into timing):

<control type="button">
    <description>hidden button to fetch data for usage in other ctrls or windows...</description>
    <animation effect="slide" end="0,0" time="380" reversible="false">Focus</animation>
    <visible allowhiddenfocus="true">false</visible>
    <onfocus>RunScript(script.LibreTranslate,q='$ESCINFO[ListItem.Director]',property=a)</onfocus>
</control>

I can try this later today, but maybe you will see this sooner and could try.
Reply
#35
Thank you for your reply. I will try that.
BTW, I have one question.
I am using script.embuary.helper to get  cast's names as like this

xml:

<value>plugin://script.embuary.helper?info=getcast&type=movie&dbid=$INFO[ListItem.DBID]</value>
https://github.com/sualfred/script.embua...t#get-cast

with this, current my skin works well to get cast names below skin xmls even if it shows English lang.
xml:

<control type="panel" id="904">
<itemlayout height="225" width="180">
<control type="label">
                        <font>primal_13</font>
                        <label>$INFO[ListItem.Label,,[CR]]$INFO[ListItem.Label2]</label>
</control>
</itemlayout>
<focusedlayout height="225" width="180">
<control type="label">
                        <font>primal_13</font>
                        <label>$INFO[ListItem.Label,,[CR]]$INFO[ListItem.Label2]</label>
</control>
</focusedlayout>
<content>$VAR[EmbuaryCast]</content>
<variable name="EmbuaryCast">
        <value condition="String.IsEqual(ListItem.DBType,movie) + !String.IsEmpty(ListItem.DBID) + !String.IsEqual(ListItem.DBID,0)">plugin://script.embuary.helper?info=getcast&type=movie&dbid=$INFO[ListItem.DBID]</value>
it can get cast name as $INFO[ListItem.Label] in my panel.

My Question is
Case of script.embuary.helper (get cast name as INFO[ListItem.Label])
Does $INFO[ListItem.Label] (it has case name)  can be translated with your addon? (Assumes, your addon is working in my skin)

Below is my trial, but it does not work. Can you look at this? (I just want to know if your addon will works or not with script.embuary.helper )

place hidden button or onload...
xml:

RunScript(script.LibreTranslate,q='$ESCINFO[ListItem.Label]'),property=a)
$INFO[Window(Home).Property(libreTranslate_a)]
Reply
#36
The addon is simple, and you can test translations manually at :

https://translate.argosopentech.com

which uses the same API as this addon.

You can test various attempts to translate there, it should behave the same as this addon in it's ability to translate.
Reply
#37
I am still working on it and can not fix my issue.

I use "plugin.video.themoviedb.helper" to get actor name as below

xml:

<variable name="TMDBCast">
        <value>plugin://plugin.video.themoviedb.helper/?info=details&type=movie&query=$INFO[ListItem.Title]</value>
</variable>

xml:

<control type="list" id="903">
    <itemlayout height="240" width="180">
        <control type="label">
            <label fallback="..">$INFO[Window(Home).Property(LibraTranslate_a)]</label>
        </control>
        <control type="label">
            <label fallback="..">$INFO[ListItem.Property(Cast.1.Name)]</label>
        </control>
    </itemlayout>
    <focusedlayout height="240" width="180">
        <control type="button">
            <visible allowhiddenfocus="true">false</visible>
            <onfocus>RunScript(script.LibraTranslate,q='$ESCINFO[ListItem.Property(Cast.1.Name)]',property=a)</onfocus>
        </control>
    </control>
</focusedlayout>
<content>$VAR[TMDBCast]</content>
</control>

<label fallback="..">$INFO[ListItem.Property(Cast.1.Name)]</label> . it works and can get actor name on skin.
<label fallback="..">$INFO[Window(Home).Property(LibraTranslate_a)]</label> , it does not work and can not get actor name
Reply
#38
As a test, to exclude any translation issues, can you try modifying the onfocus to :


<onfocus>SetProperty(test,$INFO[ListItem.Property(Cast.1.Name)],home)</onfocus>

(in place of <onfocus>RunScript(script.LibraTranslate,q='$ESCINFO[ListItem.Property(Cast.1.Name)]',property=a)</onfocus> )


And then reference this property :

<label>$INFO[Window(home).Property(test)]</label>

(in place of <label fallback="..">$INFO[Window(Home).Property(LibraTranslate_a)]</label> )

And see if this works (IE you should see the Cast.1.Name in the label.

If this works, then there is an issue with the translation addon.

If this does not work, then there is some issue in the order or operations, etc that is an issue, and not directly related to the translation addon.
Reply
#39
Thank you

Yes, I have some problem my SetProperty setting.

I created another post regarding SetProperty. If you have time, please look at this?
https://forum.kodi.tv/showthread.php?tid...pid3143623
Reply
#40
Hi @kcook_shield

Unfortunately I noticed that for some time it has been returning this error:

<urlopen error [SSL: TLSV1_UNREC0GNIZED_NAME] tlsvl unrecognized name (_ssl.c:1136)>


I don't know what caused it, I tried to change the URL, but I saw that it remained the same, I don't know if changes need to be made to the code.

Can I kindly ask you what the problem is...?


Thank you for your important help.
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply
#41
Looks like https://translate.argosopentech.com is no longer available, so in turn, this addon can not work anymore :-(
Reply
#42
@kcook_shield

Can something be done about it?

It seems that libretranslate still works on the site and I believe with the API, maybe the behavior of the code needs to be changed...?

I don't know, I ask, I hope all this work isn't lost because of this.
(I think the API request method has changed...)


Thank you for your support.
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply
#43
In a browser try:

https://translate.argosopentech.com/translate

For me it fails.

Without this website working, the addon can not run translations.

You might be seeing some cached translations (previous translations are cached for 30 days, unless you set cache time differently in addon), which is why it might look like it is working.

If that site is truly gone, we would need a similar site/service to update this addon to use.
Reply
#44
https://github.com/LibreTranslate/LibreT...te#mirrors

Looks like "translate.argosopentech.com" is no longer listed.

But others are listed:

1) https://libretranslate.com/

API key Seems to run $29 / mo


2) translate.terraprint.co

Seems to work, you could try setting in kodi addon:

https://translate.terraprint.co/translate

(instead of https://translate.argosopentech.com/translate )

But if you don't want to pay the monthly for #1 and #2 does not work, then only option left with this service is to run your own local install of :

https://github.com/LibreTranslate/LibreTranslate
Reply
#45
(2023-12-23, 04:28)kcook_shield Wrote: But if you don't want to pay the monthly for #1 and #2 does not work, then only option left with this service is to run your own local install of :

https://github.com/LibreTranslate/LibreTranslate
Thank you for the proposed methods.

Since I use it once in a while (maybe 3.4 times a month) I think I use it locally.
But I don't know if it can work as I would like, that is, leaving only the shield TV turned on and installing it locally on the shield TV with Android TV.

Could it only work installed locally on the shield TV, without connecting servers, Linux or Windows systems?


Thanks for your help.
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply

Logout Mark Read Team Forum Stats Members Help
script.LibreTranslate0