@cosmicdrift/kumiko-locale-de 0.336.0 → 0.336.1
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/package.json +2 -2
- package/src/__tests__/formal.test.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-locale-de",
|
|
3
|
-
"version": "0.336.
|
|
3
|
+
"version": "0.336.1",
|
|
4
4
|
"description": "German UI and mail copy for Kumiko framework screens. Opt in by mounting localeDe() + localeDeClient().",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@cosmicdrift/kumiko-framework": "0.336.
|
|
31
|
+
"@cosmicdrift/kumiko-framework": "0.336.1"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"registry": "https://registry.npmjs.org",
|
|
@@ -12,6 +12,12 @@ function placeholders(s: string): string[] {
|
|
|
12
12
|
// dein\w* also catches inflected forms (deiner, deinem, deines, ...).
|
|
13
13
|
const duFormRegex = /\b(du|dich|dir|dein\w*|Du|Dich|Dir|Dein\w*)\b/;
|
|
14
14
|
|
|
15
|
+
// Informal imperatives carry no pronoun, so duFormRegex misses them. Only
|
|
16
|
+
// sentence-initial verbs are checked; formal forms (verb followed by "Sie") don't match
|
|
17
|
+
// because the regex requires the bare imperative followed by a non-letter.
|
|
18
|
+
const informalImperativeRegex =
|
|
19
|
+
/(^|[.!?]\s+)(Gib|Wähle|Speichere|Klicke|Bestätige|Fordere|Scanne|Kopiere|Lege|Melde|Versuche|Prüfe|Öffne|Setze|Trage|Nutze|Verwende|Wende)(?![\p{L}])/u;
|
|
20
|
+
|
|
15
21
|
describe("locale-de formal overrides", () => {
|
|
16
22
|
test("every override key exists in localeDeBundle", () => {
|
|
17
23
|
const orphaned = Object.keys(localeDeFormalOverrides).filter(
|
|
@@ -34,6 +40,14 @@ describe("locale-de formal overrides", () => {
|
|
|
34
40
|
expect(offenders).toEqual([]);
|
|
35
41
|
});
|
|
36
42
|
|
|
43
|
+
test("formal bundle contains no pronoun-less informal imperatives", () => {
|
|
44
|
+
const formalBundle = germanBundleFor("formal");
|
|
45
|
+
const offenders = Object.entries(formalBundle)
|
|
46
|
+
.filter(([, value]) => informalImperativeRegex.test(value))
|
|
47
|
+
.map(([key]) => key);
|
|
48
|
+
expect(offenders).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
|
|
37
51
|
test("informal bundle is unchanged and still uses du forms", () => {
|
|
38
52
|
const informalBundle = germanBundleFor("informal");
|
|
39
53
|
expect(informalBundle).toBe(localeDeBundle);
|