Translate PDF4Teachers with Weblate


PDF4Teachers app and website can be translated with Weblate. Weblate is a collaborative translate platform. Clic on above button to access.

Weblate

You may contribute to an existing translation or start a new one. New edits will automatically be saved on PDF4Teachers GitHub and/or website.


Some translations include parameters, coded with {0}, {1}, {2}, etc. These will be replaced by appropriate values when the translation will be displayed in the app. For instance, the display of "Hello {0}!" with "PDF4Teachers" as parameter gives "Hello PDF4Teachers!". Parameters meaning is usually provided in comment (dark blue box).




Manually translate the application


Please find here how to create a translation of PDF4Teachers, by directly translating the files.

Application translation files can be accessed from PDF4Teaches app with: Tools -> Debug -> Open data folder, then navigate to the translations subfolder. To add a language, you only need to add a .properties files. Each translation includes 4 files with same name (2 letters for the language, underscore, 2 letters for region), but they have a different extension:



Once your translation done, you may send it to Clément Grennerat. Translation files are updated automatically, your translation will be instantly published.




Manually translate the website


You will find here how to create a translation of pdf4teachers.org by directly using the files.

To do so, you need to download this website code here. There is one translation file per page, plus one common to all pages. You will have to add a .properties file in:
- /commonTranslations/
- /translations/ (For the home page)
- <Each page name>/translations/
You may start from the French version (fr.properties) ou the English one (en.properties). Translation files are in the format <Keywords in English>=<Sentence in the translation language>

To test your translation, you will need a PHP web server running on your computer. It is therefore recommended to send your translation files directly to Clément Grennerat. May you still want to test the new language, you will need to add the name of the files without the .properties extension in the variable $languages of /php/translator.php (somewhere around line 20). You will also need to add the language's flag in /data/img/languages/ in .png format.