Jump to content

adrian

PW-Moderators
  • Content Count

    9,646
  • Joined

  • Last visited

  • Days Won

    317

adrian last won the day on October 29

adrian had the most liked content!

Community Reputation

11,740 Excellent

About adrian

  • Rank
    Hero Member

Profile Information

  • Gender
    Not Telling
  • Location
    Canada

Recent Profile Visitors

31,554 profile views
  1. I don't have time to dig into this further today, but wanted to let everyone know that with PHP8 I am having some fatal errors. It was kinda OK until I tried to turn on JIT (based on https://stitcher.io/blog/php-8-jit-setup), but after that, the admin wouldn't load - sometimes Tracy would manage to tell me that it was a CSRF exception. I tried disabling JIT, but that wasn't enough. In the end, I had to disable opcache - in my case, that required commenting out the line: zend_extension=/usr/local/opt/php/lib/php/20200930/opcache.so in my /usr/local/etc/php/8.0/conf.d/ext-opcache.ini file. Note that this on my Mac with LAMP stack installed via homebrew. The browser console was showing the following error: ERR_INCOMPLETE_CHUNKED_ENCODING which others have reported a connection to opcache: https://stackoverflow.com/questions/29894154/chrome-neterr-incomplete-chunked-encoding-error Need to read and learn more, but would also appreciate it if someone else has any insights.
  2. Hi @teppo - getting this on PHP 8 Fatal error: ProcessWire\Wireframe::__set(): Return type must be void when declared in /site/modules/Wireframe/Wireframe.module.php on line 842
  3. Actually, even this works: $page->getField('first_name')->columnWidth
  4. Much cleaner - I always forget about that option for some reason!
  5. @Motion Expert - this value is not stored by this module, but rather by PW in general. You can get the width of a field in the content of a particular fieldgroup (basically the same as a template) like this: In my example, I have the width of the first_name field set to 50% for the user template/fieldgroup.
  6. Thanks! As and FYI and a question to any Spanish / French / Italian (and any other languages that have gender specific nouns / verbs), I submitted a support ticket to DeepL yesterday asking about a way to specify the gender of names because of this scenario. my friend John -> mi amigo John my friend Jenny -> mi amiga Jenny my friend Jody -> what do we do here - DeepL doesn't know if Jody is male or female because it is used as both. I proposed to them that it might be nice to be able to send something like this to be translated: my friend <male>Jody</male> Of course this is a very simple example of gender translation issues (there are verb conjugation / contraction issues like ayudarle / ayudarla), but you get the idea. Actually, I barely know what I am talking about with this stuff but the process of investigating is helping my very limited spanish. DeepL is actually very impressive with this stuff. Anyone out there with any more experience have any thoughts?
  7. Just wondering if the translate method in the Fluency class should be public so we can call the translate method more easily. I made that change locally, and now I can do: As you can see, now I can load the module and call translate directly, without the need to get and apply the API key. I guess this has more overhead but not really sure if it is significant. What do you think?
  8. Thanks @FireWire - just testing the dev version and a couple of things: 1) Parse Error: syntax error, unexpected '$output' (T_VARIABLE) (line 230 of site/modules/Fluency/classes/DeepL.class.php) I added the missing semi-colon to fix that. 2) Because the new $configs parameter is actually the 5th parameter for the translate method, you need to specify something for the 4th one ($ignoredStrings). So what worked for me, was this: which is great because now there is no period at the end, and also they didn't capitalize the first letter. I do wonder if there is much advantage for API use to use your class over a direct call, but it seems like there might be some added value, like the automatic stripping of any <fluency-ignore> tags etc. Anyway, thanks for the update - that's great and I'll be sure to look into the API to see what other options might be worth playing with.
  9. @FireWire - is this the recommended way to use directly via the API? A bit off topic, but do you know why the returned text ends with a period? It also happens with some other phrases and is consistent with the results returned on the site here: https://www.deepl.com/en/translator but it's weird to me that it tries to fix grammar in some cases but not others - maybe it assumes that this is a complete sentence, but things like "the dog" are not and so in that case it doesn't add the period. Do you know if there is a setting for this?
  10. I just took a look at your code and saw that you're already using preg_match_all so I could actually just add: \[\[([\w]+)\]\] as a non translated string and that takes care of excluding Hanna codes, so I think we are all good actually, although it might be nice to note this in the settings.
  11. Or perhaps you could add a little more flexibility by allowing the "Global Non-translated strings" option to support regexes so we could exclude things like hanna codes and others as needed?
  12. Great - thanks! I have another request for you - can you make it possible to not translate hanna codes, eg anything inside this: [[don't_translate]] - you'll want to make sure to find out what the open and close tags are for Hanna in each PW install, but that's easy. Does that make sense? Thanks again - this is really awesome!!!
  13. Looking at the repo (https://gitlab.com/SkyLundy/fluency-processwire), it seems pretty clear why it's happening - you have all the files stored inside a "Fluency" folder. When PW installs from the zip file, it extracts everything into a higher level Fluency directory, which is why there end up being two. Take a look at any other PW module and you'll see that the main files are at the top level.
  14. @FireWire - just installed and on going to the Translation page, I get these errors: PHP Warning: file_get_contents(/site/modules/Fluency/fluency_templates/el_h1.tpl.html): failed to open stream: No such file or directory in .../Fluency/classes/FluencyTools.class.php:31 PHP Warning: file_get_contents(/site/modules/Fluency/fluency_templates/el_p.tpl.html): failed to open stream: No such file or directory in .../Fluency/classes/FluencyTools.class.php:31 I installed via the URL to the zip file and the problem is that it resulted in two "Fluency" directories such that the path is actually: /var/www/dev.grief.coach/site/modules/Fluency/Fluency/fluency_templates/el_p.tpl.html Once I moved those files and did a modules > refresh it started working as expected.
×
×
  • Create New...