ryan Posted February 17, 2023 Share Posted February 17, 2023 This week we have a new core version available on the dev branch. Relative to the previous version, 3.0.212 contains 32 commits, 16 issue fixes and 3 PRs. Here's a list of what's been added: Improvements were made to InputfieldImage so that you can now add your own image actions with hooks. More details in this post and ProcessWire Weekly #455. Significant refactoring and improvements were made to the ProcessPageEditLink module. One of the most notable is that it now will retain HTML class attributes on links, even if not specifically configured with the ProcessPageEditLink module. This is useful if you've added custom classes for links in TinyMCE or CKEditor, but haven't also added them to the ProcessPageEditLink module configuration. Improvements were made to Text fields so that HTML Entity Encoder is now automatically added. This was covered in detail in last week's post and in ProcessWire Weekly #457. InputfieldEmail has been updated with optional support for IDN emails and UTF-8 local-part emails, per request. Two new $sanitizer methods have been added: htmlClass() and htmlClasses(). These sanitize HTML class attributes, and it's part of what enables us to support the custom class attribute support added in the ProcessPageEditLink updates mentioned above. Added feature request #480 to support configurable file extensions for translatable files (beyond .php, .module and .inc). Added a new uploadName() method/property to Pagefile/Pageimage objects that returns the original unsanitized filename as it was uploaded. Applies only to files uploaded since this feature was added. Be aware the filename is unsanitized so be careful with it. This was to partially answer feature request #56 and this solution was suggested by Bernhard Baumrock. Demonstrating the above, InputfieldFile now shows this original filename if you hover the file icon, and InputfieldImage shows it if you hover the current filename. HTTP requests that contain an accidental double slash in the URL now redirect rather than render the page. The PagesParents class was refactored so that it is now a lot faster in saving its data to the pages_parents table. This is very noticeable if you have a site with more than million pages when changing the parent of existing pages, especially those having children. Previously there was a [potentially very] long delay at large scale, now it is instant. More details on these updates, and additional updates can also be found in ProcessWire Weekly #455, #456 and #457. Thanks for reading and have a great weekend! 21 3 Link to comment Share on other sites More sharing options...
Mats Posted February 17, 2023 Share Posted February 17, 2023 Great stuff as always, Ryan! 2 Link to comment Share on other sites More sharing options...
elabx Posted February 17, 2023 Share Posted February 17, 2023 33 minutes ago, ryan said: Significant refactoring and improvements were made to the ProcessPageEditLink module. One of the most notable is that it now will retain HTML class attributes on links, even if not specifically configured with the ProcessPageEditLink module. This is useful if you've added custom classes for links in TinyMCE or CKEditor, but haven't also added them to the ProcessPageEditLink module configuration. Struggled a bit with this recently, not anymore! Thanks!! Link to comment Share on other sites More sharing options...
bernhard Posted February 18, 2023 Share Posted February 18, 2023 20 hours ago, ryan said: Added feature request #480 to support configurable file extensions for translatable files (beyond .php, .module and .inc). This will be great for everybody using RockFrontend + LATTE. Thank you for your work and that update!! ? But there is still a small step missing/not working. I've added the explanation to the issue with screenshots demonstrating the problem. Would be great if you could take a look at that @ryan so that we can not only tick that request as completed but we can also actually use it to directly translate LATTE files in ProcessWire and we don't need the workaround any more ? 3 Link to comment Share on other sites More sharing options...
markus_blue_tomato Posted February 18, 2023 Share Posted February 18, 2023 9 hours ago, bernhard said: This will be great for everybody using RockFrontend + LATTE. Thank you for your work and that update!! ? But there is still a small step missing/not working. I've added the explanation to the issue with screenshots demonstrating the problem. Would be great if you could take a look at that @ryan so that we can not only tick that request as completed but we can also actually use it to directly translate LATTE files in ProcessWire and we don't need the workaround any more ? Yes this would also be nice for Smarty (.tpl) files. 1 Link to comment Share on other sites More sharing options...
bernhard Posted February 22, 2023 Share Posted February 22, 2023 Thx @ryan again for the updates - we finally have translatable strings in LATTE files ? This is what you have to do: https://processwire.com/talk/topic/28202-rockfrontend-now-supports-translations-in-latte-files-?/ On 2/18/2023 at 10:28 PM, markus_blue_tomato said: Yes this would also be nice for Smarty (.tpl) files. Are you talking about smarty files in RockFrontend or in general? This is how I'm doing it for latte files: https://github.com/baumrock/RockFrontend/blob/main/translate.php --> these functions are injected before any latte file get's rendered so that they are available to the compiled php file that latte creates. I don't know how smarty works (I've been using it in 2003, but I guess some things have changed since then and my memory is not the freshest any more ? ), but if you are talking about smarty in RockFrontend I'm happy to assist you to bring support for it into the module ? 1 Link to comment Share on other sites More sharing options...
markus_blue_tomato Posted March 3, 2023 Share Posted March 3, 2023 On 2/22/2023 at 6:08 PM, bernhard said: Thx @ryan again for the updates - we finally have translatable strings in LATTE files ? This is what you have to do: https://processwire.com/talk/topic/28202-rockfrontend-now-supports-translations-in-latte-files-?/ Are you talking about smarty files in RockFrontend or in general? This is how I'm doing it for latte files: https://github.com/baumrock/RockFrontend/blob/main/translate.php --> these functions are injected before any latte file get's rendered so that they are available to the compiled php file that latte creates. I don't know how smarty works (I've been using it in 2003, but I guess some things have changed since then and my memory is not the freshest any more ? ), but if you are talking about smarty in RockFrontend I'm happy to assist you to bring support for it into the module ? Talking in general for https://processwire.com/modules/template-engine-factory/ But for now I have some crazy workaround: I have some node.js script im my frontend bundler (gulp) which parses .tpl Smarty files and generates .php files with the translations. I've talked about it here: Link to comment Share on other sites More sharing options...
markus_blue_tomato Posted April 27, 2023 Share Posted April 27, 2023 Hello! We created an converter script which converts processwire translation json's to XLIFF 1.2 and back to PW json. Its written in Node.js and you can get it here: https://github.com/blue-tomato/PwXliffConverter/ 1 Link to comment Share on other sites More sharing options...
teppo Posted April 27, 2023 Share Posted April 27, 2023 6 hours ago, markus_blue_tomato said: Its written in Node.js and you can get it here: https://github.com/blue-tomato/PwXliffConverter/ The repository can't be found or accessed, though ? Link to comment Share on other sites More sharing options...
markus_blue_tomato Posted April 27, 2023 Share Posted April 27, 2023 1 hour ago, teppo said: The repository can't be found or accessed, though ? Sorry, was still on private. It's no public! 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now