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
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ This plug-in will help you to choose and add the gitmoji, via a button in the Co
16
16
* Load the list of gitmoji on startup from the repos of gitmoji (fallback to a local list if error).
17
17
* Allow to display the gitmoji in a new column in the commit history
18
18
* Translate the gitmoji description in your chinese and french language.
19
+
* Custom gitmoji list from url or predefined default [Gitmojis](https://gitmoji.dev/) or [Conventional Gitmojis](https://conventional-gitmoji.web.app/)
19
20
20
21
See the [gitmoji website](https://gitmoji.dev/) for have the list of Emoji and their signification.
This document explains how to customize which Gitmojis the plugin shows, where the plugin looks for the default data, how to provide your own JSON source, and how localization works.
4
+
5
+
## Configuring a custom Gitmoji source
6
+
1. Open the plugin settings (Settings / Preferences → GitMoji).
7
+
2. Set source type to "Custom".
8
+
3. Enter the JSON URL for your custom gitmoji list in the JSON URL field.
9
+
4. Enter a localization URL template in the Localization URL field. Use `{locale}` as a placeholder that will be replaced with the selected locale (see below).
10
+
11
+
The plugin expects a JSON object with a `gitmojis` array. Each element must contain `emoji`, `code`, `description`, and `name` fields. Example:
12
+
13
+
```json
14
+
{
15
+
"gitmojis": [
16
+
{
17
+
"emoji": "😄",
18
+
"code": ":smile:",
19
+
"description": "A happy smile",
20
+
"name": "smile"
21
+
},
22
+
{
23
+
"emoji": "✨",
24
+
"code": ":sparkles:",
25
+
"description": "Add new features",
26
+
"name": "sparkles"
27
+
}
28
+
]
29
+
}
30
+
```
31
+
32
+
If the HTTP request fails or returns an invalid response, the plugin will silently fall back to the bundled `gitmojis.json` file.
33
+
34
+
### Localization
35
+
- Localized translations are provided as YAML files mapping gitmoji `name` → localized description.
36
+
- Provide YAML translations keyed by `name` (not `code`). The plugin looks up translations by the `name` field from the JSON.
37
+
- If the field is left empty, description from the JSON source is used.
38
+
- The plugin uses a localization URL template that can be included with the `{locale}` token. Example:
39
+
40
+
```
41
+
https://mydomain.com/gitmojis-{locale}.yaml
42
+
```
43
+
44
+
- When the plugin loads translations it will replace `{locale}` with the selected language code and try to download that YAML file. Example replacements:
45
+
-`en_US` → https://.../gitmojis-en_US.yaml
46
+
-`fr_FR` → https://.../gitmojis-fr_FR.yaml
47
+
-`zh_CN` → https://.../gitmojis-zh_CN.yaml
48
+
49
+
- Supported config language values:
50
+
-`auto` (use system locale if supported, otherwise falls back to `en_US`)
51
+
-`en_US`, `zh_CN`, `fr_FR`, `ru_RU`, `pt_BR`
52
+
53
+
YAML structure example:
54
+
55
+
```yaml
56
+
gitmojis:
57
+
smile: "Sourire"
58
+
sparkles: "Ajouter de nouvelles fonctionnalités"
59
+
```
60
+
61
+
The plugin will try to download remote YAML translations. If the network fetch or parsing fails, it falls back to bundled local YAML resources named `gitmojis-<locale>.yaml` that is shipped with the plugin or description from the json directly.
62
+
63
+
## Default data
64
+
- The plugin ships a bundled default file at [gitmojis.json](./src/main/resources/gitmojis.json). If an HTTP fetch of the configured JSON URL fails, the plugin falls back to this embedded file.
65
+
- Default localization example file can be found at [gitmojis.yaml](./src/main/resources/gitmojis.yaml).
66
+
- The default remote URL used by the plugin for Gitmoji source is https://gitmoji.dev/api/gitmojis
67
+
- There is also a built-in [Conventional Gitmoji](https://conventional-gitmoji.web.app/) option, which is reduced set of Gitmojis matching the [conventional commit](https://www.conventionalcommits.org) specification.
68
+
69
+
70
+
## Practical example — host custom JSON and YAML on GitHub
71
+
1. Create a repository containing `gitmojis.json` in the root and localization files named `gitmojis-fr_FR.yaml`, `gitmojis-zh_CN.yaml`, etc.
72
+
2. Use GitHub raw URLs for the two fields in the plugin settings. Example:
0 commit comments