Repository navigation
Adopt gottext into the framework #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ea82c89
feat(gottext): adopt the gettext brick at 0.3.0
SirLouen 88c828b
build(ci): run and publish the node brick
SirLouen 24271f9
fix(ci): read the pnpm version from the brick manifest
SirLouen fc36c4d
build(ci): stop persisting the checkout token
SirLouen 299a00f
build(ci): publish from a verified artifact
SirLouen 4307196
docs(gottext): name the prefixed release tag
SirLouen 8335f35
docs: hyphenate the compound modifiers
SirLouen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: publish-gottext | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "gottext/v*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| pack: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: gottext | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | ||
| with: | ||
| package_json_file: gottext/package.json | ||
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | ||
| with: | ||
| node-version: 22 | ||
| - name: Verify the tag matches the package version | ||
| run: | | ||
| tag_version="${GITHUB_REF_NAME#gottext/v}" | ||
| pkg_version="$(node -p "require('./package.json').version")" | ||
| if [ "$tag_version" != "$pkg_version" ]; then | ||
| echo "tag $tag_version does not match package.json version $pkg_version" >&2 | ||
| exit 1 | ||
| fi | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm run cover | ||
| - run: pnpm run build | ||
| - run: npm pack | ||
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: package | ||
| path: gottext/*.tgz | ||
| retention-days: 1 | ||
|
|
||
| publish: | ||
| needs: pack | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | ||
| with: | ||
| node-version: ">=22.14.0 <23" | ||
| - name: Update npm for trusted publishing | ||
| run: npm install -g npm@11.19.1 --ignore-scripts | ||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: package | ||
| - run: npm publish ./*.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules/ | ||
| dist/ | ||
| coverage/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Changelog | ||
|
|
||
| Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| versioning follows [Semantic Versioning](https://semver.org/). While at 0.x, | ||
| minor releases may break. Releases are tagged `gottext/vX.Y.Z` and publish | ||
| from CI. | ||
|
|
||
| ## [0.3.0] - 2026-08-25 | ||
|
|
||
| ### Added | ||
|
|
||
| - `pushTranslations`, which carries every held catalogue of a supported language | ||
| to the platform with its fuzzy flags, trimmed to the template so a stale file | ||
| revives nothing, and holding back every answer the platform has settled so a | ||
| push never overwrites a reviewer. | ||
| - `addLanguage` on the platform seam, and the push adds and fills a supported | ||
| language the platform does not list yet. | ||
| - Upload pacing, one paced retry when the platform answers its rate refusal. | ||
| - A fuzzy aware merge, where a reviewed answer settles a fuzzy one and a fuzzy | ||
| export never replaces a settled answer, restored answers keeping their flag. | ||
| - `unreviewed`, which names the answers still carrying the fuzzy flag. | ||
|
|
||
| ### Changed | ||
|
|
||
| - Clearing a fuzzy flag alone now counts as a meaningful change, so a pull | ||
| writes an approval home even when the text did not move. | ||
|
|
||
| ## [0.2.0] - 2026-08-24 | ||
|
|
||
| ### Added | ||
|
|
||
| - `errorText`, which shows a refused answer in the reader's own language, | ||
| filling the template its code names from the values the answer carries and | ||
| speaking the server's own words when no template fits. The caller supplies | ||
| the templates and the words to fall back on, so both stay translatable. | ||
| - A `./testing` entry with `resetLocale`, which takes every text domain and the | ||
| display locale back to their sources between tests. | ||
| - `globCatalogs`, which turns the lazy chunks a bundler globbed into the loader | ||
| a catalogue entry wants, reading the locale from each file's own name. | ||
|
|
||
| ### Changed | ||
|
|
||
| - `startLocale` shows the default locale from the moment it is asked, so | ||
| `displayLocale` and `formatDate` never answer en-US to a consumer whose | ||
| sources are written in another locale. | ||
|
|
||
| ## [0.1.1] - 2026-08-21 | ||
|
|
||
| ### Added | ||
|
|
||
| - `resolvedVersions` and `pinnedVersions`, which read a pnpm lockfile and the | ||
| manifests that pin a package, so a repository can gate itself against | ||
| resolving two copies of anything that holds module state. | ||
|
|
||
| ### Fixed | ||
|
|
||
| - A message sharing its name with an object prototype member, `constructor` and | ||
| `toString` among them, no longer crashes the gates or slips past the orphan | ||
| check. | ||
| - `serializeCatalog` answers readable JSON for a catalogue carrying no metadata | ||
| entry, where it used to write the bare word undefined. | ||
|
|
||
| ## [0.1.0] - 2026-08-20 | ||
|
|
||
| ### Added | ||
|
|
||
| - `startLocale`, which resolves a locale, loads every catalogue in parallel and | ||
| sets each under its own text domain before it returns. A catalogue naming no | ||
| domain lands under the default domain the WordPress packages read. | ||
| - `displayLocale`, `rememberLocale` and `formatDate`, the seam dates and numbers | ||
| follow. `formatDate` takes a date or the text a server stored, and the options | ||
| bag any real format needs. | ||
| - `pot`, which extracts messages through the four gettext call shapes and | ||
| optionally through Go markers and templates. The Go walk reads nothing unless | ||
| it is given roots. | ||
| - `compileCatalog` and `serializeCatalog`, turning PO sources into the JSON a | ||
| locale chunk ships, metadata entry first and deterministic. | ||
| - `untranslated`, `orphaned` and `mismatched`, the three gates over a | ||
| catalogue's health. `mismatched` refuses a translation whose placeholders | ||
| its message does not name, bare placeholders included. | ||
| - `syncTranslations` and `poeditorAt`, which carry translations home from a | ||
| platform. A translation once set is never removed by a sync, and the summary | ||
| says how many answers were kept where the platform holds nothing. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.