-
Notifications
You must be signed in to change notification settings - Fork 69
l10n title/description for install.rdf like nodejs #495
Conversation
This is based on #419 The original one have more than 1 additional functions and needs more tweak, so I've rewritten the l10n part according to jpm code style(maybe?)
Here's a sample to test the functional https://github.com/jc3213/jpm/releases/download/1.0.5/test.zip @kumar303 Will you please have a look into this? |
There's also contributors, translators, and developers tags too, but it needs more tweak to make this part work well. This also reverted last commit https://github.com/jc3213/jpm/commit/925d2979c7e6f3d29fe172bf814ad6c5be57f7d6
Yay, thanks for doing this. 👍 This would fix #479. You should probably add a test if this works properly, though. |
@johannhof That's been done, please have a look into it |
I've added the original title and description in order to fulfill the complete test that if only title/description get localized. If so get original description/title. For example: |
var l10nDescription = { | ||
"em:locale": locale, | ||
"em:name": l10n.title || manifest.title || manifest.name || "Untitled", | ||
"em:description": l10n.description || manifest.description || undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: || undefined
can be removed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did keep that to match line 52 "em:description": manifest.description || undefined,
I think It should be better to let it this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, no idea what jsontoxml does for other falsy values, so it's probably best to leave it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed them to jetpackMeta["em:name"]
and jetpackMeta["em:description"]
, and in this way its faster than calculate the name and description again
it failed on `npm run jscs` but works on `npm test unit` and could build add-on correctly
@johannhof @kumar303 this pull requests couldn't solve According to document on MDN about package.json https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json It seems there is no need to support <em:localized>
<Description>
<em:locale>ja</em:locale>
<em:name>ja addon name</em:name>
<em:description>ja addon desc</em:description>
<em:creator>author</em:creator>
<em:homepageURL>homepage</em:homepageURL>
</Description>
</em:localized> |
} | ||
}); | ||
var locales = xml.getElementsByTagName("em:localized"); | ||
var locale_ja = locales[0].childNodes[1]; // Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all variables typically follow camel case format, such as localeJa
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kumar303 That has been done
Thanks for all your work on this and sorry about the headaches |
l10n title/description for install.rdf like nodejs
Thanks for the fix. |
Yes. Could someone edit MDN to add documentation? It's like a wiki so anyone can edit it. |
If I read the patch correctly, it allows to add the localization directly within the package.json using the Sebastian |
yes, please create a new issue |
Thanks for the quick answer! I've created #527. Sebastian |
Done: Sebastian |
The docs look great! Thank you |
This is based on #419 , But the original one have more than one additional functions and most of them need more tweak to be done. So I've rewritten the l10n part according to jpm code style(maybe?)