@terrafirmagreg-team/crowdin 1.0.2 → 1.0.3

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.2",
3
+ "version": "1.0.3",
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.6",
24
- "@terrafirmagreg-team/kit": "^1.2.19",
25
- "@terrafirmagreg-team/translate": "^1.2.10",
26
- "@terrafirmagreg-team/ui": "^1.2.13",
23
+ "@terrafirmagreg-team/data": "^1.2.7",
24
+ "@terrafirmagreg-team/kit": "^1.2.20",
25
+ "@terrafirmagreg-team/translate": "^1.2.11",
26
+ "@terrafirmagreg-team/ui": "^1.2.14",
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 displayNames = new Intl.DisplayNames([lang.replace(/_/g, '-')], {
194
- type: 'language',
195
- });
196
- return (id) => {
197
- try {
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<
@@ -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 ?? [])]