|
1 | | -# php_Translation_Helper |
2 | | -Excel workbook to assist creating translations form existing php languages files or create one from scratch if the project supports such files |
| 1 | + Use the table of contents |
| 2 | + |
| 3 | +[](https://github.com/JustFxDev/ThemeMaestro/releases) [](https://github.com/JustFxDev/ThemeMaestro/graphs/contributors) |
| 4 | + |
| 5 | +**:star: If you use it, you should star it on GitHub!** *It's the least you can do for all the work put into it!* |
| 6 | + |
| 7 | +:de: [Deutsche Fassung dieses Textes](./README_de.md) |
| 8 | + |
| 9 | +PHP Translation Helper (for Kanboard and other projects) |
| 10 | +============================= |
| 11 | + |
| 12 | +Welcome to the PHP Translation Helper workbook for the translation of PHP projects that work with translation files. |
| 13 | + |
| 14 | +Using the Kanboard project as an example, it describes how to create a translation file in no time, e.g. for Kanboard PlugIns. |
| 15 | + |
| 16 | +This Excel workbook supports two approaches. |
| 17 | + |
| 18 | +1. there is a *translations.php* available and one would like to create a new one for another language. |
| 19 | +2. you want to create a *translations.php* from scratch. |
| 20 | + |
| 21 | +This documentation describes both approaches. |
| 22 | + |
| 23 | +# Translation based on an existing file |
| 24 | + |
| 25 | +In addition to the Excel workbook, the file with the source language is required also. This file content must be copied into the table in the left column (1) as pure text. Usually you will already find a `translations.php` in the corresponding folder. e.g.: |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +The sample file contains only the English language and looks like this: |
| 30 | + |
| 31 | +This sample file is located here: [sample file](./example_translations.php) |
| 32 | + |
| 33 | +After opening the Excel workbook, please select the *Fileconverter* sheet first: |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +The output table for the translation looks (still) like this: |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +**Column 1** |
| 42 | + |
| 43 | +Here are the lines from *translations.php* that we want to translate. |
| 44 | + |
| 45 | +**Column 2** |
| 46 | + |
| 47 | +Contains formulas, do not enter anything there! |
| 48 | + |
| 49 | +**Column 3** |
| 50 | + |
| 51 | +Contains the translations after you copied them here (s. below) |
| 52 | + |
| 53 | +**Column 4** (colored yellow) |
| 54 | + |
| 55 | +Contains (later) the source code for the new *translations.php* file. Do not make any entries there! |
| 56 | + |
| 57 | +#### 1. Copy the text lines from translations.php to column 1. |
| 58 | + |
| 59 | +When copying, make sure that only blank text is copied. Excessive tabs or spaces do not matter. |
| 60 | + |
| 61 | +Important: Column 1 must not contain any blank lines, comments or other lines. Only the text to be translated in single quotation marks. Preferably in plain text format. In principle, however, a simple copy and paste should work. |
| 62 | + |
| 63 | +For example, if we pasted the text from Visual Studio Code, it looks like this: |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +In column 1 is the copied text, in column 2 automatically the extracted text to be translated. In column 4 (yellow) we can already see the finished code, but still without translated text. |
| 68 | + |
| 69 | +#### 2. Translating the text with the help of deepl.com |
| 70 | + |
| 71 | +Now the whole(!) text is copied from **column 2** |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +and will be pasted on [deepl.com](https://deepl.com) into the left box |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +If the language is not recognized correctly, then this can be selected manually above the left box. |
| 80 | + |
| 81 | +Directly after pasting on the **left side** the translation appears on the right side. This result is now selected and copied: |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +into our table in **column 3**. |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +#### 3 . Revise the result of deepl.com and create the file |
| 90 | + |
| 91 | +The result in **column 3** should now be checked again carefully for content. Are the translations linguistically ok? Changes can be made directly in the cells of column 3 without any problems. |
| 92 | + |
| 93 | +The result script in **column 4** will be adjusted dynamically. |
| 94 | + |
| 95 | +If you are satisfied with the translation, open your favorite text editor (or Notepad) and copy the **column 4** from `?php` inclusive to `);`also inclusive. |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +The result is then saved in the corresponding folder of the project. Example Kanboard for the German translation: |
| 100 | + |
| 101 | +`.\locale\de_DE\translations.php` |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +That's it. |
| 108 | +# Create translation without source file |
| 109 | + |
| 110 | +To do this, please select the table *"From Scratch "*. **There the column 1 is omitted. ** |
| 111 | + |
| 112 | + |
| 113 | +Instead of copying source data from a possibly existing *translations.php*, one enters all texts on the left side (2) oneself and lets these translate then again on https://deepl.com and copies the result into (3), revises this and copies then from (4) the text into an editor of its choice and stores this text then at the correct place. |
| 114 | + |
| 115 | +So in principle it works exactly the same as if you have a file (s. above). |
| 116 | + |
| 117 | +### Contributors |
| 118 | + |
| 119 | +- Fx - Author |
| 120 | + |
| 121 | +- Contributors to this project a very welcome! |
| 122 | + |
| 123 | + |
| 124 | + |
0 commit comments