localized description and img

Talk about add-ons and extension development.
Post Reply
franketto
Posts: 43
Joined: June 16th, 2014, 7:46 am

localized description and img

Post by franketto »

I have 2 questions:
1) in the .rdf file of my bootstrapped extension, I wrote:

Code: Select all

    <Description about="urn:mozilla:install-manifest">
        <em:type>2</em:type>
        <em:id>YouTube_Mouse_Wheel@franketto.it</em:id>
        <em:name>Video Mouse Wheel</em:name>
        <em:version>1.6.5</em:version>
        <em:unpack></em:unpack>
        <em:bootstrap>true</em:bootstrap>
        <em:creator>franketto</em:creator>
       <em:localized>
        <Description>
         <em:locale>it-IT</em:locale>
         <em:description>Usa la rotellina per controllare video/audio/qualità dei video</em:description>
        </Description>
      </em:localized>
      <em:localized>
        <Description>
         <em:locale>en-EN</em:locale>
         <em:description>Use wheel to control video/audio/quality of video</em:description>
         </Description>
      </em:localized>
        <em:targetApplication>
....
    </Description>
</RDF>


I have Italian settings in FF, but it doesn't show "Usa la rotellina...", instead it shows the entire long text from the AMO localization I've done.

2)
Also if I click "other" it expands all the text I inserted in AMO with a tiny pic on the top left, always taken from AMO.
I would insert another img in the explanation when opened from the browser: how to do it?
I tried to modify the AMO description but it allows only to insert <a> links and it shows only the link, not the img.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: localized description and img

Post by lithopsian »

You can simply place a file called icon.png in the base directory of your addon and it will be used. I don't know if this overrides the one you upload to AMO.

You can upload a 32x32px and a 64x64px icon to AMO. If you are only seeing a tiny one, you might need to upload a bigger one. Or maybe check what you have in your xpi file.
franketto
Posts: 43
Joined: June 16th, 2014, 7:46 am

Re: localized description and img

Post by franketto »

No, it's not what I need.
I tried with the file icon.png and it used it in the tiny icon in the main page where it lists all the addon. This is the icon addon.
When you click "other" to enter the long description of the specific addon, there is one of the imgs I uploaded in AMO to describe how the addon works and the description text correctly localized. However here the image is like a big icon on the top left, tiny and you can't open it bigger (while in AMO you can).
BUT, what I want is insert a picture -bigger- *inside* this long description, to make it more clear. In AMO you can't: you can use only <a> and little other HTML, no <IMG>. One can of course click to AMO link and there get the bigger img, but I would like to make this more straightforward.
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: localized description and img

Post by Noitidart »

Documentation on localizing the install.rdf is missing on MDN i'll try to update it soon. I'm pretty sure that AMO uses the default entries from install.rdf and to display your page in different languges they use their own server side translation. So your localized install.rdf entries only get used by the browser.

Your issue is you didn't define defaults. You must define default and then whatever is default can be localized. So any entries between localized tags MUST also exist outside of any localized tag, the ones existing outside of the localized tag are the defaults.

This is a properly locacled install.rdf which uses icon.png from the root directory:
https://github.com/Noitidart/AysncZip/b ... nstall.rdf

This is how to use custom icon path iconURL and iconURL64 (to use this method though for bootstrap you have to set a chrome.manifest file), this install.rdf is also properly localized: https://github.com/Noitidart/Run-on-New ... ll.rdf#L12
the chrome.manifest file for this: https://github.com/Noitidart/Run-on-New ... e.manifest

Try copying iconURL into localized groups with different urls let me know if it gets localized :) Im interested :)
Last edited by Noitidart on May 24th, 2015, 11:35 pm, edited 5 times in total.
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: localized description and img

Post by Noitidart »

I tested to see if iconURL can be localized and it can't :(

https://github.com/NoitForks/Run-on-New ... c1de5b9904

Heres how i tried to loclalize the icons: https://github.com/NoitForks/Run-on-New ... ll.rdf#L49
Notice i put when en-GB _other.png

Test by changing your pref from about:config of general.useragent.locale to en-US then restarting or en-GB then restarting you'll notice in the addon manager the creator, title, description change but the icon does not :(
franketto
Posts: 43
Joined: June 16th, 2014, 7:46 am

Re: localized description and img

Post by franketto »

I don't know what's going on, here.

It doesn't work neither the icon localized nor the long description text!
It changes correctly the short text description in the main page, but after pressing "other", it should load the AMO localized long text, instead it remains the "it" text (that also isn't the default one, that should be en-US as AMO settings)!

EDIT:
weird, also going to AMO site with en-US settings in general.useragent.locale, it shows me "it" text! (recently updated FF38.0.1)
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: localized description and img

Post by Noitidart »

franketto wrote:I don't know what's going on, here.

It doesn't work neither the icon localized nor the long description text!
It changes correctly the short text description in the main page, but after pressing "other", it should load the AMO localized long text, instead it remains the "it" text (that also isn't the default one, that should be en-US as AMO settings)!

EDIT:
weird, also going to AMO site with en-US settings in general.useragent.locale, it shows me "it" text! (recently updated FF38.0.1)


install the addons from the repositories i linked you. you can install the addon straight from github with this addon: https://addons.mozilla.org/en-US/firefo ... installer/ then youll see the localization.

modifying the preference in firefox will have no affect on how AMO shows. thats server side stuff.
franketto
Posts: 43
Joined: June 16th, 2014, 7:46 am

Re: localized description and img

Post by franketto »

You're right, I forgot the server side...

Anyway, it doesn't work with icon, text yes.
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: localized description and img

Post by Noitidart »

franketto wrote:You're right, I forgot the server side...

Anyway, it doesn't work with icon, text yes.

Thanks for verificaiton. If changing icon is very important you can definitely write custom code. Im thinking in on startup of addon detect the general.useragent pref setting for langugae, then based on dynamically that edit your install.rdf, then using AddonMnager.jsm self disable and self enable (may need to self install) your addon.
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: localized description and img

Post by patrickjdempsey »

This is why it's generally considered best practice to not include text in your logo. Also, in some cases Firefox may be pulling the icon from addons.mozilla.org and not from the extension installer.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: localized description and img

Post by Noitidart »

patrickjdempsey wrote:This is why it's generally considered best practice to not include text in your logo. Also, in some cases Firefox may be pulling the icon from addons.mozilla.org and not from the extension installer.

Oh thats a good point i think the install dialog that pops up in Firefox, after click on "add to firefox" button from AMO, uses the icon from AMO.
Post Reply