@terrafirmagreg-team/crowdin 1.0.2 → 1.0.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrafirmagreg-team/crowdin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Crowdin project members (translator avatars)",
|
|
6
6
|
"license": "LGPL-3.0-only",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@crowdin/crowdin-api-client": "1.59.2",
|
|
23
|
-
"@terrafirmagreg-team/data": "^1.2.
|
|
24
|
-
"@terrafirmagreg-team/kit": "^1.2.
|
|
25
|
-
"@terrafirmagreg-team/translate": "^1.2.
|
|
26
|
-
"@terrafirmagreg-team/ui": "^1.2.
|
|
23
|
+
"@terrafirmagreg-team/data": "^1.2.12",
|
|
24
|
+
"@terrafirmagreg-team/kit": "^1.2.27",
|
|
25
|
+
"@terrafirmagreg-team/translate": "^1.2.12",
|
|
26
|
+
"@terrafirmagreg-team/ui": "^1.2.18",
|
|
27
27
|
"lucide-react": "^1.70.0",
|
|
28
28
|
"server-only": "^0.0.1"
|
|
29
29
|
},
|
|
@@ -190,17 +190,11 @@ export function MembersGrid({
|
|
|
190
190
|
const [expanded, setExpanded] = useState<ReadonlySet<string>>(new Set());
|
|
191
191
|
|
|
192
192
|
const langName = useMemo<LangLabel>(() => {
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
return (id) =>
|
|
197
|
-
|
|
198
|
-
return displayNames.of(id) ?? id;
|
|
199
|
-
} catch {
|
|
200
|
-
return id;
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}, [lang]);
|
|
193
|
+
const names = new Map<string, string>();
|
|
194
|
+
for (const m of members)
|
|
195
|
+
for (const l of m.languages) if (l.name) names.set(l.id, l.name);
|
|
196
|
+
return (id) => names.get(id) ?? id;
|
|
197
|
+
}, [members]);
|
|
204
198
|
|
|
205
199
|
const groups = useMemo(() => {
|
|
206
200
|
const byLang = new Map<
|
package/src/lib/members.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type CrowdinLanguageProgress = {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
const client = () => {
|
|
65
|
-
const token = env('
|
|
65
|
+
const token = env('CROWDIN_TOKEN');
|
|
66
66
|
return token ? new Client({ token, organization: CROWDIN_ORG }) : undefined;
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -153,7 +153,7 @@ export const crowdinProgress = createAsyncCache(
|
|
|
153
153
|
total: p.words.total,
|
|
154
154
|
};
|
|
155
155
|
return out;
|
|
156
|
-
});
|
|
156
|
+
}, { staleWhileRevalidate: true });
|
|
157
157
|
},
|
|
158
158
|
(slug) => slug,
|
|
159
159
|
3_600_000,
|
|
@@ -219,7 +219,7 @@ export const crowdinMembers = createAsyncCache(
|
|
|
219
219
|
roles: roles.get(r.user.username) ?? [],
|
|
220
220
|
...joined(r.user.joined),
|
|
221
221
|
}));
|
|
222
|
-
});
|
|
222
|
+
}, { staleWhileRevalidate: true });
|
|
223
223
|
},
|
|
224
224
|
(slug, options) =>
|
|
225
225
|
`${slug}|${options?.minWords ?? ''}|${[...(options?.excludeUsers ?? [])]
|