2023-04-29 14:15:05 +00:00
At `Edit` -> `Dictioanries` -> `Groups` , you can create and edit dictionary groups.
2023-04-22 00:43:50 +00:00
2023-04-29 14:15:05 +00:00
To add a dictionary into a group, just drag it from the dictionary list into the group window on the right. To remove a dict, just drag it back to the dictionary list. Hold `Shift` to select a range of dictionaries or hold `Ctrl` to select multiple dictionaries.
2023-04-29 06:59:19 +00:00
2023-04-29 14:15:05 +00:00
Additionally, multiple strategies of automatic grouping are provided:
2023-04-29 06:59:19 +00:00
2023-04-29 14:15:05 +00:00
* based on the language info embedded within dictionary files
* based on the folder structure
* based on customizable metadata files
## Auto groups by dictionary language
2024-06-19 01:21:05 +00:00
For formats like DSL, which has embedded language from / to metadata, GoldenDict will use the dictionary's built-in metadata.
2023-04-29 14:15:05 +00:00
2024-06-19 01:21:05 +00:00
For other formats, GoldenDict will try to extract languages from the dictionary's name or its file name by finding `{id}-{id}` pair. The `{id}` is 2 or 3 letters ISO 639 codes. For example, if a dictionary named `some name en-zh` , it will be automatically grouped into `en-zh` .
2023-04-29 06:59:19 +00:00
2024-06-19 01:21:05 +00:00
Groups created in this method also include a context menu when right-click the group name, in which you can do additional dictionaries grouping by source or target language and combine dictionaries in more large groups.
2023-04-29 06:59:19 +00:00
2023-04-22 00:43:50 +00:00
## Auto groups by folders
2023-04-29 14:15:05 +00:00
Click the "Group by folders" will group your dicts based on folder structure.
2023-04-22 00:43:50 +00:00
2023-04-29 14:15:05 +00:00
Two dictionaries will be in the same group if their container folder's direct parent is the same.
2023-04-22 00:43:50 +00:00
![Auto Group By Folder ](img/autoGroupByFolder.svg )
For example, the structure below will be auto grouped into two groups:
* `English<>Chinese` with `Cambridge` , `Collins` and `Oxford`
* `English<>Russian` with `dictA` , `dictB` , `Wikipedia_ru` and `Wikipedia`
```
.
├── English< >Chinese
│ ├── Cambridge
│ │ ├── Cambridge.dict.dz
│ │ ├── Cambridge.idx
│ │ ├── Cambridge.info
│ │ └── Cambridge.syn
│ ├── Collins
│ │ ├── Collins.dsl
│ │ └── res.zip
│ └── Oxford
│ ├── Oxford.css
│ ├── Oxford.mdd
│ └── Oxford.mdx
└── English< >Russian
├── dsl
│ ├── dictA.dsl
│ └── dictB.dsl
└── zim
├── Wikipedia_ru.slob
└── Wikipedia.zim
2023-04-26 07:37:46 +00:00
```
Note that if two groups share the same name but in different folder, then upper level's folder name will be prepended with group name. The Example below will be grouped into `epistularum/Japanese` and `Mastameta/Japanese` .
More levels of folder nesting are not supported.
```
.
├─epistularum
│ └─Japanese < - Group
│ └─DictA < - Dict Files ' s container folder
| └─ DictA Files
├─Mastameta
│ └─Japanese < - Group
| └─DictB < - Dict Files ' s container folder
| └─ DictB Files
2023-04-29 06:59:19 +00:00
```
2023-04-29 14:15:05 +00:00
## Auto groups by `metadata.toml`
2023-04-29 06:59:19 +00:00
2023-04-29 14:15:05 +00:00
Click the "group by metadata" will group your dicts based on `metadata.toml` .
2023-04-29 06:59:19 +00:00
2023-04-29 14:15:05 +00:00
The `metadata.toml` should be placed beside dictionary files. One `metadata.toml` for each dictionary.
2023-04-29 06:59:19 +00:00
2023-04-29 14:15:05 +00:00
The metadata file uses [TOML ](https://toml.io ) format.
```toml
2023-04-30 04:31:49 +00:00
categories = [ "English", "Russian", "Chinese" ]
2023-04-29 06:59:19 +00:00
2023-07-23 06:18:49 +00:00
# the following `langfrom` , `langto` fields have not been supported yet.
2023-04-29 06:59:19 +00:00
[metadata]
name = "New Name"
langfrom = "English"
langto = "Russian"
```
2023-04-29 14:15:05 +00:00
For example,
2023-04-29 06:59:19 +00:00
```
.
2023-04-29 14:15:05 +00:00
├── Cambridge
│ ├── metadata.toml (A)
│ ├── Cambridge.idx
│ ├── Cambridge.info
│ ├── Cambridge.syn
│ └── Cambridge.dict.dz
└── Collins
├── metadata.toml
├── res.zip
└── Collins.dsl (B)
2023-04-29 06:59:19 +00:00
```
2023-04-29 14:15:05 +00:00
The content of the metadata `(A)` is
```toml
2023-04-30 04:31:49 +00:00
categories = ["en-zh", "汉英词典"]
2023-04-29 06:59:19 +00:00
```
2023-04-29 14:15:05 +00:00
The content of the metadata `(B)` is
```toml
2023-04-30 04:31:49 +00:00
categories = ["图片词典", "en-zh", "汉英词典"]
2023-04-29 06:59:19 +00:00
```
2023-04-29 14:15:05 +00:00
The structure above will be auto grouped into three groups:
2023-04-29 06:59:19 +00:00
2023-04-29 14:15:05 +00:00
* `en-zh` with `Cambridge` , `Collins`
* `图片词典` with `Collins`
* `汉英词典` with `Cambridge` ,`Collins`
2023-04-29 06:59:19 +00:00
2023-07-23 06:18:49 +00:00
Note: Dictionaries without `metadata.toml` won't be auto-grouped.