Web based family history software

Please do NOT expect all Feature Requests to be actioned automatically. Describing your proposal here will ensure the development team are aware of it, and they will give it careful consideration.

Question Missing data

  • HerzScheisse
  • Away
  • New Member
  • New Member
More
3 weeks 4 days ago - 3 weeks 4 days ago #41 by HerzScheisse
Replied by HerzScheisse on topic Missing data

Do you know what to do? Thanks!
i did some little research on this and i guess we have to tell WT to use our own module translation file...

I found this part in a module GVExport
Code:
    /**      * Additional translations for module.      *      * @param string $language      *      * @return string      */     public function customTranslations(string $language): array     {         $lang_dir   = $this->resourcesFolder() . 'lang/';         $file       = $lang_dir . $language . '.mo';         if (file_exists($file)) {             return (new Translation($file))->asArray();         } else {             return ;         }     }

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.18 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.2.13 | MariaDB 10.5.23 | rewrite_urls="1"
Last edit: 3 weeks 4 days ago by HerzScheisse.

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Away
  • New Member
  • New Member
More
3 weeks 4 days ago #42 by HerzScheisse
Replied by HerzScheisse on topic Missing data

webtrees 2.1.18 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.2.13 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago #43 by sevtor
Replied by sevtor on topic Missing data

delete the php - file and it is auto recreated
 
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.

webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago #44 by Franz Frese
Replied by Franz Frese on topic Missing data
You are right.

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #45 by sevtor
Replied by sevtor on topic Missing data
I received the update of the different module.php files but unfortunately the translations are added too late! When the 'Reports' option is clicked and a report is selected the title and description fields are not yet translated. But when the report is actually generated all translations are there.

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/
Attachments:

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Away
  • New Member
  • New Member
More
3 weeks 1 day ago #46 by HerzScheisse
Replied by HerzScheisse on topic Missing data
Hey sevtor,

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.18 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.2.13 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago - 3 weeks 1 day ago #47 by sevtor
Replied by sevtor on topic Missing data

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...




 
OK, I should have explained this better but it was very late yesterday!
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/
Last edit: 3 weeks 1 day ago by sevtor.

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #48 by Franz Frese
Replied by Franz Frese on topic Missing data
I think your change of the ModuleConfigTrait is not wanted. Instead you should use a class, that uses the trait.
Code:
<?php class MyClass {   use TraitName; } ?>

Please Log in or Create an account to join the conversation.

More
3 weeks 14 hours ago #49 by Franz Frese
Replied by Franz Frese on topic Missing data
There are about 20 modules/classes that use ModuleConfigTrait in webtrees.

Please Log in or Create an account to join the conversation.

More
3 weeks 10 hours ago - 3 weeks 10 hours ago #50 by sevtor
Replied by sevtor on topic Missing data
Yes, I understand that this module is needed by many other modules.
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/
Last edit: 3 weeks 10 hours ago by sevtor.

Please Log in or Create an account to join the conversation.

More
3 weeks 9 hours ago - 3 weeks 6 hours ago #51 by sevtor
Replied by sevtor on topic Missing data
Unfortunately I messed up the translation files the other day, I am sorry for the inconvenience it ma have caused.
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/
Attachments:
Last edit: 3 weeks 6 hours ago by sevtor. Reason: updated zip archive

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Away
  • New Member
  • New Member
More
3 weeks 4 hours ago #52 by HerzScheisse
Replied by HerzScheisse on topic Missing data
no worries... we all learn something new on webtrees... and i must say, what you've achieved so far is awesome... :)

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.18 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.2.13 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago - 2 weeks 5 days ago #53 by sevtor
Replied by sevtor on topic Missing data
Thanks. Well, about how to store the translation files I just looked at the webtrees/resources/lang/ folder and thought that it should be the same structure. I also remembered that the locale folder in Unix have LANG_CODE folders, but that is not really compatible. And when I modified the ModuleCustomTrait.php file I used similar code as already existed for the main messages.php generation.
Yes, I stored the messages.pot file in the lang folder.

Now, after a few days of reflection, I regret that I changed back to my original design, but it would be easy to adapt the modification to the other model.
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/
Last edit: 2 weeks 5 days ago by sevtor. Reason: Compared other modules

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #54 by sevtor
Replied by sevtor on topic Missing data
Updated version of the zip files, new-reports-2.1.x.zip for webtrees 2.1.x and new-reports-2.2.x.zip for webtrees 2.2.x
 

webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Attachments:

Please Log in or Create an account to join the conversation.

More
2 weeks 3 days ago #55 by sevtor
Replied by sevtor on topic Missing data
Updated once again: removed conversion of first character in gedcom records for German language.
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/
Attachments:

Please Log in or Create an account to join the conversation.

More
2 weeks 2 days ago #56 by Franz Frese
Replied by Franz Frese on topic Missing data
the marriage report pdf-output looks destroyed.

Please Log in or Create an account to join the conversation.

More
2 weeks 7 hours ago #57 by sevtor
Replied by sevtor on topic Missing data
You are right, the old report definitions need some minor adjustments. I think I have made the necessary changes to all xml files now. The pedigree_report.xml should be replaced by family_tree_report.xml and the ahnentafel_report.xml and descendancy_report.xml should be replaced by family_history_report.xml which information but with possibility to select more options.

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/
Attachments:

Please Log in or Create an account to join the conversation.

More
2 weeks 5 hours ago #58 by Franz Frese
Replied by Franz Frese on topic Missing data
You should deploy a messages.po in your modules_v4 subdir, but not the php-file.

Please Log in or Create an account to join the conversation.

More
2 weeks 4 hours ago #59 by sevtor
Replied by sevtor on topic Missing data

You should deploy a messages.po in your modules_v4 subdir, but not the php-file.
 
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!

webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}