• 1
  • 3
  • 4
  • 5
  • 6
  • 7(current)
Kodi skin localize VS Code extension
#91
Quote:
xml:

msgctxt "#31395"
msgid "Resolution Media Flag Color"
msgstr ""

(for the sake of argument, assume in Kodi's main files, even though it is my personal file) > The string does not show up, however, when I switch it to:

xml:

msgctxt "#31395"
msgid "Resolution Media Flag Color"
msgstr "Resolution Media Flag Color"

Then the string shows up. When I right click to see what its definition should be, it should just take me there, regardless of what file it is no?

This occurs often from what I've seen where Kodi's main language has the string in msgid, but not msgstr and if not, then I add it to my local file for operation.

I'm not sure I understand, are you saying the definition only shows up if both msgid and msgstr have values? Because the only value I return is msgid, so it shouldn't matter if msgstr is empty.

Could you give an example of a Kodi string that fails please, so I can test.

Quote:Is it possible for it to navigate to Kodi's definition? And if it is not a normal operation most would want, make it a settings option to enable it for those that may want it?

The problem is the extension has no possible way to know where the Kodi po files are located. In order to decorate string from the Kodi po files I download a copy from the main Kodi github page to match against, however this isn't a VSCode document and thus can't be used to match definitions against.
Reply
#92
For the first question about needing both values, it could be anywhere in my skin code where I would right click on some $localize value. One example was when I was adding options to the color picker when it needed updating. I would follow the kodi .po structure, leaving the 2nd value blank, when I was in the admin panel, the "new work" was in place, but the value was not displayed, only when I added the "2nd" value, then refreshed, the value then showed up in the admin thing I was fixing.

I see this lot, one 1 value populated, which I recall is a localization thing, so when I use your extension on some rando $localize string, most times when it doesn't work, I find the 2nd value is not there. Example: The string "red" has some localize value in Kodi's .po file, but when I "use" that value, red doesn't show up, so I have to create my own version of that value in my local files, make both the same text, and then it automagically works. Not entirely sure that is how it is supposed to work, but that has been the case as recently as 48 hours ago when I was working on media flag color changing options... I just figured your extension should take to you where ever, what ever, $localize file it is being pulled from. Mostly likely nothing wrong with your extension, more of a user flow experience like when you code in C or C++, if there is a definition, and you say, take me there, it does... regardless of it is editable or not... because you want to know its source location and show you what it is seeing during a compile... but as you mention in your second point, that may not be possible here, yet VSCODE still provides the context of "go to definition" which is very annoying if can't actually do that.

It's not a hill I'm ready to die on for, just some of the things I've run across, either way, your extension is a god send to make things a hell of a lot easier.
Kodi: Nexus v20.5 | Skin Dev: Madnox Omega/Nexus: v20.01.02 | Madnox ForumRoot | Madnox Repov1.0.09 | Mr. V'sSource | Kodi Texture Tool (Takeover): v3.0.1 | Batch Texture Resize (Irfanview): Tutorial
Working On
: Replacing Embruary >> TMDB Helper || Start: 6/3/2024 End: God knows || Status Complete: Movies: 80% TV Shows: 40% Music: 20%
Reply
#93
(2024-11-18, 17:39)roidy Wrote:
Quote:
xml:

msgctxt "#31395"
msgid "Resolution Media Flag Color"
msgstr ""

(for the sake of argument, assume in Kodi's main files, even though it is my personal file) > The string does not show up, however, when I switch it to:

xml:

msgctxt "#31395"
msgid "Resolution Media Flag Color"
msgstr "Resolution Media Flag Color"

Then the string shows up. When I right click to see what its definition should be, it should just take me there, regardless of what file it is no?

This occurs often from what I've seen where Kodi's main language has the string in msgid, but not msgstr and if not, then I add it to my local file for operation.

I'm not sure I understand, are you saying the definition only shows up if both msgid and msgstr have values? Because the only value I return is msgid, so it shouldn't matter if msgstr is empty.

Could you give an example of a Kodi string that fails please, so I can test.
Quote:Is it possible for it to navigate to Kodi's definition? And if it is not a normal operation most would want, make it a settings option to enable it for those that may want it?

The problem is the extension has no possible way to know where the Kodi po files are located. In order to decorate string from the Kodi po files I download a copy from the main Kodi github page to match against, however this isn't a VSCode document and thus can't be used to match definitions against.

Ok, I finally have the answer to this:

https://forum.kodi.tv/showthread.php?tid...pid3223737

It appears that the skin language files need to be sync'd to its skin local en_gb file.

So what is happening as far as I can tell, I have your extension to update my en_us file and its been brilliant all along. But from what MikeS just told me, the SKIN EN_GB file must ALSO be updated simultaneously to match the en_gb. That seems to be why I have to update the translated field because the entry is completely missing within my skins en_gb file.

Sooooooo with that, I'm wondering if your extension can be updated to write to BOTH files, first the en_gb and then replicate it to the en_us or whatever the user is working with to ensure manual rewriting and errors don't occur by having to automate one but needing to hand edit the other to match.

Does that make sense? Any thoughts?

How many coffee's must I buy to assist?

Chris
Kodi: Nexus v20.5 | Skin Dev: Madnox Omega/Nexus: v20.01.02 | Madnox ForumRoot | Madnox Repov1.0.09 | Mr. V'sSource | Kodi Texture Tool (Takeover): v3.0.1 | Batch Texture Resize (Irfanview): Tutorial
Working On
: Replacing Embruary >> TMDB Helper || Start: 6/3/2024 End: God knows || Status Complete: Movies: 80% TV Shows: 40% Music: 20%
Reply
#94
(2025-01-28, 06:18)kittmaster Wrote: So what is happening as far as I can tell, I have your extension to update my en_us file and its been brilliant all along. But from what MikeS just told me, the SKIN EN_GB file must ALSO be updated simultaneously to match the en_gb. That seems to be why I have to update the translated field because the entry is completely missing within my skins en_gb file.

That seems really silly, so you're telling me every developer has to create their skin in en_gb even if that's not their native language.
Quote:Sooooooo with that, I'm wondering if your extension can be updated to write to BOTH files, first the en_gb and then replicate it to the en_us or whatever the user is working with to ensure manual rewriting and errors don't occur by having to automate one but needing to hand edit the other to match.
While that is possible for en_us what happens if somebody is using a different language ie French or German. The extension can't possibly work out the translations and fill in the en_gb file.

For your case wouldn't it just be easier to use en_gb instead of en_us and set Kodi's language to English instead of English(US).
Reply
#95
(2025-01-28, 18:50)roidy Wrote:
(2025-01-28, 06:18)kittmaster Wrote: So what is happening as far as I can tell, I have your extension to update my en_us file and its been brilliant all along. But from what MikeS just told me, the SKIN EN_GB file must ALSO be updated simultaneously to match the en_gb. That seems to be why I have to update the translated field because the entry is completely missing within my skins en_gb file.

That seems really silly, so you're telling me every developer has to create their skin in en_gb even if that's not their native language.
Quote:Sooooooo with that, I'm wondering if your extension can be updated to write to BOTH files, first the en_gb and then replicate it to the en_us or whatever the user is working with to ensure manual rewriting and errors don't occur by having to automate one but needing to hand edit the other to match.
While that is possible for en_us what happens if somebody is using a different language ie French or German. The extension can't possibly work out the translations and fill in the en_gb file.

For your case wouldn't it just be easier to use en_gb instead of en_us and set Kodi's language to English instead of English(US).

Well, hmm... After getting my head around that thread I linked to where they are stating that, if not in en_us skin, then en_gb skin, else en_gb core. Your settings field that the user selects determines which skin language file they update, like en_us or en_ko or whatever right? What I'm asking is, whatever that setting is or whoever is using it, when they right click and say $LOCALIZE[MyNewShinyString] that it ALSO writes the same exact thing to the en_gb skin language file at the same time... which seems to be what Kodi (and what those folks said in that thread) needs to happen based on the order of language precedence Kodi is following to read the non en_gb strings.

I just tried out exactly what I described, I put my "double" (msgid,msgstr) unique string from my skin and copied it to the skin en_gb file, removed the translated "double" (msgstr) and sure enough it works. The requisite being that the skin en_gb must also have the same entry of the reworked skin i.e en_us or en_ko etc etc... as matched pairs.

Yes, I guess I could use en_gb only as you suggest, but if the user actually selects the region specific language, it may not render as the translated value will be "" i.e. null.

So your settings value field, I have set to en_us, it would just have to write the identical data to en_gb simultaneously and would be true for all other languages when the user puts the right language value they need in your settings fields of the plugin as I have with en_us.

If it's not something you want to mess with I understand.
Kodi: Nexus v20.5 | Skin Dev: Madnox Omega/Nexus: v20.01.02 | Madnox ForumRoot | Madnox Repov1.0.09 | Mr. V'sSource | Kodi Texture Tool (Takeover): v3.0.1 | Batch Texture Resize (Irfanview): Tutorial
Working On
: Replacing Embruary >> TMDB Helper || Start: 6/3/2024 End: God knows || Status Complete: Movies: 80% TV Shows: 40% Music: 20%
Reply
#96
Please start again and explain the issue to me in simple terms. I must be stupid because I'm having a hard time understanding exactly what the issue is.
Reply
#97
(Yesterday, 18:53)roidy Wrote: Please start again and explain the issue to me in simple terms. I must be stupid because I'm having a hard time understanding exactly what the issue is.

Ok, no problem.

Here is the language primer which I know you know but just so we are both on the same page:

Image

I use the following settings to write ANY AND ALL of my skin custom strings to:

Image

From how it was exactly spelled out to me in that thread I linked (and I think you have already seen), this is Kodi's order of precedence (sorry for spelling error in image): 

Image

So it is writing to en_us in users skin folder. I've been saying my issue has been that I need to fill in both msdid and msgstr to make my strings show up (i.e English to English translation).

What needs to happen and isn't happening, when I create a new string in the skin users en_us strings.po file, the is no MATCHING version of that written string in the en_gb.

So what I have been doing, adding the same "my string" inside both msgid and msgstr to "make it work". 

What needs to happen is when "My String" is written the en_us file, there must ALSO  be a duplicate of that exact thing ADDED to the skin en_gb at the same time.

By doing that, I would not need to write the same "my string" to both msgid and msgstr because Kodi is expecting to find a copy of each in both en_us and en_gb.

So if the I create a $localize[xxxx] in the IDE, if your extension could write an identical version of it to BOTH of those files at the same time, it would solve the issue of going back to maintain the en_gb file after new strings are added to the en_us.

When I click on region English (US), that is the file it is looking for to render my custom strings in my skin. The en_gb has spelling that is not the same between the UK and USA and I'm trying to keep it straight.

Does that help clarify?
Kodi: Nexus v20.5 | Skin Dev: Madnox Omega/Nexus: v20.01.02 | Madnox ForumRoot | Madnox Repov1.0.09 | Mr. V'sSource | Kodi Texture Tool (Takeover): v3.0.1 | Batch Texture Resize (Irfanview): Tutorial
Working On
: Replacing Embruary >> TMDB Helper || Start: 6/3/2024 End: God knows || Status Complete: Movies: 80% TV Shows: 40% Music: 20%
Reply
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7(current)

Logout Mark Read Team Forum Stats Members Help
Kodi skin localize VS Code extension0