Jump to content

markus_blue_tomato

Members
  • Posts

    192
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by markus_blue_tomato

  1. I use some third party SaaS tool which an REST API. They often have troubles and the only solution is writting them an E-Mail to get it fixed.

    The problem is, often I see the issue very late. Changing the tool is no option for the next months.

    Does anyone know some good and also not too expensive tool where I can monitor the API requests to the provider - uptime and also if the response has correct data.

    If some problem appears the tool should send out some warning via e.g. Mail.

  2. I've made the same experiences as @teppo. In the world of frontend development - nobody would use jQuery for a new project since now vanilla JS can handle most of jQuery's advantages from back in the 00's. For some specific things you would use libraries which not depend jQuery. Main reasons are also JS-Bundle size and performance.

    I think if jQuery continues development/maintenance Processwire can still use jQuery in the Admin Panel. Otherwise I would recommend to migrate frontend modules like FormBuilder away from jQuery to vanilla or smaller js libraries.

     

    • Like 2
  3. I have solved it with some lines of JS in my admin.js File for AdminOnSteroids:

    
      document.querySelectorAll(".NoticeError .pw-container").forEach(element => {
        if(element.innerText.includes("Original image does not exist to create size variation")) {
          element.parentNode.style.display = "none";
        }
      });

    It's not they prettiest solution and work's only if the error message is in english but it should do the work for us...

  4. Hi @ryan,

    after some testing around with our translation management, I saw that we need XLIFF format for most of our translation tools (https://www.across.net/https://tolgee.io/)

    Quote

    how to we retain our required "page" and "field" properties in XLIFF

    I guess you could take the id attribute in XLIFF and use some [pageid]-[fieldname].

    Quote

    and how do we provide a value for XLIFF's "file" and "skeleton" fields

    Example for file from tolgee export/import file XLIFF: 

    <file xmlns="" datatype="plaintext" source-language="de" target-language="de">

    And "skeleton" is not mandatory. So there is not need for in in Processwire exports.

    Example XLIFF export format for processwire could look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
      <file xmlns="" datatype="plaintext" source-language="en" target-language="de">
        <body>
          <trans-unit id="1234-title" datatype="html">
            <source>Hello World</source>
            <target>Hallo Welt</target>
          </trans-unit>
          <trans-unit id="1234-body" datatype="html">
            <source>
            	<p>
                  <strong>A text about flowers.</strong>
                </p>
            </source>
            <target>
            	<p>
                  <strong>Ein text über Blumen.</strong>
                </p>
            </target>
          </trans-unit>
        </body>
      </file>
    </xliff>

    This approach is for XLIFF 1.2 which is used by across and toolge but its depricated.
    Maybe it would be good to make an export/import option for XLIFF 1.x and XLIFF 2.x.

    More Information about XLIFF in Across: https://www.across.net/en/online-help/sdk/connecting-third-party-systems/crossconnect-for-external-editing/implementation/across-xliff-format?r=1

     

    • Like 1
  5. 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: 

     

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

    • Like 1
  7. I see several MySQL Error in my log and have no clue how to avoid them since it never happens for me:

    image.thumb.png.700f65d3e8fc41601c8bc27a030502e9.png

     

    Anybody has an idea what I could do?

    Using:

    PHP 8.0.17 (running in docker container on digital ocean)
    MySQL 8 (digital ocean mysql as a service)
    mostly latest PW dev Branch
     

     

  8. On 11/8/2018 at 3:27 PM, Tom. said:

    Edit2: 
    WireUpload does use $_FILES. There is some sort of bug happening here with using Ajax and WireUpload.

    got some similar troubles where $_FILES has the file but WireUpload->execute() is an empty array.

    I do some POST request JavaScript Fetch API.

  9. 34 minutes ago, ryan said:

     One module I've been working on this week (and last week) enables you to export translations for multi-language fields into JSON or CSV files. These files can be read into other translation systems, edited, and then imported back into ProcessWire.

    ?

    • Like 1
  10. foreach ($languages as $language) {
     echo $language->title;
    }

    I have a strange problem. I want to use this code to create a language switcher, but for the current selected language the title is alway empty.

    •  /en/ -->  "", "de", "es"
    • /de/ --> "en", "", "es"
    • /es/ --> "en", "de", ""

    It also doesn't work with using $user->language->title

    But it works with "id" and "name" instead of "title"

    Any ideas?

  11. On 2/15/2022 at 11:52 AM, teppo said:

    In recent (4.x) versions of ProCache the docblock for ProCache::___allowCacheForPage suggest that it might be a good place to hook to prevent cache file from being created. I'd probably try hooking there and setting return value to false in case a specific env variable is defined (or not defined).

    Other than that... no obvious solutions here.

    Thanks I will look into this and if it works I will update this post ?

    Update: Approach works ?

    $this->addHookAfter('ProCache::allowCacheForPage', function (HookEvent $event) {
      $event->return = (!empty(\DROPLET_HOSTNAME) && (\DROPLET_HOSTNAME === "my-droplet-production-01" || \DROPLET_HOSTNAME === "my-droplet-stage-01")) ? true : false;
    });

     

    • Like 2
  12. 9 hours ago, teppo said:

    In recent (4.x) versions of ProCache the docblock for ProCache::___allowCacheForPage suggest that it might be a good place to hook to prevent cache file from being created. I'd probably try hooking there and setting return value to false in case a specific env variable is defined (or not defined).

    Other than that... no obvious solutions here.

    Thanks I will look into this and if it works I will update this post ?

    • Like 1
  13. Hi,

    I want to setup ProcessWire in Digital Ocean with a load balanced setup approach. Digital Ocean droplets can have a persistend file system called "block storage volume". The problem is, this block storage volume can't be shared between droplets which leads into issues with uploads and ProCache.

    I solved the uploads problem with the solution that the admin panel is only be used on the first droplets and assets (uploads) are synced with lsync to the other droplets und sessions are saved in redis.

    But I am struggling with this approach with ProCache. Requests to droplets 1 should be cached (and synced to dropled 2 and 3) but requests to droplets 2 and 3 shouldnt be cached since this would break my sync I guess...

    One idea I had is to set env variables on droplet 2 and 3 check the variable in _init.php and set https://processwire.com/api/ref/pro-cache/cache-on/ to false otherwise to true.

    Has anybody ideas to solve this?

  14. I have tried to use following code in _init.php and _ready.php:

    wire()->addHook('/hello-world', function($event) {
        return 'Hello World';
    });

    But got this back when I visit /hello-world:

    Ouch… Error: Exception: Path hooks must be attached during init or ready states (in wire/core/WireHooks.php line 834)

    When I add the hook in init.php I get the 404 Page.

    Can anyone help me here?

    • Like 1
×
×
  • Create New...