Skip to content

Instantly share code, notes, and snippets.

@diox
Created February 4, 2015 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diox/c7a4667abc9a3df1ddff to your computer and use it in GitHub Desktop.
Save diox/c7a4667abc9a3df1ddff to your computer and use it in GitHub Desktop.
How to upload langpacks on Marketplace

How to upload langpacks on Marketplace

API Example using curling

Setup

$ pip install curling
$ echo '{"marketplace.firefox.com": {"key": "<replace-by-your-api-key>", "secret": "<replace-by-your-api-secret>"}}' > ~/.curling

Validate a langpack

$ base64 -w 0 /tmp/langpack.zip
$ curling -X POST -d '{"upload": {"type": "application/zip", "name": "langpack.zip", "data": "<paste-result-from-previous-line-here>"}}' https://marketplacefirefox.com/api/v2/apps/validation/

Check the validation result

$ curling https://marketplacefirefox.com/api/v2/apps/validation/<paste-validation-id-from-previous-line-here>/

Create a langpack from the validation result (once validation result says valid=true and processed=true)

$ curling -X POST -d '{"upload": "<paste-validation-id-from-previous-line-here>"}' https://marketplacefirefox.com/api/v2/langpacks/

Activate the langpack

Note: langpack uuid is different from the validation id, even though both are 32-chars hexadecimal strings.

$ curling -X PATCH -d '{"active": true}' https://marketplacefirefox.com/api/v2/langpacks/<paste-langpack-uuid-from-previous-line-here>/

Double-check that the langpack is now active

$ curling https://marketplacefirefox.com/api/v2/langpacks/<paste-langpack-uuid-from-previous-line-here>/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment