User Tools

Site Tools


en:dev:284:translate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:dev:284:translate [18.07.2018 11:09] – [Structure of translation tables] Manuela v.d.Deckenen:dev:284:translate [18.07.2018 12:46] (current) – [Translations before 2.8.4] Manuela v.d.Decken
Line 18: Line 18:
 ==== General ==== ==== General ====
 For simplicity, I'm talking only about 'language files' here. However, in real case usage the translations no longer have to be defined necessarily as arrays in PHP files. Any conceivable suitable file format is possible now. The data don't not even have to be on the same server. The data could be provided by a web service, or stored in a database. For such use cases only a small, specialized driver is necessary, which can be loaded any time, even temporarily even for a single addon or template involved. For simplicity, I'm talking only about 'language files' here. However, in real case usage the translations no longer have to be defined necessarily as arrays in PHP files. Any conceivable suitable file format is possible now. The data don't not even have to be on the same server. The data could be provided by a web service, or stored in a database. For such use cases only a small, specialized driver is necessary, which can be loaded any time, even temporarily even for a single addon or template involved.
-==== Translations before 2.8.==== +==== Translations before 2.10.==== 
-Let's start at the current level at the beginning of 2.8.and earlier. In the central language directory of the core, there are a large number of language files (DE.php | EN.php | etc.). Each of these files contains an overwhelmingly large number of language variables (specifically, currently about 600 !!). The used system requires that in each language file, each entry is present. Missing one often ends up in a runtime error. Once WebsiteBaker starts, one of these language files will be loaded with its full 600 entries forcibly. completely independent of whether even one of them is required! Of course, different addons then load their own language files still additionally. Having several different addons on one page even a very considerable number can also come together.\\ //(From historical times, the translation of many ancient modules are included and a real care of the files, with a reasonable time / effort is virtually impossible. Whoever says otherwise, must be happy from now on take care of these fossil files. ;-))//\\+Let's start at the current level at the beginning of 2.10.and earlier. In the central language directory of the core, there are a large number of language files (DE.php | EN.php | etc.). Each of these files contains an overwhelmingly large number of language variables (specifically, currently about 600 !!). The used system requires that in each language file, each entry is present. Missing one often ends up in a runtime error. Once WebsiteBaker starts, one of these language files will be loaded with its full 600 entries forcibly. completely independent of whether even one of them is required! Of course, different addons then load their own language files still additionally. Having several different addons on one page even a very considerable number can also come together.\\ //(From historical times, the translation of many ancient modules are included and a real care of the files, with a reasonable time / effort is virtually impossible. Whoever says otherwise, must be happy from now on take care of these fossil files. ;-))//\\ 
 +=== Aufbau der Sprachdateien (EN.php) === 
 +<PHP> 
 +//Modul Description 
 +$module_description = 'Enter here a really short description of your module. About 200-250 characters should suffice.'; 
 + 
 +$MOD_MyModule['PRINT'                      = 'Please print this page, if a copy is desired for your records.'; 
 +$MOD_MyModule['LOAD_LAYOUT'                = 'Load Default Layout'; 
 +$MOD_MyModule['TEXT_GUEST'                 = 'Guest'; 
 +$MOD_MyModule['TEXT_UNKNOWN'               = 'unknown'; 
 +$MOD_MyModule['TEXT_PRINT_PAGE'            = 'Print page'; 
 +$MOD_MyModule['MESSAGE_ARCHIVE_DELETED'    = 'Zip(s) deleted successfully.'; 
 +$MOD_MyModule['MESSAGE_ARCHIVE_NOT_DELETED'] = 'Cannot delete the selected Zip(s).'; 
 +</PHP> 
 +somebody wrote this kind of entries: 
 +<PHP> 
 +$MOD_MyModule['PRINT'                      = 'Please print this page, if a copy is desired for your records.'; 
 +$MOD_MyModule_TEXT['GUEST'                 = 'Guest'; 
 +$MOD_MyModule_MESSAGE['ARCHIVE_DELETED'    = 'Zip(s) deleted successfully.'; 
 +</PHP> 
 +It does not look that good, but it works. Both syntax lead to the same Translate keys. 
 +<PHP> 
 +echo $oTrans->MOD_MyModule_PRINT; 
 +echo $oTrans->MOD_MyModule_LOAD_LAYOUT; 
 +echo $oTrans->MOD_MyModule_TEXT_GUEST; 
 +echo $oTrans->MOD_MyModule_TEXT_UNKNOWN; 
 +echo $oTrans->MOD_MyModule_TEXT_PRINT_PAGE; 
 +echo $oTrans->MOD_MyModule_MESSAGE_ARCHIVE_DELETED; 
 +echo $oTrans->MOD_MyModule_MESSAGE_ARCHIVE_NOT_DELETED; 
 +</PHP> 
 + 
 + 
  
 ==== The basic system behind Translate ==== ==== The basic system behind Translate ====
en/dev/284/translate.1531912192.txt.gz · Last modified: 18.07.2018 11:09 by Manuela v.d.Decken