-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathTRANSLATION
More file actions
38 lines (27 loc) · 1.14 KB
/
TRANSLATION
File metadata and controls
38 lines (27 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$ ls
extension.js locale metadata.json po prefs.js schemas stylesheet.css
$ xgettext --from-code=UTF-8 --output=po/example.pot *.js
$ mkdir ~/.local/share/gnome-shell/extensions/example@wiki.gnome.org/po/
$ mkdir ~/.local/share/gnome-shell/extensions/example@wiki.gnome.org/locale/
$ msginit --no-translator \
--input=po/example.pot \
--output-file=po/fr.po --locale=fr
$ ls po/
example.pot fr.po
$ mkdir -p locale/fr/LC_MESSAGES/
$ msgfmt po/fr.po -o locale/fr/LC_MESSAGES/example.mo
$ ls locale/fr/LC_MESSAGES/
example.mo
// If you're using GJS in a standalone application, you should do this yourself
String.prototype.format = imports.format.format;
// Two examples that both output: A string with a digit "5" and and string "test"
let num = 5;
let str = 'test';
// With String.prototype.format()
'A string with a digit "%d" and string "%s"'.format(num, str);
// With native template literals, doesn't work with xgettext
'A string with a digit "${num}" and string "${str}"';
******
See Scripts
bin/pot_create.sh - scan files and update pot file
bin/po_update.sh - update po files per language and generate binary locale .mo file