Skip to content

Commit 2669b5d

Browse files
authored
First release after a complete rework
1 parent 4887226 commit 2669b5d

22 files changed

+282
-2
lines changed

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## v0.1.0
2+
3+
_(most recent changes are listed on top):_
4+
- First initial release after complete rework
5+

README.md

Lines changed: 124 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,124 @@
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+
![north_west](./assets/north_west.svg) Use the table of contents
2+
3+
[![version](./assets/version.svg)](https://github.com/JustFxDev/ThemeMaestro/releases) [![license](./assets/maintained.svg)](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+
![](./assets/locale_dir.png)
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+
![](./assets/have_file_avail.png)
36+
37+
The output table for the translation looks (still) like this:
38+
39+
![](./assets/columns.png)
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+
![](./assets/inserted_text.png)
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+
![](./assets/copy_text_to_translate.png)
74+
75+
and will be pasted on [deepl.com](https://deepl.com) into the left box
76+
77+
![](./assets/deepl_left_side.png)
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+
![](./assets/deepl_translation_right.png)
84+
85+
into our table in **column 3**.
86+
87+
![](./assets/deepl_in_excel.png)
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+
![](./assets/copy_script.png)
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+
![](./assets/script_result.png)
104+
105+
![](./assets/new_translations_file.png)
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+
![](./assets/from_scratch.png)
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+

README_de.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
![north_west](./assets/north_west.svg) Use the table of contents
2+
3+
[![version](./assets/version.svg)](https://github.com/JustFxDev/ThemeMaestro/releases) [![license](./assets/maintained.svg)](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+
8+
PHP Translation Helper (für Kanboard und andere Projekte)
9+
=============================
10+
11+
Willkommen zur PHP Translation Helper Mappe für die Übersetzung von PHP Projekten die mit Übersetzungsfiles arbeiten.
12+
13+
Am Beispiel des Kanboard Projekts wird beschrieben, wie man im Handumdrehen eine Übersetzungsdatei z. B. für Kanboard PlugIns erstellt.
14+
15+
Die Excel Mappe unterstützt zwei Herangehensweisen.
16+
17+
1. Es liegt breites eine *translations.php* vor und man möchte eine für eine andere Sprache erstellen
18+
2. Es soll eine *translations.php* von Grund auf neu erstellt werden
19+
20+
Diese Dokumentation beschreibt beide Vorgehensweisen.
21+
22+
# Übersetzung auf Basis einer vorhandenen Datei
23+
24+
Neben der Excel Mappe wird zunächst die Datei mit der Ausgangssprache benötigt. Diese muss in die Tabelle in der linken Spalte (1) als purer Text einkopiert werden. In der Regel findet man bereits eine `translations.php` im entsprechenden Ordner. z. B.:
25+
26+
![](./assets/locale_dir.png)
27+
28+
Die Beispieldatei enthält nur die englische Sprache und sieht wie folgt aus:
29+
30+
![](./assets/main_translation_file.png)
31+
32+
Diese Beispieldatei befindet sich hier: [Beispieldatei](./example_translations.php)
33+
34+
Nach dem Öffnen der Excel Mappe bitte zunächst die Tabelle *Fileconverter* auswählen:
35+
36+
![](./assets/have_file_avail.png)
37+
38+
Die Ausgangstabelle für die Übersetzung sieht (noch) so aus:
39+
40+
![](./assets/columns.png)**Spalte 1**
41+
42+
Hier kommen die Zeilen aus der *translations.php* hinein, die wir übersetzen wollen
43+
44+
**Spalte 2**
45+
46+
Enthält Formeln, dort keine Eingaben vornehmen!
47+
48+
**Spalte 3**
49+
50+
Nimmer später die Übersetzungen auf
51+
52+
**Spalte 4** (gelb eingefärbt)
53+
54+
Enthält (später) den Quellcode für die neue *translations.php* Datei. Dort keine Eingaben vornehmen!
55+
56+
#### 1. Kopieren der Textzeilen aus der translations.php in Spalte 1
57+
58+
Beim Kopieren darauf achten, dass nur blanker Text kopiert wird. Überzählige Tabs oder Leerzeichen spielen keine Rolle.
59+
60+
Wichtig: Spalte 1 darf keine Leerzeilen, Kommentare oder sonstigen Zeilen enthalten. Nur den zu übersetzenden Text in einfachen Hochkommata. Am besten blanken Text. Grundsätzlich sollte aber auch ein einfaches kopieren und einfügen gehen.
61+
62+
Wenn wir z. B. aus Visual Studio Code den Text eingefügt haben sieht das wie folgt aus:
63+
64+
![](./assets/inserted_text.png)
65+
66+
In Spalte 1 ist der einkopierte Text, in Spalte 2 automatisch der Extrahierte Text, der übersetzt werden soll. In Spalte 4 (gelb) sehen wir bereits den fertigen Code, allerdings noch ohne übersetzten Text.
67+
68+
#### 2. Übersetzen des Textes mit Hilfe von deepl.com
69+
70+
Nun wird der gesamte(!) Text aus Spalte 2 kopiert
71+
72+
![](./assets/copy_text_to_translate.png)
73+
74+
und bei [deepl.com](https://deepl.com) in der linken Box eingefügt
75+
76+
![](./assets/deepl_left_side.png)
77+
78+
Wenn die Sprache nicht richtig erkannt wird, dann kann dies über der linken Box oben manuell ausgewählt werden.
79+
80+
Direkt nach dem Einfügen auf der **linken Seite** erscheint die Übersetzung auf der rechten Seite. Dieses Ergebnis wird nun ausgewählt und kopiert:
81+
82+
![](./assets/deepl_translation_right.png)
83+
84+
und dann in unsere Tabelle in **Spalte 3** einkopiert.
85+
86+
![](./assets/deepl_in_excel.png)
87+
88+
#### 3 . Das Ergebnis von deepl.com überarbeiten und die Datei erstellen
89+
90+
Das Ergebnis in **Spalte 3** sollte jetzt noch mal inhaltlich genau geprüft werden. Sind die Übersetzungen sprachlich in Ordnung? Änderungen können in den Zellen der Spalte 3 ohne Probleme direkt vorgenommen werden.
91+
92+
Das Ergebnis-Script in **Spalte 4** wird dynamisch angepasst.
93+
94+
Ist man mit der Übersetzung zufrieden, dann öffnet man seinen Lieblings Texteditor (oder halt Notepad) und kopiert die **Spalte 4** von `?php`(inklusive) bis zum `);`ebenfalls inklusive.
95+
96+
![](./assets/copy_script.png)
97+
98+
Das Ergebnis speichert man dann im entsprechenden Ordner des Projekts. Beispiel Kanboard für die deutsche Übersetzung:
99+
100+
`.\locale\de_DE\translations.php`
101+
102+
![](./assets/script_result.png)
103+
104+
![](./assets/new_translations_file.png)
105+
106+
Das wars.
107+
# Übersetzung erstellen ohne Quelldatei
108+
109+
Dazu bitte die Tabelle *"From Scratch"* auswählen. **Dort entfällt die Spalte 1**.
110+
111+
![](./assets/from_scratch.png)
112+
113+
Statt des Einkopierens von Quelldaten aus einer evtl. vorhandenen *translations.php*, gibt man alle Texte auf der linken Seite (2) selber ein und lässt diese dann wieder auf https://deepl.com übersetzen und kopiert sich dann den Ergebnis Code wieder in (3) hinein, überarbeitet diesen und kopiert dann aus (4) den Text in einen Editor seiner Wahl und speichert diesen Text dann an der richtigen Stelle ab.
114+
115+
Es funktioniert also im Prinzip ganz genau so wie wenn man eine Datei hat.
116+
117+
### Mitwirkende
118+
119+
- Fx - Author
120+
121+
- Unterstützung in diesem Projekt ist willkommen!
122+
123+
124+

assets/columns.png

12.9 KB
Loading

assets/copy_script.png

89.3 KB
Loading

assets/copy_text_to_translate.png

65.2 KB
Loading

assets/deepl_in_excel.png

70 KB
Loading

assets/deepl_left_side.png

53 KB
Loading

assets/deepl_translation_right.png

15.7 KB
Loading

assets/empty_table.png

6.95 KB
Loading

0 commit comments

Comments
 (0)