aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/md/Translations.md
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-01-26 11:41:10 +0100
committerGitHub <noreply@github.com>2020-01-26 11:41:10 +0100
commitc653ae3bfb11f663a52f55817e6d02a66d0852c8 (patch)
treed5a03a3e425180f1fafb646c8ec68a4b8458d0b3 /doc/md/Translations.md
parent1410dce2db310e71b5e683b0871c2f28d8807844 (diff)
parent27ceea2aeeed69b43fef4ebff35ec8004fcc2e45 (diff)
downloadShaarli-c653ae3bfb11f663a52f55817e6d02a66d0852c8.tar.gz
Shaarli-c653ae3bfb11f663a52f55817e6d02a66d0852c8.tar.zst
Shaarli-c653ae3bfb11f663a52f55817e6d02a66d0852c8.zip
Render login page through Slim controller (#1401)
Render login page through Slim controller
Diffstat (limited to 'doc/md/Translations.md')
-rw-r--r--doc/md/Translations.md32
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/md/Translations.md b/doc/md/Translations.md
index c7d33855..58b92da3 100644
--- a/doc/md/Translations.md
+++ b/doc/md/Translations.md
@@ -7,8 +7,8 @@ Note that only the `default` theme supports translations.
7 7
8### Contributing 8### Contributing
9 9
10We encourage the community to contribute to Shaarli's translation either by improving existing 10We encourage the community to contribute to Shaarli's translation either by improving existing
11translations or submitting a new language. 11translations or submitting a new language.
12 12
13Contributing to the translation does not require development skill. 13Contributing to the translation does not require development skill.
14 14
@@ -21,8 +21,8 @@ First, install [Poedit](https://poedit.net/) tool.
21 21
22Poedit will extract strings to translate from the PHP source code. 22Poedit will extract strings to translate from the PHP source code.
23 23
24**Important**: due to the usage of a template engine, it's important to generate PHP cache files to extract 24**Important**: due to the usage of a template engine, it's important to generate PHP cache files to extract
25every translatable string. 25every translatable string.
26 26
27You can either use [this script](https://gist.github.com/ArthurHoaro/5d0323f758ab2401ef444a53f54e9a07) (recommended) 27You can either use [this script](https://gist.github.com/ArthurHoaro/5d0323f758ab2401ef444a53f54e9a07) (recommended)
28or visit every template page in your browser to generate cache files, while logged in. 28or visit every template page in your browser to generate cache files, while logged in.
@@ -41,7 +41,7 @@ http://<replace_domain>/?do=daily
41http://<replace_domain>/?post 41http://<replace_domain>/?post
42http://<replace_domain>/?do=export 42http://<replace_domain>/?do=export
43http://<replace_domain>/?do=import 43http://<replace_domain>/?do=import
44http://<replace_domain>/?do=login 44http://<replace_domain>/login
45http://<replace_domain>/?do=picwall 45http://<replace_domain>/?do=picwall
46http://<replace_domain>/?do=pluginadmin 46http://<replace_domain>/?do=pluginadmin
47http://<replace_domain>/?do=tagcloud 47http://<replace_domain>/?do=tagcloud
@@ -50,8 +50,8 @@ http://<replace_domain>/?do=taglist
50 50
51#### Improve existing translation 51#### Improve existing translation
52 52
53In Poedit, click on "Edit a Translation", and from Shaarli's directory open 53In Poedit, click on "Edit a Translation", and from Shaarli's directory open
54`inc/languages/<lang>/LC_MESSAGES/shaarli.po`. 54`inc/languages/<lang>/LC_MESSAGES/shaarli.po`.
55 55
56The existing list of translatable strings should have been loaded, then click on the "Update" button. 56The existing list of translatable strings should have been loaded, then click on the "Update" button.
57 57
@@ -63,20 +63,20 @@ Save when you're done, then you can submit a pull request containing the updated
63 63
64#### Add a new language 64#### Add a new language
65 65
66Open Poedit and select "Create New Translation", then from Shaarli's directory open 66Open Poedit and select "Create New Translation", then from Shaarli's directory open
67`inc/languages/<lang>/LC_MESSAGES/shaarli.po`. 67`inc/languages/<lang>/LC_MESSAGES/shaarli.po`.
68 68
69Then select the language you want to create. 69Then select the language you want to create.
70 70
71Click on `File > Save as...`, and save your file in `<shaarli directory>/inc/language/<new language>/LC_MESSAGES/shaarli.po`. 71Click on `File > Save as...`, and save your file in `<shaarli directory>/inc/language/<new language>/LC_MESSAGES/shaarli.po`.
72`<new language>` here should be the language code respecting the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) 72`<new language>` here should be the language code respecting the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2)
73format in lowercase (e.g. `de` for German). 73format in lowercase (e.g. `de` for German).
74 74
75Then click on the "Update" button, and you can start to translate every available string. 75Then click on the "Update" button, and you can start to translate every available string.
76 76
77Save when you're done, then you can submit a pull request containing the new `shaarli.po`. 77Save when you're done, then you can submit a pull request containing the new `shaarli.po`.
78 78
79### Theme translations 79### Theme translations
80 80
81Theme translation extensions are loaded automatically if they're present. 81Theme translation extensions are loaded automatically if they're present.
82 82
@@ -85,7 +85,7 @@ As a theme developer, all you have to do is to add the `.po` and `.mo` compiled
85 tpl/<theme name>/language/<lang>/LC_MESSAGES/<theme name>.po 85 tpl/<theme name>/language/<lang>/LC_MESSAGES/<theme name>.po
86 tpl/<theme name>/language/<lang>/LC_MESSAGES/<theme name>.mo 86 tpl/<theme name>/language/<lang>/LC_MESSAGES/<theme name>.mo
87 87
88Where `<lang>` is the ISO 3166-1 alpha-2 language code. 88Where `<lang>` is the ISO 3166-1 alpha-2 language code.
89Read the following section "Extend Shaarli's translation" to learn how to generate those files. 89Read the following section "Extend Shaarli's translation" to learn how to generate those files.
90 90
91### Extend Shaarli's translation 91### Extend Shaarli's translation
@@ -106,7 +106,7 @@ First, create your translation files tree directory:
106Your `.po` files must be named like your domain. E.g. if your translation domain is `my_theme`, then your file will be 106Your `.po` files must be named like your domain. E.g. if your translation domain is `my_theme`, then your file will be
107`my_theme.po`. 107`my_theme.po`.
108 108
109Users have to register your extension in their configuration with the parameter 109Users have to register your extension in their configuration with the parameter
110`translation.extensions.<domain>: <translation files path>`. 110`translation.extensions.<domain>: <translation files path>`.
111 111
112Example: 112Example:
@@ -151,11 +151,11 @@ When you're done, open Poedit and load translation strings from sources:
151 1. `File > New` 151 1. `File > New`
152 2. Choose your language 152 2. Choose your language
153 3. Save your `PO` file in `<your_module>/languages/<language code>/LC_MESSAGES/my_theme.po`. 153 3. Save your `PO` file in `<your_module>/languages/<language code>/LC_MESSAGES/my_theme.po`.
154 4. Go to `Catalog > Properties...` 154 4. Go to `Catalog > Properties...`
155 5. Fill the `Translation Properties` tab 155 5. Fill the `Translation Properties` tab
156 6. Add your source path in the `Sources Paths` tab 156 6. Add your source path in the `Sources Paths` tab
157 7. In the `Sources Keywords` tab uncheck "Also use default keywords" and add the following lines: 157 7. In the `Sources Keywords` tab uncheck "Also use default keywords" and add the following lines:
158 158
159``` 159```
160my_theme_t 160my_theme_t
161my_theme_t:1,2 161my_theme_t:1,2