@rocapine/community 0.20.0 → 0.21.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Locale-aware push copy for notify-comment / notify-like / notify-reaction.
|
|
2
2
|
//
|
|
3
|
-
// Every string below is a neutral built-in for the
|
|
4
|
-
// ships. An app with its own voice overrides ANY of them — per locale, per
|
|
3
|
+
// Every string below is a neutral built-in for each of the 23 locales the UI
|
|
4
|
+
// package ships. An app with its own voice overrides ANY of them — per locale, per
|
|
5
5
|
// key — through ONE JSON secret instead of forking the function bodies (the
|
|
6
6
|
// way one host app had to before this existed):
|
|
7
7
|
//
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
// Placeholders: `{name}` (actor display name) and `{count}` (the number of
|
|
19
19
|
// OTHER people in a coalesced push). A `*.many` value is either a string or a
|
|
20
20
|
// `{ one, few, many, other }` object picked by the CLDR plural category of
|
|
21
|
-
// `{count}` for the recipient's locale (Polish needs all three; Ukrainian
|
|
22
|
-
// Romanian one/few/other; French treats 0
|
|
21
|
+
// `{count}` for the recipient's locale (Polish needs all three; Ukrainian,
|
|
22
|
+
// Russian, Croatian, Czech, Slovak and Romanian one/few/other; French treats 0
|
|
23
|
+
// like 1; everything else is one/other).
|
|
23
24
|
//
|
|
24
25
|
// Legacy single-string secrets still apply, below the JSON and above the
|
|
25
26
|
// built-ins: COMMUNITY_FALLBACK_NAME (every locale's fallbackName) and
|
|
@@ -186,6 +187,242 @@ const BUILTIN: Record<string, LocaleCopy> = {
|
|
|
186
187
|
other: "{name} und {count} weitere Personen denken an dich",
|
|
187
188
|
},
|
|
188
189
|
},
|
|
190
|
+
"fr-vous": {
|
|
191
|
+
fallbackName: "Quelqu'un",
|
|
192
|
+
photo: "📷 Photo",
|
|
193
|
+
"comment.title": "Vous avez reçu un commentaire",
|
|
194
|
+
"reply.title": "Vous avez reçu une réponse",
|
|
195
|
+
"like.one": "{name} a aimé votre publication",
|
|
196
|
+
"like.many": {
|
|
197
|
+
one: "{name} et {count} autre personne ont aimé votre publication",
|
|
198
|
+
other: "{name} et {count} autres personnes ont aimé votre publication",
|
|
199
|
+
},
|
|
200
|
+
"reaction.one": "{name} pense à vous",
|
|
201
|
+
"reaction.many": {
|
|
202
|
+
one: "{name} et {count} autre personne pensent à vous",
|
|
203
|
+
other: "{name} et {count} autres personnes pensent à vous",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
ko: {
|
|
207
|
+
fallbackName: "누군가",
|
|
208
|
+
photo: "📷 사진",
|
|
209
|
+
"comment.title": "새 댓글이 달렸어요",
|
|
210
|
+
"reply.title": "새 답글이 달렸어요",
|
|
211
|
+
"like.one": "{name}님이 내 게시글을 좋아해요",
|
|
212
|
+
"like.many": {
|
|
213
|
+
one: "{name}님 외 {count}명이 내 게시글을 좋아해요",
|
|
214
|
+
other: "{name}님 외 {count}명이 내 게시글을 좋아해요",
|
|
215
|
+
},
|
|
216
|
+
"reaction.one": "{name}님이 나를 생각하고 있어요",
|
|
217
|
+
"reaction.many": {
|
|
218
|
+
one: "{name}님 외 {count}명이 나를 생각하고 있어요",
|
|
219
|
+
other: "{name}님 외 {count}명이 나를 생각하고 있어요",
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
ro: {
|
|
223
|
+
fallbackName: "Cineva",
|
|
224
|
+
photo: "📷 Fotografie",
|
|
225
|
+
"comment.title": "Ai primit un comentariu",
|
|
226
|
+
"reply.title": "Ai primit un răspuns",
|
|
227
|
+
"like.one": "{name} a apreciat postarea ta",
|
|
228
|
+
"like.many": {
|
|
229
|
+
one: "{name} și încă o persoană au apreciat postarea ta",
|
|
230
|
+
few: "{name} și încă {count} persoane au apreciat postarea ta",
|
|
231
|
+
other: "{name} și încă {count} de persoane au apreciat postarea ta",
|
|
232
|
+
},
|
|
233
|
+
"reaction.one": "{name} se gândește la tine",
|
|
234
|
+
"reaction.many": {
|
|
235
|
+
one: "{name} și încă o persoană se gândesc la tine",
|
|
236
|
+
few: "{name} și încă {count} persoane se gândesc la tine",
|
|
237
|
+
other: "{name} și încă {count} de persoane se gândesc la tine",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
uk: {
|
|
241
|
+
fallbackName: "Хтось",
|
|
242
|
+
photo: "📷 Фото",
|
|
243
|
+
"comment.title": "У тебе новий коментар",
|
|
244
|
+
"reply.title": "У тебе нова відповідь",
|
|
245
|
+
"like.one": "{name} вподобав(ла) твій допис",
|
|
246
|
+
"like.many": {
|
|
247
|
+
one: "{name} і ще {count} людина вподобали твій допис",
|
|
248
|
+
few: "{name} і ще {count} людини вподобали твій допис",
|
|
249
|
+
other: "{name} і ще {count} людей вподобали твій допис",
|
|
250
|
+
},
|
|
251
|
+
"reaction.one": "{name} думає про тебе",
|
|
252
|
+
"reaction.many": {
|
|
253
|
+
one: "{name} і ще {count} людина думають про тебе",
|
|
254
|
+
few: "{name} і ще {count} людини думають про тебе",
|
|
255
|
+
other: "{name} і ще {count} людей думають про тебе",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
nl: {
|
|
259
|
+
fallbackName: "Iemand",
|
|
260
|
+
photo: "📷 Foto",
|
|
261
|
+
"comment.title": "Je hebt een reactie ontvangen",
|
|
262
|
+
"reply.title": "Je hebt een antwoord ontvangen",
|
|
263
|
+
"like.one": "{name} vindt je post leuk",
|
|
264
|
+
"like.many": {
|
|
265
|
+
one: "{name} en {count} ander vinden je post leuk",
|
|
266
|
+
other: "{name} en {count} anderen vinden je post leuk",
|
|
267
|
+
},
|
|
268
|
+
"reaction.one": "{name} denkt aan je",
|
|
269
|
+
"reaction.many": {
|
|
270
|
+
one: "{name} en {count} ander denken aan je",
|
|
271
|
+
other: "{name} en {count} anderen denken aan je",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
ru: {
|
|
275
|
+
fallbackName: "Кто-то",
|
|
276
|
+
photo: "📷 Фото",
|
|
277
|
+
"comment.title": "У тебя новый комментарий",
|
|
278
|
+
"reply.title": "У тебя новый ответ",
|
|
279
|
+
"like.one": "{name} оценил(а) твой пост",
|
|
280
|
+
"like.many": {
|
|
281
|
+
one: "{name} и ещё {count} человек оценили твой пост",
|
|
282
|
+
few: "{name} и ещё {count} человека оценили твой пост",
|
|
283
|
+
other: "{name} и ещё {count} человек оценили твой пост",
|
|
284
|
+
},
|
|
285
|
+
"reaction.one": "{name} думает о тебе",
|
|
286
|
+
"reaction.many": {
|
|
287
|
+
one: "{name} и ещё {count} человек думают о тебе",
|
|
288
|
+
few: "{name} и ещё {count} человека думают о тебе",
|
|
289
|
+
other: "{name} и ещё {count} человек думают о тебе",
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
el: {
|
|
293
|
+
fallbackName: "Κάποιος",
|
|
294
|
+
photo: "📷 Φωτογραφία",
|
|
295
|
+
"comment.title": "Έλαβες ένα σχόλιο",
|
|
296
|
+
"reply.title": "Έλαβες μια απάντηση",
|
|
297
|
+
"like.one": "{name} έκανε like στη δημοσίευσή σου",
|
|
298
|
+
"like.many": {
|
|
299
|
+
one: "{name} και {count} ακόμα άτομο έκαναν like στη δημοσίευσή σου",
|
|
300
|
+
other: "{name} και {count} ακόμα άτομα έκαναν like στη δημοσίευσή σου",
|
|
301
|
+
},
|
|
302
|
+
"reaction.one": "{name} σε σκέφτεται",
|
|
303
|
+
"reaction.many": {
|
|
304
|
+
one: "{name} και {count} ακόμα άτομο σε σκέφτονται",
|
|
305
|
+
other: "{name} και {count} ακόμα άτομα σε σκέφτονται",
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
hu: {
|
|
309
|
+
fallbackName: "Valaki",
|
|
310
|
+
photo: "📷 Fotó",
|
|
311
|
+
"comment.title": "Hozzászólást kaptál",
|
|
312
|
+
"reply.title": "Választ kaptál",
|
|
313
|
+
"like.one": "{name} kedvelte a bejegyzésedet",
|
|
314
|
+
"like.many": {
|
|
315
|
+
one: "{name} és még {count} ember kedvelte a bejegyzésedet",
|
|
316
|
+
other: "{name} és még {count} ember kedvelte a bejegyzésedet",
|
|
317
|
+
},
|
|
318
|
+
"reaction.one": "{name} gondol rád",
|
|
319
|
+
"reaction.many": {
|
|
320
|
+
one: "{name} és még {count} ember gondol rád",
|
|
321
|
+
other: "{name} és még {count} ember gondol rád",
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
sv: {
|
|
325
|
+
fallbackName: "Någon",
|
|
326
|
+
photo: "📷 Foto",
|
|
327
|
+
"comment.title": "Du har fått en kommentar",
|
|
328
|
+
"reply.title": "Du har fått ett svar",
|
|
329
|
+
"like.one": "{name} gillade ditt inlägg",
|
|
330
|
+
"like.many": {
|
|
331
|
+
one: "{name} och {count} annan gillade ditt inlägg",
|
|
332
|
+
other: "{name} och {count} andra gillade ditt inlägg",
|
|
333
|
+
},
|
|
334
|
+
"reaction.one": "{name} tänker på dig",
|
|
335
|
+
"reaction.many": {
|
|
336
|
+
one: "{name} och {count} annan tänker på dig",
|
|
337
|
+
other: "{name} och {count} andra tänker på dig",
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
nb: {
|
|
341
|
+
fallbackName: "Noen",
|
|
342
|
+
photo: "📷 Bilde",
|
|
343
|
+
"comment.title": "Du har fått en kommentar",
|
|
344
|
+
"reply.title": "Du har fått et svar",
|
|
345
|
+
"like.one": "{name} likte innlegget ditt",
|
|
346
|
+
"like.many": {
|
|
347
|
+
one: "{name} og {count} annen likte innlegget ditt",
|
|
348
|
+
other: "{name} og {count} andre likte innlegget ditt",
|
|
349
|
+
},
|
|
350
|
+
"reaction.one": "{name} tenker på deg",
|
|
351
|
+
"reaction.many": {
|
|
352
|
+
one: "{name} og {count} annen tenker på deg",
|
|
353
|
+
other: "{name} og {count} andre tenker på deg",
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
da: {
|
|
357
|
+
fallbackName: "Nogen",
|
|
358
|
+
photo: "📷 Foto",
|
|
359
|
+
"comment.title": "Du har fået en kommentar",
|
|
360
|
+
"reply.title": "Du har fået et svar",
|
|
361
|
+
"like.one": "{name} synes godt om dit opslag",
|
|
362
|
+
"like.many": {
|
|
363
|
+
one: "{name} og {count} anden synes godt om dit opslag",
|
|
364
|
+
other: "{name} og {count} andre synes godt om dit opslag",
|
|
365
|
+
},
|
|
366
|
+
"reaction.one": "{name} tænker på dig",
|
|
367
|
+
"reaction.many": {
|
|
368
|
+
one: "{name} og {count} anden tænker på dig",
|
|
369
|
+
other: "{name} og {count} andre tænker på dig",
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
hr: {
|
|
373
|
+
fallbackName: "Netko",
|
|
374
|
+
photo: "📷 Fotografija",
|
|
375
|
+
"comment.title": "Imaš novi komentar",
|
|
376
|
+
"reply.title": "Imaš novi odgovor",
|
|
377
|
+
"like.one": "{name} je lajkao/la tvoju objavu",
|
|
378
|
+
"like.many": {
|
|
379
|
+
one: "{name} i još {count} osoba lajkali su tvoju objavu",
|
|
380
|
+
few: "{name} i još {count} osobe lajkali su tvoju objavu",
|
|
381
|
+
other: "{name} i još {count} osoba lajkali su tvoju objavu",
|
|
382
|
+
},
|
|
383
|
+
"reaction.one": "{name} misli na tebe",
|
|
384
|
+
"reaction.many": {
|
|
385
|
+
one: "{name} i još {count} osoba misle na tebe",
|
|
386
|
+
few: "{name} i još {count} osobe misle na tebe",
|
|
387
|
+
other: "{name} i još {count} osoba misle na tebe",
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
sk: {
|
|
391
|
+
fallbackName: "Niekto",
|
|
392
|
+
photo: "📷 Fotka",
|
|
393
|
+
"comment.title": "Máš nový komentár",
|
|
394
|
+
"reply.title": "Máš novú odpoveď",
|
|
395
|
+
"like.one": "{name} dal(a) like tvojmu príspevku",
|
|
396
|
+
"like.many": {
|
|
397
|
+
one: "{name} a {count} ďalší dali like tvojmu príspevku",
|
|
398
|
+
few: "{name} a {count} ďalší dali like tvojmu príspevku",
|
|
399
|
+
other: "{name} a {count} ďalších dali like tvojmu príspevku",
|
|
400
|
+
},
|
|
401
|
+
"reaction.one": "{name} myslí na teba",
|
|
402
|
+
"reaction.many": {
|
|
403
|
+
one: "{name} a {count} ďalší myslia na teba",
|
|
404
|
+
few: "{name} a {count} ďalší myslia na teba",
|
|
405
|
+
other: "{name} a {count} ďalších myslia na teba",
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
cs: {
|
|
409
|
+
fallbackName: "Někdo",
|
|
410
|
+
photo: "📷 Fotka",
|
|
411
|
+
"comment.title": "Máš nový komentář",
|
|
412
|
+
"reply.title": "Máš novou odpověď",
|
|
413
|
+
"like.one": "{name} ocenil(a) tvůj příspěvek",
|
|
414
|
+
"like.many": {
|
|
415
|
+
one: "{name} a {count} další ocenili tvůj příspěvek",
|
|
416
|
+
few: "{name} a {count} další ocenili tvůj příspěvek",
|
|
417
|
+
other: "{name} a {count} dalších ocenili tvůj příspěvek",
|
|
418
|
+
},
|
|
419
|
+
"reaction.one": "{name} myslí na tebe",
|
|
420
|
+
"reaction.many": {
|
|
421
|
+
one: "{name} a {count} další myslí na tebe",
|
|
422
|
+
few: "{name} a {count} další myslí na tebe",
|
|
423
|
+
other: "{name} a {count} dalších myslí na tebe",
|
|
424
|
+
},
|
|
425
|
+
},
|
|
189
426
|
};
|
|
190
427
|
|
|
191
428
|
// Same rule set as the UI package's `pluralCategory` (packages/ui/src/i18n.ts).
|
|
@@ -198,11 +435,16 @@ export function pluralCategory(locale: string, n: number): keyof Forms {
|
|
|
198
435
|
if (m10 >= 2 && m10 <= 4 && !(m100 >= 12 && m100 <= 14)) return "few";
|
|
199
436
|
return "many";
|
|
200
437
|
}
|
|
201
|
-
if (lang === "uk") {
|
|
438
|
+
if (lang === "uk" || lang === "ru" || lang === "hr") {
|
|
202
439
|
if (m10 === 1 && m100 !== 11) return "one";
|
|
203
440
|
if (m10 >= 2 && m10 <= 4 && !(m100 >= 12 && m100 <= 14)) return "few";
|
|
204
441
|
return "other";
|
|
205
442
|
}
|
|
443
|
+
if (lang === "cs" || lang === "sk") {
|
|
444
|
+
if (n === 1) return "one";
|
|
445
|
+
if (n >= 2 && n <= 4) return "few";
|
|
446
|
+
return "other";
|
|
447
|
+
}
|
|
206
448
|
if (lang === "ro") {
|
|
207
449
|
if (n === 1) return "one";
|
|
208
450
|
if (n === 0 || (m100 >= 2 && m100 <= 19)) return "few";
|
|
@@ -228,7 +470,7 @@ const OVERRIDES = parseOverrides();
|
|
|
228
470
|
const LEGACY_FALLBACK_NAME = Deno.env.get("COMMUNITY_FALLBACK_NAME");
|
|
229
471
|
const LEGACY_REACTION_ONE = Deno.env.get("COMMUNITY_REACTION_PUSH_TEXT");
|
|
230
472
|
|
|
231
|
-
/** `es-MX` → `es-ES`, `pt-AO` → `pt-PT`, `fr-CA` → `fr`; unknown → `en`. */
|
|
473
|
+
/** `es-MX` → `es-ES`, `pt-AO` → `pt-PT`, `fr-CA` → `fr`, `no` → `nb`; unknown → `en`. */
|
|
232
474
|
function resolveLocale(locale: string | null | undefined): string {
|
|
233
475
|
if (!locale) return "en";
|
|
234
476
|
if (BUILTIN[locale]) return locale;
|
|
@@ -236,6 +478,7 @@ function resolveLocale(locale: string | null | undefined): string {
|
|
|
236
478
|
if (BUILTIN[lang]) return lang;
|
|
237
479
|
if (lang === "es") return "es-ES";
|
|
238
480
|
if (lang === "pt") return "pt-PT";
|
|
481
|
+
if (lang === "no") return "nb";
|
|
239
482
|
return "en";
|
|
240
483
|
}
|
|
241
484
|
|