Before you ask please READ THIS

Word "All" in portfolio filter can not be translated trhough WMPL?

edited October 2014 in Blame Posts: 47
Hi there,
I have one final problem to solve before our customers Blame-based website can go live.
I am thus far unsuccesfull in translating the word "ALL" that is used in the portfolio filter (http://blame.apollo13.kinsta.com/portfolio/) into my native language through WMPL.
Since Blame is WMPL compatible I thought I'd ask here (also because of the excellent support I received earlier :-)

I have managed to change the word "All" into "No Filter" (which was preferred by our customer over "All") by hardcoding it in wp-content/parts/genre-filter.php but that changes the word in all languagues. The idea is for the word to be translated when we switch languages.
I used string translation in WPML and translated the word All that came up over there but that has no effect on the filter.
Any ideas on how to get this working?
Thanks in advance!
ALL.JPG
1256 x 558 - 125K

Comments

  • AirAir
    Posts: 10,970
    If you manage to translate any other words then there should be no problem with this one. There are two ways it could be done(as far as I know WPML):
    1. Make translation file like explained here http://apollo13.eu/docs/blame/#!/translating_theme
    2. Change our function that distinguish front-end translations form back-end ones, to normal localization function. To do it go to blame\parts\genre-filter.ph line ~35 and change this :
    echo '<li class="selected" data-filter="__all"><a href="' . a13_current_url() . '">' .  a13__fe( 'All' ) . '</a></li>';
    to
    echo '<li class="selected" data-filter="__all"><a href="' . a13_current_url() . '">' .  __('All', A13_TPL_SLUG) . '</a></li>';
    .

    Now you should be able to translate it in WPML, as it can find now this string.

    Please try it and let me know.

    With regards.

  • Posts: 47
    Hi Air,
    I tried option number 1 allready but that didn't work. Your option number 2 however did the trick!! After I edited that code I was able to find the string and translate it. Thanks again!!
    I have found one other final thing (I hope it's the last anyway), which is similar to the above.
    It's about the page preloader. I can add custom text in the blame --> layout --> page preloader section, but I don't seem to be able to translate this string. Also the words "Hide page preloader" don't show up in WMPL, so I can't translate it. Would you have a similar trick to fix this?
    If you want me to open a new ticket for this just let me know, I'll do that.
  • edited November 2014 Posts: 47
    Never mind. You put me on the right track and I figured it out myself :-)
    Should anyone run into the same problem:

    To translate the words "Hide page preloader" with WPML you should in file
    wp-content/themes/blame/advance/utilities/layout_parts.php sentence ~21
    change
    <a class="skip-preloader" href="#"><?php a13_fe('Hide page preloader'); ?></a>
    into
    <a class="skip-preloader" href="#"><?php __('Hide page preloader',A13_TPL_SLUG); ?></a>
    To translate the words "Site content loading. Please wait!" or whatever custom words you entered in blame --> layout --> page preloader you should in file
    /public_html/wp-content/themes/blame/wpml-config.xml
    add
    <key name="preloader_text" />
    between
    <admin-texts>
    	<key name="blame_appearance" />
    and
    </key>
    After these two actions, rescan your theme strings and they will pop up in there somewhere ready to be translated.
    Post edited by Air on
  • AirAir
    Posts: 10,970
    Great! That means that I have to rethink case of WPML and don't use our functions. We use them only to divide front-end translations from backend, cause I don't know other way to meke Poedit find proper strings. Anyway I will search and read how can I do it better, so there still can be divisions between these two groups.

    I can also make on big file, that will contain 900 strings, from which 100 is for front-end. For WPML it should be OK, but if someone want to translate without WPML then it will be issue.

    Do you have any thought about it?

    With regards.
  • Posts: 47
    To be honoust, I am not very comfortable with this translating matter. For starters I'm not even sure what the difference is between front-end and back-end translations. Is front-end all the strings that website visitor see and back-end all the strings in the Wordpress (wp-admin) environment?
    Point is that changing the word "ALL" in Poedit didn't seem to have any effect. The strings "Site content loading. Please wait!" and "Hide page preloader" did not even show up in Poedit. I am now starting to think that the word "ALL" that did show up in Poedit was related to something else then the filter. That would explain why translating it through Poedit did not have any effect on the filter.
    Sorry, I don't have any well thought thru idea's about how to code this better. I am in the position where our customer wanted to spend some money on WPML but I can imagine not everybody wanting to spend that money. So I think the theme should be able to handle both techniques.
    Thanks for putting me on the right track, Air! At least my translation problems have been solved :-)
  • AirAir
    Posts: 10,970
    Thanks for your insight into this. I think we share view here:-) I will search for best solution to this issue, so it would behave better in future!

    With regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!