goodfellow-language-fr 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +106 -2
- package/goodfellow-language.json +9732 -0
- package/package.json +35 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Goodfellow contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,107 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Français, a Goodfellow language pack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[Goodfellow](https://github.com/goodfellow-cms/goodfellow-cms)'s admin panel in French: every string of the admin panel, the editor's controls and the labels of Goodfellow's own blocks.
|
|
4
|
+
|
|
5
|
+
Install it from your site's admin panel: **Site Settings → Admin panel languages → Language packs**, search for French, look at how much of the admin panel it says, then **Install and publish**. Editors then choose Français from the language menu at the top. You can change any of its words afterwards with **Edit**, and updates to the pack keep what you changed. Language packs never update by themselves: when a new version is out, **Show** beside the installed pack offers it.
|
|
6
|
+
|
|
7
|
+
It's also the example to copy if you're making a language pack of your own, and the rest of this page goes through how it's made.
|
|
8
|
+
|
|
9
|
+
## Who has read it
|
|
10
|
+
|
|
11
|
+
Every string was translated by machine, following Goodfellow's glossary, and checked by its tests, but no French speaker has read it all yet, so none is marked `reviewed`. If you speak French, corrections are welcome: open an issue or a pull request, and mark the strings you've read with `"reviewed": true`. `npm run status` counts them.
|
|
12
|
+
|
|
13
|
+
## What's in it
|
|
14
|
+
|
|
15
|
+
A language pack is an npm package with no code: the admin panel's words in one language, which Goodfellow copies into a site's `content/admin-text/<code>.json` when an owner installs it. Its package has these files:
|
|
16
|
+
|
|
17
|
+
| File | What it is |
|
|
18
|
+
|---|---|
|
|
19
|
+
| [`package.json`](package.json) | Its name, version, and the Goodfellow releases it works with |
|
|
20
|
+
| [`goodfellow-language.json`](goodfellow-language.json) | The language, and its words |
|
|
21
|
+
| [`test/language.test.mjs`](test/language.test.mjs) | Checks it as Goodfellow will when someone installs it |
|
|
22
|
+
| [`scripts/status.mjs`](scripts/status.mjs) | Lists what's missing or out of date, to translate next |
|
|
23
|
+
|
|
24
|
+
### package.json
|
|
25
|
+
|
|
26
|
+
- **`name`** is `goodfellow-language-<name>`, or `@you/goodfellow-language-<name>`. The Admin panel languages screen lists only packages named this way.
|
|
27
|
+
- **`keywords`** include `goodfellow-language`, which is how the screen finds language packs on npm.
|
|
28
|
+
- **`peerDependencies`** names the Goodfellow releases the pack works with, as a range on `@goodfellow-cms/core`, such as `>=0.9.0 <1.0.0`. A version is offered only to sites on a release in that range, and a version without one is never offered. Strings a new release adds show in English until the pack has them, so widen the range once you've translated them.
|
|
29
|
+
- **`files`** lists `goodfellow-language.json`, since only the files listed are published.
|
|
30
|
+
- **`repository`** is where it's built from, which npm checks when it's published with provenance.
|
|
31
|
+
|
|
32
|
+
### goodfellow-language.json
|
|
33
|
+
|
|
34
|
+
A site's admin text file, with the language's `code`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"version": 1,
|
|
39
|
+
"code": "fr",
|
|
40
|
+
"name": "Français",
|
|
41
|
+
"description": "Le panneau d'administration de Goodfellow en français.",
|
|
42
|
+
"strings": {
|
|
43
|
+
"nav.pages": { "text": "Pages", "source": "7decab7f" }
|
|
44
|
+
},
|
|
45
|
+
"puck": {
|
|
46
|
+
"header-publish": { "text": "Publier", "source": "6c6229a8" }
|
|
47
|
+
},
|
|
48
|
+
"labels": {
|
|
49
|
+
"Heading": { "text": "Titre" }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- **`code`** names the site's file, `content/admin-text/fr.json`, so a site has one pack for each language. Use the language's code, with a region where the words differ, such as `pt-BR`.
|
|
55
|
+
- **`name`** is the language's name in itself, as the language menu shows it.
|
|
56
|
+
- **`strings`** are the admin panel's own words, by the keys in Goodfellow's `packages/admin/src/strings.tsx`; **`puck`** is the editor's controls, by Puck's dictionary's keys; **`labels`** are blocks' names, settings and choices, by their English wording.
|
|
57
|
+
- **`source`** is a hash of the English the text was made from (`englishHash()` from `@goodfellow-cms/core`), so text whose English has changed in a later release is found again. Labels are keyed by their English, so they need none.
|
|
58
|
+
- **`reviewed`** marks text someone who speaks the language has read.
|
|
59
|
+
- **Keep every `{placeholder}`** as the English has it, such as `{title}`: the admin panel fills them in, and shows the English for any string whose placeholders differ, or that's empty.
|
|
60
|
+
|
|
61
|
+
The quickest start for a language of your own is a site's own file: on the Admin panel languages screen, **Add a language** translates it with the site's AI service, and **Edit** goes through it string by string. Copy `content/admin-text/<code>.json` into a package like this one and add `code`.
|
|
62
|
+
|
|
63
|
+
## Checking it
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
npm ci
|
|
67
|
+
npm test
|
|
68
|
+
npm run status
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`package-lock.json` names the Goodfellow release the test checks against, so every run checks the same one; Dependabot moves it on to newer ones in `devDependencies`' ranges, and `npm update` does the same by hand. `package.json`'s `overrides` give Puck, which Goodfellow's admin panel is built on, happy-dom 21.0.4 in place of the 20 it asks for, which fixes its security advisories, as Goodfellow's own sites have.
|
|
72
|
+
|
|
73
|
+
The test reads the pack with Goodfellow's own code and the admin panel's English (`@goodfellow-cms/admin/text`), and checks that `goodfellow-language.json` is valid, that it says every string the admin panel shows, that each is one the admin panel can use, that none was made from English that has changed since, and that it has nothing Goodfellow no longer says. When Dependabot brings a new Goodfellow release, the test lists what it added or changed, and `npm run status` shows each with its English, to translate. GitHub Actions runs it on every change ([`check.yml`](.github/workflows/check.yml)).
|
|
74
|
+
|
|
75
|
+
## Publishing a version
|
|
76
|
+
|
|
77
|
+
Every change that reaches the published pack needs a changeset: run `npx changeset`, choose patch, minor or major, and describe the change for the pack's users. It writes a file in `.changeset/`, which goes in the same pull request.
|
|
78
|
+
|
|
79
|
+
1. Run `npm run release:version`, which turns the changesets into a new `version` in `package.json` and an entry in `CHANGELOG.md`. Commit what it changes. Every release needs a new version: npm never lets one be published twice.
|
|
80
|
+
2. Once that's on `main`, tag it with `v` and the version, and push the tag, which starts [`publish.yml`](.github/workflows/publish.yml):
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
git switch main && git pull
|
|
84
|
+
git tag v0.1.1 && git push origin v0.1.1
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The workflow stops unless the tag matches `package.json`'s version and is on `main`.
|
|
88
|
+
3. [`publish.yml`](.github/workflows/publish.yml) checks the pack again and stages it on npm with [provenance](https://docs.npmjs.com/generating-provenance-statements), which the Admin panel languages screen shows owners: which repository and commit it was built from. A staged version isn't published: nobody can install it until a maintainer approves it. The run's page lists the digest of the file it staged.
|
|
89
|
+
4. Approve it from your computer, with npm 11.15 or later, signed in to npm (`npm login`): `npm stage list goodfellow-language-fr` lists what's waiting, with each one's id and digest. Compare the digest with the run's, then run `npm stage approve <id>`, which asks for your two-factor code and publishes it.
|
|
90
|
+
|
|
91
|
+
The workflow signs in to npm with [trusted publishing](https://docs.npmjs.com/trusted-publishers), so the repository holds no npm token, and it may only stage versions. Set it up once, with npm 11.15 or later, shortly before a release, since npm drops a trusted publisher that hasn't staged anything within 2 days:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
npm trust github goodfellow-language-fr --file publish.yml --repo goodfellow-cms/goodfellow-language-fr --allow-stage-publish --yes
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Then choose **Require two-factor authentication and disallow tokens** under the package's **Settings → Publishing access**, and keep pushing `v` tags to maintainers with a tag ruleset, as [Harbor's README](https://github.com/goodfellow-cms/goodfellow-theme-harbor#publishing-a-version) describes. A new package's first version has to be published from a computer (`npm publish --access public`), since trusted publishing is set up in a package's settings.
|
|
98
|
+
|
|
99
|
+
The Admin panel languages screen offers a version once it's 3 days old, since most harmful versions of npm packages are found and removed by then.
|
|
100
|
+
|
|
101
|
+
## Making it easy to find
|
|
102
|
+
|
|
103
|
+
Call your pack's repository `goodfellow-language-<name>` too, and give it the `goodfellow-language` topic: on GitHub, the gear beside **About** on the repository's page; on GitLab, **Settings → General → Topics**.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
[MIT](LICENSE)
|