You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Thanks for your first contribution, @${author}! ${emoji}`,
41
+
'',
42
+
`We'd love to welcome you to the npmx community. Come and say hi on [Discord](https://chat.npmx.dev)! And once you've joined, visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim the **contributor** role.`,
43
+
].join('\n');
44
+
45
+
await github.rest.issues.createComment({
46
+
owner: context.repo.owner,
47
+
repo: context.repo.repo,
48
+
issue_number: pr.number,
49
+
body,
50
+
});
51
+
52
+
console.log(`Welcomed new contributor @${author} on PR #${pr.number}`);
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+115-3Lines changed: 115 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ This focus helps guide our project decisions as a community and what we choose t
39
39
-[Import order](#import-order)
40
40
-[Naming conventions](#naming-conventions)
41
41
-[Vue components](#vue-components)
42
+
-[Internal linking](#internal-linking)
42
43
-[RTL Support](#rtl-support)
43
44
-[Localization (i18n)](#localization-i18n)
44
45
-[Approach](#approach)
@@ -278,6 +279,79 @@ const props = defineProps<{
278
279
279
280
Ideally, extract utilities into separate files so they can be unit tested. 🙏
280
281
282
+
### Internal linking
283
+
284
+
Always use **object syntax with named routes** for internal navigation. This makes links resilient to URL structure changes and provides type safety via `unplugin-vue-router`.
For package links, use the auto-imported `packageRoute()` utility from `app/utils/router.ts`. It handles scoped/unscoped packages and optional versions:
> Never construct package URLs as strings. The route structure uses separate `org` and `name` params, and `packageRoute()` handles the splitting correctly.
> This file must be committed. Lunaria uses git history to track translation progress, so the build will fail if this file is missing.
339
413
340
414
5. If the language is `right-to-left`, add `dir: 'rtl'` (see `ar-EG` in config for example)
341
415
6. If the language requires special pluralization rules, add a `pluralRule` callback (see `ar-EG` or `ru-RU` in config for examples)
342
416
343
-
Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization) for more info.
417
+
Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization#custom-pluralization) and [Plural Rules](https://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories) for more info.
344
418
345
419
### Update translation
346
420
347
421
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/
348
-
If you see any outdated translations in your language, feel free to update the keys to match then English version.
422
+
If you see any outdated translations in your language, feel free to update the keys to match the English version.
349
423
350
424
In order to make sure you have everything up-to-date, you can run:
351
425
@@ -408,13 +482,51 @@ See how `es`, `es-ES`, and `es-419` are configured in [config/i18n.ts](./config/
408
482
<p>{{ $t('greeting', { name: userName }) }}</p>
409
483
```
410
484
485
+
4. Don't concatenate string messages in the Vue templates, some languages can have different word order. Use placeholders instead.
486
+
487
+
**Bad:**
488
+
489
+
```vue
490
+
<p>{{ $t('hello') }} {{ userName }}</p>
491
+
```
492
+
493
+
**Good:**
494
+
495
+
```vue
496
+
<p>{{ $t('greeting', { name: userName }) }}</p>
497
+
```
498
+
499
+
**Complex content:**
500
+
501
+
If you need to include HTML or components inside the translation, use [`i18n-t`](https://vue-i18n.intlify.dev/guide/advanced/component.html) component. This is especially useful when the order of elements might change between languages.
502
+
503
+
```json
504
+
{
505
+
"agreement": "I accept the {terms} and {privacy}.",
0 commit comments