Jump to content

tpr

Members
  • Posts

    2,321
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by tpr

  1. You don't have to add strings exactly as the default language but keys too, eg. you can use __('text_message_1'). So you can add translation also for the default language in the admin.
  2. Well I guess you have no idea how much effort is put even in simpler replies if you're not a native English speaker
  3. Yes, that's the same setting, see the attached image. Interesting that it doesn't work for you, here it works fine on 3.017 (just tried).
  4. I'm using this method for translation: https://processwire.com/talk/topic/10447-using-translatable-strings-across-template-files/ In my setup there is only 1 file '_strings.php' so PW will find translations even if it's in another file. You don't even need to include() that file, only select it in the Language Translator (admin).
  5. Yes, I thought about passing the Validator entirely to JavaScript. There could be even an "on demand" mode that validates only on clicking on the panel (just an idea). Apart from the issue I had on one server Tracy loads fast here. I have PHP 7 on most servers and sometimes I get 200-250 ms speed, at least that's what Tracy shows. When I revert PHP version to 5.4 or 5.6, speed increases to 500 and 700 ms. I have to add that I use only a few panels.
  6. Is the Validator panel ajax-driven? That could speed things up too I guess.
  7. I just installed the latest dev to see the images field changes. Some thoughts: instant previews are great d&d image replacement is useful when there's only one image added and entering edit mode, opening the lightbox and clicking on the image in the lightbox closes the lightbox but also closes the edit mode. This feels like a glitch. Clicking on "close" or on the overlay works fine though. Also, it would be nice to see these some time: viewing the file name somehow (as requested above) renaming a file for SEO purposes (as requested above) deleting all variations for an image, or maybe for all on the page. The "Variations" button could be modified to have a dropdown like the new Save buttons. the button "Crop" have other actions in the lightbox, so this could be perhaps renamed as "Edit". This would be a more appropriate naming even when adding new edit functions to the lightbox. Thanks for everyone involved, this could be a hard work with no doubt. We shouldn't expect everything working perfectly on the first iteration but it's a great start to build upon.
  8. The "Replace blank alt attributes with image description" seems to fix missing alt attributes here (PW 3.09). I uploaded an image to the "images" field, set a description to it, and then placed it to the "body" field using the CKEditor's toolbar. If I uncheck it the alt goes empty.
  9. This actually works pretty well here. I was sceptic because the if you are on a non-default language then the string you pass to the translate function will be different from the one you originally used. So if the string is "Search", and you browse the site in German, then it wil look like this: _x('Suchen', 'Segments') And in this case I thought it won't find the English counterpart because I've never set 'Suchen', only 'Search'. But it works! Just tried it on a 4-language site and it works in all languages, back and forth. Magic. <?php // save current language to variable to restore later $originalLanguage = $user->language; foreach ( $languages as $language ) { $_cst = ''; if (! $page->viewable ( $language )) continue; // is page viewable in this language? if ($language->id == $user->language->id) { echo '<li class="current">'; $_cst = $current_segment; // [1] Segment in the current language } else { echo '<li>'; // need to change user language temporary to find translation $user->language = $language; $_cst = _x($current_segment,'Segment'); // [2] Translated segment // restore user language $user->language = $orginalLanguage; } $url = $page->localUrl ( $language ); $_url = $url; if($current_segment) $_url = $_url.$_cst; $hreflang = $homepage->getLanguageValue ( $language, 'name' ); echo '<a class="link-language" hreflang="'.$hreflang.'" href="'.$_url.'">'.$language->title.'</a>'; echo "</li>"; } ?> The question is that are all your segments translated? If not, it won't find anything. Another issue is that do you need to check the availability of the segment in the other language before appending to the href? If yes, you'll need to use a query first to see if the given segment exists.
  10. I see. What if you set $user->language = 'en' just before getting the translation, and set it back to original after that?
  11. The truth is that the Tracy module is only a cover. It's adrian who analyses your code in the background
  12. There should be a check box in ckeditor field's input tab to insert alt tag if I'm not mistaken, at least in the 3.x branch.
  13. I think it should just work fine if you append the segment using _x() to the langswitcher url. What is the code you use for the langswitcher now?
  14. Couldn't just set new parent for those repeater pages under Admin? I see it's not possible through the admin but maybe it's doable via API.
  15. No that shouldn't I guess, sometimes I also happen to create pages with no title.
  16. When removing all image variations, is the removal of CKEditor images safe now? I occassionally use horst's "PageimageRemoveVariations" module that comes with a big warning:
  17. First check the server error logs, hopefully there is something about the hiccup.
  18. http://ckeditor.com/addon/magicline
  19. Thanks! Keep in mind that it requires PW 3 because of the namespace. There' no specific reason to make it PW 3 only but currently I have no time to rewrite. Just added two global functions t() and n() to make string translations easier (v0.12).
  20. Great, thanks! Both working fine. However, when going to the Media page in the admin, I get an error: "Call to a member function count() on null" line: https://github.com/BitPoet/MediaLibrary/blob/master/ProcessMediaLibraries.module#L41 I've removed the MediaFiles from the template, I guess that's why. Possible fix: foreach($this->pages->find("template=MediaLibrary") as $pg) { $MediaImagesCount = $pg->MediaImages ? $pg->MediaImages->count() : 0; $MediaFilesCount = $pg->MediaFiles ? $pg->MediaFiles->count() : 0; $tbl->row(array( "<a href='{$pg->editURL}'>{$pg->title}</a>", implode(' / ', array_map(function($item) { return "<a href='{$this->config->urls->admin}page/?open=$item->id'>$item->title</a>"; }, $pg->parents()->getArray())), $MediaImagesCount, $MediaFilesCount )); }
  21. Template Latte Replace Latte template engine support for ProcessWire Having wrote about this one for a few times and now here it is. The readme is not complete but should give a solid starting point. Feel free to ask if something's not clear. http://modules.processwire.com/modules/template-latte-replace/ https://github.com/rolandtoth/TemplateLatteReplace
  22. In some WP plugins they solve such situations by allowing batch deletion of 50 or 100 images, and you can continue the process if there are images left.
  23. Thanks! Setting "/medialibrary1/medialibrary2" allows users selecting images from these pages now. I didn't wanted them to see or use images from "/medialibrary1" but it's something I can live with Now I can use it for common site-wide images, which will be a great plus. Have you considered changing the way Media Libraries are selected? The current selectbox doesn't seem too user-friendly UI-wise. Maybe radios would be better so they could see libraries with fewer clicks.
  24. I got a client request to make Word template so she can create an image of the weekly menu of a restaurant to post on Facebook. I usually get sick when I have to deal with M$ Word - it's frustration and it's not meant to be used things like that. So I figured out a better system: PW + html2canvas.js. It took more time to finish but it was worth the trouble. The main issues were html2canvas versus some CSS issues, plus switching to different languages in PW on each line. Also, JavaScript cannot offer named downloads, only "download.png", so I had to use HTML5 attribute "download" on links to be able to add custom download filename. I used ProField modules Table and Matrix Repeater which allow very pleasant editing of menu items, even in multilanguage context. Front-end editing is created using the built-in front-end editor. I was about to achieve inline editing of menu items but it soon turned out that repeaters and tables can't be edited this way. Anyway, it's still better compared to my module FEEL because sections are reloaded using Ajax and the admin lightbox shows only the fields I choose. Here's a quick screencap - when the gray background turns to dark gray, then the menu is not HTML but canvas, that can be downloaded.
  25. It's great to be able to switch to the Stable branch, now Tracy bar appears here without editing the module file, thanks!
×
×
  • Create New...