Commit graph

42 commits

Author SHA1 Message Date
Christopher Willis-Ford
fb47cd2c56 fix: require is not allowed in mjs files 2024-10-30 10:34:59 -07:00
Christopher Willis-Ford
905f004b15 fix: only retry the actual download
Some checks failed
CI/CD / build-and-deploy (push) Has been cancelled
Also, further improve error messaging
2024-10-29 08:57:22 -07:00
Christopher Willis-Ford
cfd31fda71 fix: fix mkdirp import 2024-10-29 08:27:10 -07:00
Christopher Willis-Ford
b501bddc6b feat: report progress during tx-pull-www 2024-10-29 08:27:03 -07:00
Christopher Willis-Ford
44c4b97581 refactor!: stop using babel-node
This should improve call stacks when debugging.

BREAKING CHANGE: Some files have been renamed from '.js' to '.mjs'
2024-10-28 13:48:36 -07:00
Christopher Willis-Ford
94c3353f54 feat: mark automated Transifex updates as fixes
Marking this a `feat` because it's effectively a versioning scheme
change.
2024-01-16 10:33:13 -08:00
Cori Hudson
113c0c095e fix: add missing stdout 2022-11-18 16:10:34 -05:00
Cori Hudson
2907601077 feat: migrate push help script 2022-11-18 16:10:34 -05:00
Cori Hudson
db7a2a4ca0 feat: migrate help utils to v3 api 2022-11-18 16:10:34 -05:00
Cori Hudson
34fcab3ce0 fix: remove unnecessary if statement 2022-10-07 16:07:47 -04:00
cori hudson
d6f1224931
fix: use tidier import for transifex imports
Co-authored-by: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com>
2022-10-07 15:41:47 -04:00
seotts
e1fda80b46 Push to transifex using new api
Remove bonus files
2022-10-03 13:36:55 -04:00
Cori Hudson
f298a58aeb fix: use stdout instead of console 2022-09-22 13:39:36 -04:00
Cori Hudson
bc151d5ef8 fix: fix some errors with validation and error output 2022-09-20 16:56:10 -04:00
Cori Hudson
137b6e3d09 fix(scripts): add retries, correct formatting for editor
retries flaky transifex api calls up to 5 times; converts message with description to plain message for editor translations
2022-09-20 14:40:38 -04:00
seotts
dd2ed99ece Use transifex .download() to download
Undo tr change
2022-09-20 14:40:26 -04:00
seotts
842704fb55 Asyncify www pull & handle failed pulls 2022-09-20 14:40:15 -04:00
seotts
9d30b4c4a3 Use new TX api to pull www translations
Comment
2022-09-20 14:40:15 -04:00
seotts
a342f9cf38 Pull editor l10n files with new api
comment

comment

rename

default
2022-09-20 14:40:13 -04:00
Christopher Willis-Ford
eee26f06c4 upgrade eslint, eslint-config-scratch, and friends 2022-06-07 23:12:33 -07:00
Chris Garrity
37fb96e9ba Modify push script to create non-existent resource
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`
2020-11-02 12:59:43 -05:00
Chris Garrity
0707c98d25 More error reporting
Provide more details about content and language that caused errors to diagnose translation errors.
2020-05-22 08:11:51 -04:00
Chris Garrity
d094f9c2e7 Exclude tags over 32 characters
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.
2020-05-18 12:24:06 -04:00
Chris Garrity
30b1975e94 Scripts to pull translations and update 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.
2020-05-06 14:46:09 -04:00
Chris Garrity
cea399a1f9 sync knowledge base sources
* Pulls data from Freshdesk solutions knowledge base.
* category names and folder names are plain key-value-json files
* Reformats article strings into a structured json for translation:
```
 [
  <article-key>: {
    title : {
      string: <title text>
    },
    description: {
      string: <title text>
    },
    tags: {
      string: <title text>
    },
…
]
```
2020-05-06 14:46:09 -04:00
adroitwhiz
a8087e8cc3 Validate extension input placeholders 2019-11-19 08:25:53 -05:00
chrisgarrity
a995aa5413 Helpers for failing validations
* 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.
2019-03-21 11:00:12 +01:00
chrisgarrity
50761ad970 New scripts to support www in scratch-l10n
* 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
2019-02-12 10:50:43 +01:00
chrisgarrity
7d38349a59 Fix placeholder checking
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.
2019-01-10 11:51:22 -05:00
chrisgarrity
7d3a81799f fix bad condition and add auth
And commit to master
2018-12-10 09:18:27 -05:00
chrisgarrity
a591ea9212 [WIP] conditions for cron job on travis 2018-12-07 08:40:46 -05:00
chrisgarrity
65b5158149 Add clarifying comment 2018-12-06 13:44:47 -05:00
chrisgarrity
475aee4a65 Automate and switch to reviewed
* 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.
2018-12-06 11:45:45 -05:00
chrisgarrity
1646441f4a rename files for clarity
also made the naming convention consistent (dashes not underscore)
2018-11-27 11:36:37 -05:00
chrisgarrity
0f1dafef0e Add bash script for committing sync updates
Also fix copy/paste typo in package.json
2018-11-27 07:32:34 -05:00
chrisgarrity
c286f62d69 Add scripts for automation
* 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
2018-11-25 18:05:44 -05:00
chrisgarrity
dbd31a4d36 Exclude blocks messages from the combined file
Scratch-blocks includes the blocks messages. Excluding them from the editor-msgs file will save >500kb
2018-07-25 15:16:23 -04:00
chrisgarrity
73f9b8619e Refactor data exported for GUI
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.
2018-05-21 09:42:53 -04:00
chrisgarrity
5eaf5ecefe Add pen extension
Add the pen extension and update all the translations.
2017-11-13 11:29:29 -05:00
chrisgarrity
12a43c94d3 Add script for building en.json
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.
2017-10-31 12:31:29 -04:00
chrisgarrity
0cb13cbaee Add scratch-paint
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.
2017-10-17 13:28:24 -04:00
chrisgarrity
4a9cdc7f4a L10n packaging (#1)
* Initial version of scratch-l10n package
2017-09-21 11:54:41 -04:00