Skip to content

Upload directories of files, with hooks to rewrite text either way - #137

Merged
microbit-matt-hillsdon merged 1 commit into
mainfrom
i18n-tools-file-hooks
Sep 8, 2026
Merged

Upload directories of files, with hooks to rewrite text either way#137
microbit-matt-hillsdon merged 1 commit into
mainfrom
i18n-tools-file-hooks

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Contributor

A files entry naming a directory can now carry a source directory, and upload sends every file under it, creating in Crowdin any it lacks. status reports each of them too.

beforeUpload(text, { name }) rewrites the English before it is compared and sent; afterDownload(text, { name, language }) rewrites a downloaded file before it is written. Together they keep a value that changes with every release out of Crowdin. pxt-microbit-ml's help pages pin the extension's version in a code block Crowdin treats as a string, so each release would otherwise change the source and unsettle the translation; its upload puts a placeholder there and its download restores the version from the English page.

--only takes a directory with a trailing slash and names an entry that matches nothing.

A `files` entry naming a directory can now carry a `source` directory,
and `upload` sends every file under it, creating in Crowdin any it lacks.
`status` reports each of them too.

`beforeUpload(text, { name })` rewrites the English before it is compared
and sent; `afterDownload(text, { name, language })` rewrites a downloaded
file before it is written. Together they keep a value that changes with
every release out of Crowdin. pxt-microbit-ml's help pages pin the
extension's version in a code block Crowdin treats as a string, so each
release would otherwise change the source and unsettle the translation;
its upload puts a placeholder there and its download restores the version
from the English page.

`--only` takes a directory with a trailing slash and names an entry that
matches nothing.
@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit ca34f2b into main Sep 8, 2026
3 checks passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the i18n-tools-file-hooks branch September 8, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant