https://github.com/ashampoo/ashampoo-translation-systems
Open source repository for the formats used by the new translation studio.
https://github.com/ashampoo/ashampoo-translation-systems
Last synced: about 1 year ago
JSON representation
Open source repository for the formats used by the new translation studio.
- Host: GitHub
- URL: https://github.com/ashampoo/ashampoo-translation-systems
- Owner: Ashampoo
- License: mit
- Created: 2022-08-23T13:30:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T11:22:42.000Z (over 1 year ago)
- Last Synced: 2025-04-14T11:18:09.122Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 1.12 MB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://github.com/Ashampoo/Ashampoo-Translation-Systems/actions/workflows/build-and-test.yml)
[](https://github.com/Ashampoo/Ashampoo-Translation-Systems/blob/main/LICENSE)
[](https://github.com/Ashampoo/Ashampoo-Translation-Systems/releases/latest)
[](https://www.nuget.org/packages/Ashampoo.Translation.Systems.Formats)
[](https://www.nuget.org/packages/Ashampoo.Translation.Systems.Formats.Abstractions)
# Ashampoo-Translation-Systems
## Description
This repository contains the source code for a system for working with translation files.
## Installation
To use the system, you need to install the following dependencies from NuGet:
[Ashampoo.Translation.Systems.Formats.Abstractions](https://www.nuget.org/packages/Ashampoo.Translation.Systems/) if you only want to use the interfaces and base classes, and not the format implementations.\
[Ashampoo.Translation.Systems.Formats](https://www.nuget.org/packages/Ashampoo.Translation.Systems.Formats/) if you want to use the complete system, including the format implementations.\
If you only want to use specific formats, you can install the corresponding packages directly.\
\
To register all your installed formats with the `IServiceCollection`, you need to call the following methods:
```c#
using Ashampoo.Translation.Systems.Formats.Abstractions;
services.RegisterFormats();
```
If you want to register only specific formats, you can register them manually with your `IServiceCollection`:
```c#
using Ashampoo.Translation.Systems.Formats.MyFormat;
services.AddFormatFactory();
services.RegisterFormat();
```
> NOTE: If you want to register multiple formats individually, you only need to call `services.AddFormatFactory()` once.
## Supported Formats
### AshLang
AshLang is a file format for storing translations with their english original text.\
An AshLang file is a binary file.\
We recommend not to use this format for storing translations, because it is an internal format of Ashampoo,\
and is not human-readable.
### Gengo
The Gengo format is a simple format for storing translations.\
It is meant to be used for sending it to [Gengo](https://gengo.com/) for translating.\
Gengo is based on Excel (.xlsx) and has a specific structure:
| [[[ ID ]]] | source | target |
|:-----------------:|:-------------:|:-------------:|
| [[[ first id ]]] | first source | first target |
| [[[ second id ]]] | second source | second target |
| [[[ third id ]]] | third source | third target |
As you can see, the ids are always in the first column and the source and target are in the second and third columns.
Also, the ids are inside of 3 square brackets.\
This is because Gengo doesn't translates strings that are in three square brackets.
### Json
The Json format is a simple format for storing translations.\
It is a JSON file with the following structure:
```json
{
"first id": "first target",
"second id": "second target",
"third id": "third target"
}
```
Json also supports nested objects:
```json
{
"first id": "first target",
"second id": "second target",
"third id": {
"first nested id": "first nested target",
"second nested id": "second nested target",
"third nested id": "third nested target"
}
}
```
The id for translations in nested objects is constructed by concatenating the ids of the parent objects with a `/` .\
For example, the id for the first nested id is `third id/first nested id`.
Additionally, arrays are supported:
```json
{
"first id": [
"first target",
"second target",
"third target"
]
}
```
The id for translations in arrays is constructed by concatenating the id of the parent object with a `/` and the index of the array.\
For example, the id for the first target is `first id/0`.
### NLang
NLang is a simple key-value format.
```
firstId=firstTarget
secondId=secondTarget
thirdId=thirdTarget
```
### PO
The [PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) format is a simple format for storing translations.\
It is a text file with the following structure:
```po
msgid "first source"
msgstr "first target"
msgid "second source"
msgstr "second target"
msgid "third source"
msgstr "third target"
```
Po files can also contain comments, and context.\
Both can be used to store additional information about the translation.\
At the moment, context and comments in files are accepted as inputs, but are not properly handled.\
If a translation has a context, the id of the translation is constructed by concatenating the context with a `/` and the id.\
For the full documentation of the PO format, see the [GNU gettext manual](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html).
### Resx
The Resx format is a simple format for storing translations.\
It is a XML file with the following structure:
```xml
first target
second target
third target
```
For more information about the Resx format, see the [Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/framework/resources/creating-resource-files-for-desktop-apps#resx-files).
### TsProj
TsProj is a file format for storing translation strings in a .tsproj file.\
It is a xml based format, intended to use with the Ashampoo Translation Studio,
with the following structure:
```xml
first comment
first source
first target
second comment
second source
second target
third comment
third source
third target
```
## License
This project is licensed under the MIT license.
## Contributing
Contributions are always welcome!\
Please read the [contribution guidelines](CONTRIBUTING.md) first.
## Code of Conduct
This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md).