Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • guillaume.premel/translation_helper
1 result
Show changes
Commits on Source (2)
......@@ -5,48 +5,54 @@ Utility script aimed at easing translators' work
## How to use
<code>./translation_helper.py file1 file2</code>
```bash
./translation_helper.py file1 file2
```
The script will read <code>file1</code>'s structure and try to find a match in
</code>file2</code>. If there is not such match, it will prompt the user to give
The script will read `file1`'s structure and try to find a match in
`file2`. If there is not such match, it will prompt the user to give
a translation.
For instance, if <code>file1</code>'s structure is:
For instance, if `file1`'s structure is:
<code>"components": {
"greetings": {
"morning": "Good morning !",
"afternon": "Good afternoon !"
}
}</code>
```JSON
"components": {
"greetings": {
"morning": "Good morning !",
"afternon": "Good afternoon !"
}
}
```
And <code>file2</code>'s structure is
And `file2`'s structure is
<code>"components": {
"greetings": {
"morning": "Bonjour !",
}
}</code>
```JSON
"components": {
"greetings": {
"morning": "Bonjour !",
}
}
````
By running <code>./translation_helper.py file1 file2</code>, the user will see:
By running `./translation_helper.py file1 file2`, the user will see:
<code>[components.greetings] afternoon
```
[components.greetings] afternoon
Good afternoon !
</code>
```
By typing <code>Bonne après-midi !</code>, file2's structure will be altered and
By typing `Bonne après-midi !`, `file2`'s structure will be altered and
written to disk to become
<code>"components": {
"greetings": {
"morning": "Bonjour !",
"afternoon": "Bonne après-midi !"
}
}</code>
```JSON
"components": {
"greetings": {
"morning": "Bonjour !",
"afternoon": "Bonne après-midi !"
}
}
```
## Use cases
......