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
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,9 +98,9 @@ Most pictures are in SVG format. Strings inside it are usually just text, they c
98
98
99
99
That's great, as there are many strings in English in images, like tips, notes, etc. They look nice when translated.
100
100
101
-
Image translations reside in`images.yml`file in the repository root, for example: <https://github.com/javascript-tutorial/ru.javascript.info/blob/master/images.yml>. Please, create it if needed.
101
+
Image translations reside in`images.yml`in the repository root, for example: <https://github.com/javascript-tutorial/ru.javascript.info/blob/master/images.yml>. Please, create it if needed.
102
102
103
-
The file format is called "YAML", it's quite easy to understand:
103
+
The file format is "YAML", it's quite easy to understand:
104
104
105
105
```yaml
106
106
code-style.svg: # image file name
@@ -118,18 +118,19 @@ The translated string may become longer or shorter. By default, the translated s
118
118
119
119
Sometimes they need to be repositioned:
120
120
121
-
- `position: "center"` centers the translated string, good if you have a vertical diagram, keeps text centered:
122
-
```
123
-
|
124
-
hello world
125
-
你好世界
126
-
|
127
-
```
128
-
- `position: "right"` makes sure that the translated string keeps the same right edge:
129
-
```
130
-
hello world |
131
-
你好世界 |
132
-
```
121
+
`position: "center"` centers the translated string, good if you have a vertical diagram, keeps text centered:
122
+
```
123
+
|
124
+
hello world
125
+
你好世界
126
+
|
127
+
```
128
+
129
+
`position: "right"` makes sure that the translated string keeps the same right edge:
130
+
```
131
+
hello world |
132
+
你好世界 |
133
+
```
133
134
134
135
After `images.yaml` with translations is ready, it's time to apply translations:
135
136
@@ -162,11 +163,12 @@ P.S In order for positioning to work, you need to have ImageMagick installed: <h
162
163
## Extract strings
163
164
164
165
The task to get all strings from an image as YAML (for translation, to add to `images.yml`):
165
-
```
166
-
cd /js/server
167
-
NODE_LANG=zh npm run gulp engine:koa:tutorial:imageYaml --image hello.svg
168
-
```
169
-
166
+
167
+
```bash
168
+
cd /js/server
169
+
NODE_LANG=zh npm run gulp engine:koa:tutorial:imageYaml --image hello.svg
0 commit comments