Question
Missing data
- HerzScheisse
-
- Offline
- New Member
-
i did some little research on this and i guess we have to tell WT to use our own module translation file...Do you know what to do? Thanks!
I found this part in a module GVExport
But i cant get it to work... but maybe its a little help for you...
EDIT...
I Got it to work... will provide a PR soon...
we need to include "use Fisharebest\Localization\Translation;"
webtrees 2.1.20 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"
My genealogy site: www.eisold.family
Please Log in or Create an account to join the conversation.
- HerzScheisse
-
- Offline
- New Member
-
webtrees 2.1.20 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"
My genealogy site: www.eisold.family
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
That is OK if one has a development version of webtrees, but when we have installed webtrees from download link there is no messages.po file so the messages.php file cannot be recreated.delete the php - file and it is auto recreated
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
Therefore I found that a much better solution is to modify ModuleCustomTrait.php. It is included in the updated archives new-reports-2.1.x.zip and new-reports-2.1.x.zip. As before the files in there is intended to the corresponding files in your webtrees installation. Still hoping for these updates to be included in a coming release!
The new modules are updated and unfortunately the translations to de and nl need a minor adjustment.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- HerzScheisse
-
- Offline
- New Member
-
thanks for you work on this again...
no worries about the late translations, i can update them again... i'm very happy with that updated any extra reports you've done...
first i need to know, you reverted my proposed change from "LANG_CODE/messages.po" to "LANG_CODE.po"
Is there a reason for that? I've checked a couple of modules and most modules use the later structure...
If you agree with that, i can propose another PR...
webtrees 2.1.20 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"
My genealogy site: www.eisold.family
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
OK, I should have explained this better but it was very late yesterday!Hey sevtor,
first i need to know, you reverted my proposed change from "LANG_CODE/messages.po" to "LANG_CODE.po"
Is there a reason for that? I've checked a couple of modules and most modules use the later structure...
During my experiments with different solutions I found that the function customTranslations(string $language) in the module is called too late. The title() and description() functions of the module are called before the translations are included. The presentation of the report when clicking on the 'Reports' menu item presents the alternatives with their English names, and when one option is selected the title and description are in English. But when a report is selected the translations are activated before the report is generated.
However, I wanted the translated phrases to be used all the time. You can see that the title is supposed to be I18N::translate('...').
This is achieved by the modification in app/Module/ModuleCustomTrait.php ! All modules should have the same structure and LANG_CODE/messages.* is used in many places. In order to speed up the translation phase the messages.po files (or messages.mo) are converted to messages.php and saved to be used the next time.
Maybe I should also test the other naming convention.
Btw, it is necessary that the .po files have exactly one space character between msgid and the string (same for all msg...).
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
But this change is totally compatible and just adds translations to a module that have a messages.po file but not a messages.php file so I really hope that it is OK.
A module can already have a function customTranslations(string $language) but it is called after the calls to title() and description() of the module which means that the title and description are not translated when clicking on 'Reports'. If I could find these calls instead I could change there but that would also be somewhere in the core.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
Here is a new zip archive with correct translation for Swedish. The German and Dutch translations need checking. There are also messages.pot files that can be used when updating ("msgmerge .../nl/messages.po .../messages.pot")
All modules should have the customTranslation function is included, added now.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- HerzScheisse
-
- Offline
- New Member
-

just a qucik side note/question...
why did you use the folder structure for languages again?
from my understanding it would be better to store all LANG.po files in the "lang" folder... add the messages.pot file there
webtrees 2.1.20 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"
My genealogy site: www.eisold.family
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
Yes, I stored the messages.pot file in the lang folder.
I have checked other modules that are published and both structures are used, so my conclusion is to stay with separate folders.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
Moved interpretation of tag _SP_DEAT to app/Report and xml reports, i.e. app/Gedcom.php not changed.
Only one zip archive for reports, works with both versions 2.1.x and 2.2.x.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
The standard reports are included in the new new-reports.zip archive and some minor changes are done in new_modules.zip, both attached here.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
Please Log in or Create an account to join the conversation.
- sevtor
-
- Offline
- New Member
-
Yes, but there are no messages.php files in the latest new-modules.zip and not if they are downloaded from github.com/sevtor/modules so I suspect that you have an old version, or did not clean-out the old files before extracting the new archive. By mistake some early versions had .php files!You should deploy a messages.po in your modules_v4 subdir, but not the php-file.
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- Jacoline
-
Topic Author
- Offline
- Junior Member
-
Still a noob
(1st installation at 7-21-2010)
Please Log in or Create an account to join the conversation.