diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-26 11:41:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-26 11:41:10 +0100 |
commit | c653ae3bfb11f663a52f55817e6d02a66d0852c8 (patch) | |
tree | d5a03a3e425180f1fafb646c8ec68a4b8458d0b3 /doc | |
parent | 1410dce2db310e71b5e683b0871c2f28d8807844 (diff) | |
parent | 27ceea2aeeed69b43fef4ebff35ec8004fcc2e45 (diff) | |
download | Shaarli-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')
-rw-r--r-- | doc/md/Translations.md | 32 |
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 | ||
10 | We encourage the community to contribute to Shaarli's translation either by improving existing | 10 | We encourage the community to contribute to Shaarli's translation either by improving existing |
11 | translations or submitting a new language. | 11 | translations or submitting a new language. |
12 | 12 | ||
13 | Contributing to the translation does not require development skill. | 13 | Contributing to the translation does not require development skill. |
14 | 14 | ||
@@ -21,8 +21,8 @@ First, install [Poedit](https://poedit.net/) tool. | |||
21 | 21 | ||
22 | Poedit will extract strings to translate from the PHP source code. | 22 | Poedit 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 |
25 | every translatable string. | 25 | every translatable string. |
26 | 26 | ||
27 | You can either use [this script](https://gist.github.com/ArthurHoaro/5d0323f758ab2401ef444a53f54e9a07) (recommended) | 27 | You can either use [this script](https://gist.github.com/ArthurHoaro/5d0323f758ab2401ef444a53f54e9a07) (recommended) |
28 | or visit every template page in your browser to generate cache files, while logged in. | 28 | or visit every template page in your browser to generate cache files, while logged in. |
@@ -41,7 +41,7 @@ http://<replace_domain>/?do=daily | |||
41 | http://<replace_domain>/?post | 41 | http://<replace_domain>/?post |
42 | http://<replace_domain>/?do=export | 42 | http://<replace_domain>/?do=export |
43 | http://<replace_domain>/?do=import | 43 | http://<replace_domain>/?do=import |
44 | http://<replace_domain>/?do=login | 44 | http://<replace_domain>/login |
45 | http://<replace_domain>/?do=picwall | 45 | http://<replace_domain>/?do=picwall |
46 | http://<replace_domain>/?do=pluginadmin | 46 | http://<replace_domain>/?do=pluginadmin |
47 | http://<replace_domain>/?do=tagcloud | 47 | http://<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 | ||
53 | In Poedit, click on "Edit a Translation", and from Shaarli's directory open | 53 | In 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 | ||
56 | The existing list of translatable strings should have been loaded, then click on the "Update" button. | 56 | The 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 | ||
66 | Open Poedit and select "Create New Translation", then from Shaarli's directory open | 66 | Open 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 | ||
69 | Then select the language you want to create. | 69 | Then select the language you want to create. |
70 | 70 | ||
71 | Click on `File > Save as...`, and save your file in `<shaarli directory>/inc/language/<new language>/LC_MESSAGES/shaarli.po`. | 71 | Click 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) |
73 | format in lowercase (e.g. `de` for German). | 73 | format in lowercase (e.g. `de` for German). |
74 | 74 | ||
75 | Then click on the "Update" button, and you can start to translate every available string. | 75 | Then click on the "Update" button, and you can start to translate every available string. |
76 | 76 | ||
77 | Save when you're done, then you can submit a pull request containing the new `shaarli.po`. | 77 | Save 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 | ||
81 | Theme translation extensions are loaded automatically if they're present. | 81 | Theme 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 | ||
88 | Where `<lang>` is the ISO 3166-1 alpha-2 language code. | 88 | Where `<lang>` is the ISO 3166-1 alpha-2 language code. |
89 | Read the following section "Extend Shaarli's translation" to learn how to generate those files. | 89 | Read 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: | |||
106 | Your `.po` files must be named like your domain. E.g. if your translation domain is `my_theme`, then your file will be | 106 | Your `.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 | ||
109 | Users have to register your extension in their configuration with the parameter | 109 | Users 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 | ||
112 | Example: | 112 | Example: |
@@ -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 | ``` |
160 | my_theme_t | 160 | my_theme_t |
161 | my_theme_t:1,2 | 161 | my_theme_t:1,2 |