Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: POt update script issues

  1. #1
    abu baniaz's Avatar
    Title
    Moderator
    Join Date
    Sep 2010
    Location
    East London
    Posts
    23,579
    Thanks
    6,531
    Thanked 9,242 Times in 6,304 Posts

    POt update script issues

    When running the pot update script, the issues in the attachment are reported. Is it possible these can be addressed?
    Attached Files Attached Files

  2. #2
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    I answered that last time you asked.

    Code:
    translated_string = _("Our friend %s is %s years old.") % ('Abu', '50')
    Change to this:

    Code:
    translated_string = _("Our friend %(person)s is %(age)s years old.") % {"person": 'Abu', "age": '50'}
    Help keep OpenViX servers online.Please donate!

  3. #3
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,916
    Thanks
    243
    Thanked 1,678 Times in 1,322 Posts
    What has caused this change?

    Python is still happy with the first format, which exists all over enigma2.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  4. #4
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    Quote Originally Posted by birdman View Post
    What has caused this change?

    Python is still happy with the first format, which exists all over enigma2.
    Ok, then you don't seem to understand what the warning is for.

    If I want to change the order of variable_one and variable_two in the translated output it is impossible in the first case.
    Help keep OpenViX servers online.Please donate!

  5. #5
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,916
    Thanks
    243
    Thanked 1,678 Times in 1,322 Posts
    Quote Originally Posted by Huevos View Post
    Ok, then you don't seem to understand what the warning is for.
    I understand what it means.
    However, since the translation files only refer to the text in _() calls, something must have changed to start producing these messages now

    If I want to change the order of variable_one and variable_two in the translated output it is impossible in the first case.
    As in:
    The %{colour} %{shape}
    becoming, in French
    Le %{shape} ${colour}
    Last edited by birdman; 22-11-24 at 22:22.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  6. #6
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    Quote Originally Posted by birdman View Post
    I understand what it means.
    However, since the translation files only refer to the text in _() calls, something must have changed to start producing these messages now

    As in:
    The %{colour} %{shape}
    becoming, in French
    Le %{shape} $colour}
    Nothing has changed. Abu is referring to the shell script which can be used to produce the *.po files. That script has always raised these warnings.
    Help keep OpenViX servers online.Please donate!

  7. The Following User Says Thank You to Huevos For This Useful Post:

    birdman (22-11-24)

  8. #7
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,916
    Thanks
    243
    Thanked 1,678 Times in 1,322 Posts
    It's occurred to me (overnight) that there are probably few, if any, instances in Vix where having named args (for multiple arg striungs) would matter.

    Either these parameters are numbers (where I would expect the same order to obtain) or they are strings, in which case that actual parameter values need to be localized too.

    The %{colour} %{shape} example would need to be:

    "The %{colour} %{shape}" % { 'colour', _(colour), 'shape': _(shape) }

    with the po file containing translations for all potential colours and shapes. Does Vix do that?
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  9. #8
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    Quote Originally Posted by birdman View Post
    "The %{colour} %{shape}" % { 'colour', _(colour), 'shape': _(shape) }
    It needs to be:
    Code:
    _("The %(colour)s %(shape)s") % { 'colour': _(colour), 'shape': _(shape) }
    And yes that is valid. Do we use it? Probably not yet.

    But here you have a problem:
    Code:
    _(shape)
    There you are translating a variable. From where are you going to harvest the value of that variable to populate the pot file?
    Help keep OpenViX servers online.Please donate!

  10. #9
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,916
    Thanks
    243
    Thanked 1,678 Times in 1,322 Posts
    Quote Originally Posted by Huevos View Post
    But here you have a problem:
    Code:
    _(shape)
    There you are translating a variable. From where are you going to harvest the value of that variable to populate the pot file?
    No. You are translating the value of a variable...
    So you would need translations of square, triangle, circle ... - all values that shape might take. And you would need to know what those possibilities are.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  11. #10
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    So how are you going to harvest them?
    Help keep OpenViX servers online.Please donate!

  12. #11
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,916
    Thanks
    243
    Thanked 1,678 Times in 1,322 Posts
    Quote Originally Posted by Huevos View Post
    So how are you going to harvest them?
    You can't. There is no information in the code about what the values might be.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  13. #12
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    Well what is the point feeding them through gettext if they are not in the po file?

    On the other hand...
    https://github.com/OpenViX/enigma2/b...ns/Menu.py#L94
    Here they are translatable because they are harvested from the xml.
    Help keep OpenViX servers online.Please donate!

  14. #13
    abu baniaz's Avatar
    Title
    Moderator
    Join Date
    Sep 2010
    Location
    East London
    Posts
    23,579
    Thanks
    6,531
    Thanked 9,242 Times in 6,304 Posts
    The objective is to be able to update the po files on GitHub so people can work on them from there. Getting them from receiver is not the best option. As an example, I uploaded all the latest ones from an updated image, somebody else worked on the one on his box and took the file back.

    An example commit to resolve the issue from PLi is here:
    https://github.com/OpenPLi/enigma2/p...f4856067f03afa

  15. #14
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,916
    Thanks
    243
    Thanked 1,678 Times in 1,322 Posts
    Quote Originally Posted by birdman View Post
    ....with the po file containing translations for all potential colours and shapes. Does Vix do that?
    It occurs to me that it's a bit worse than that.
    French (German, Latin, ...) has gender for adjectives, so you'd need to have a male and female version of blue (bleu, bleue) and the same for all other colours, in all languages, even when they are the same. You'd also need a plural version for each, too (bleus).
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  16. #15
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    14,027
    Thanks
    2,067
    Thanked 5,178 Times in 3,418 Posts
    Quote Originally Posted by abu baniaz View Post
    An example commit to resolve the issue from PLi is here:
    https://github.com/OpenPLi/enigma2/p...f4856067f03afa
    I already posted that solution above.
    Help keep OpenViX servers online.Please donate!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.