Forum Discussion

monkeysource's avatar
9 years ago

Localised images not loading

Hi,

I'm trying to localise some images, but they are not being found within the locale folder. 

My folder structure is as follows:

locale
   default
        images/try.png
   en_GB
        images/try.png

And my XML is


<Poster
                id="tryPoster"
                uri="pkg:/locale/images/try.png"
                translation="[227.0,104.0]" />  


But the image will no load, unless I give it an exact URI to a specific localised directory. I've confirmed my locale is "en_GB" from GetCurrentLocale() function on the device. 


Thanks,

Ryan

8 Replies

  •      uri="pkg:/locale/images/try.png"

    This should be    uri="pkg:/locale/en_GB/images/try.png" if you are going direct.
     Sorry i can't address any SG differences to the translation system, but this is B/S for getting an image.
    m.localization = CreateObject("rolocalization")
    flyloco = m.localization.GetLocalizedAsset("images", "flyco.png")
  • Thanks for the reply. Yes, going direct with the uri suggested does work, I've tried this to simply prove the images were packaged and deployed correctly.

    But I don't want to go direct. I want to use the SG localisation system, which is documented as my uri in the first post. The docs suggest this uri is recognised and will be translated correctly to the appropriate localised asset.

    Thanks,

    Ryan
  • I  found that page confusing. What you say is correct, however right below that is this:

    For example, if you want to have a localized version of a graphical image for Canadian French, and a default image for all other languages, place two versions of the image in the 
    pkg:/locale


    directory as follows:[/font]

    pkg:/locale/fr_CA/images/image_name_canadian_french 
    pkg:/locale/default/images/image_name_default


    I would try this, as it's the way it works in B/S. 
  • "monkeysource" wrote:
    I want to use the SG localisation system, which is documented as my uri in the first post. The docs suggest this uri is recognised and will be translated correctly to the appropriate localised asset.

    Seems you are doing it right and there is a bug, yes.
  • TheEndless's avatar
    TheEndless
    Channel Surfer
    I'm pretty sure you need to set the URI in your Brightscript code.  I don't think localization is automatically supported in the SceneGraph XML.
  • TheEndless's avatar
    TheEndless
    Channel Surfer
    "monkeysource" wrote:
    The docs say it is supported

    You're absolutely correct.  Sorry.. I missed that..  :oops:
  • "monkeysource" wrote:
    I'm finding a few bugs, and it would be good to get the docs updated to reflect them to save others wasting time. 
    Does anyone know if there is a formal bug report process?

    Email developer at roku.com and pray that one of the Co's "hermit evangelists" (an oxymoron if ever there was one) will hit "Reply".

    Also report in this forum - or rather start from here (as you did) - since sometimes things one suspects are bugs have undocumented-but-community-known reason being "features".

    PS. if you are finding only "a few" bugs, you are not looking hard enough  Smiley LOL 
    PPS. Fingers crossed that the RSG URI localization was never implemented in the first place - i just posted </humble>a much better<humble> proposal at viewtopic.php?f=34&t=96446 😛