fixes#128
When trying to update a resource on transifex, it catches the file not found response and tries to create it instead.
This required adding a function that will return the correct file type for the resource based on the repository. Note, this will fail for new repositories.
Also checking in package lock changes, although they appear to be just changing. `http` to `https`
Freshdesk doesn’t allow tags over 32 characters long, so filter them out and ignore them.
Information from Freshdesk “Bad Request” was not very helpful for debugging what was wrong. Added new script to pull just one locale from transifex, and optionally save local files instead of sending to Freshdesk.
* Fixed a bug in the push script (tags were not saved as correct structured json, so they weren’t getting put into transifex)
* extended FreshDesk API with functions to update knowledge base. Functions automatically try to create the item if it isn’t found for updating
* tx-pull-help-names: pulls category and folder name translations from transifex and updates them in Freshdesk (Note, since we don’t send people into the knowledge base, these aren’t really public, but the actual folders and categories have to exist to be able to save articles)
* tx-pull-help-articles: pull article translations from Transifex and update the Freshdesk KB.
* help-utils: utility functions for the tx-pull-help-* scripts. Handles limiting the number of things happening in parallel - currently two languages may be processed at the same time.
* Update Slack notification to always notify.
* Add optional parameter to `tx-pull-www` to pull just resources for a particular language. Helpful when validations are failing for one language.
* tx-pull-www: pull www translations from transifex
* validate-www: check www for correct placeholders
* add commands to pull and validate www to package.json
* add validating www to the test step
* add pulling www to the update-translations script for the cron job
* changed .tx/config to match the new folder names `scratch-website.<resource-slug>`, and added missing folders. This isn’t needed for the scripts, but it’s useful if you need to pull the translation for a single language/resource
The placeholder checking didn’t work if the translation’s grammar generated a different number of parsed elements.
E.g., in English:
something {placeholder} — two elements
translation
something {placeholder} something — three elements
I determined that placeholders are always array elements in the parsed array, so filter for Array elements and check that there are the same number of array elements.
* Add travis deploy step for cron job to update automatically.
* switch to reviewed translations
* make update script check for non-zero return codes from the update and test.
* bumped minor version
* added localeMap for converting between transifex locales and the ones used by Scratch (e.g., pt-br - pt_BR)
* using the transifex node package to automatically sync translations
* added scripts:
* sync_tx_src: uploads an en.json source file, for use by client packages
* sync_tx_translations: downloads gui translations, used by this repo, flattens Chrome i18n json into plain key-value json.
* sync_tx_blocks: same as above, but blocks need slightly different handling
* validate_translations: check the translation json files for basic translation errors
* tx_util - methods shared by sync and validate
* simplified build-data because jsons have already been flattened
* added new npm tasks
Create editor folder for all the editor components:
* blocks - from scratch-blocks
* extensions - from scratch-vm
* interface - from scratch-gui
* paint-editor - from scratch-paint.
Update the transifex config, initilaize with the english sources.
Export a combined editor-msgs.js in addition to individual files.
Renamed paint to paint-editor to match the name in transifex.
Add dependency on babel-cli and the intl plugins for extracting strings from source.
Include script for combining extracted strings into a single source chrome-i18n file as a binary from this package.
Breaking change - bumped major version to 2.
Restructured to support multiple components. Package default is just localeData for currently supported locales including the name for each language.
messages for each component are exported as separate files in locales. Clients of l10n will need to import messages for each of the compents used and combine them.