ສະບັບ 0.7.3 – ສະຫນັບສະຫນູນ Shortcodes


ມື້ນີ້ພວກເຮົາໄດ້ປ່ອຍອອກມາເມື່ອສະບັບ 0.7.3 ເຊິ່ງເພີ້ມການຊ່ວຍເຫລືອແກ່ shortcodes ພາຍໃນ posts wordpress, ນີ້ສາມາດນໍາໃຊ້ເພື່ອເຮັດບາງ stuff neat ແລະສໍາລັບການທີ່ພວກເຮົາໄດ້ສ້າງວິດີໂອຂ້າງເທິງ, ສະນັ້ນຖ້າຫາກທ່ານມີຫ້ານາທີບໍ່ເສຍຄ່າແລະບໍ່ມີຫຍັງທີ່ດີກວ່າໃຫ້ເຮັດແນວໃດ, ພຽງແຕ່ເບິ່ງວິດີໂອໄດ້. ຖ້າບໍ່ດັ່ງນັ້ນພວກເຮົາຈະ recommand ອ່ານເອກະສານທີ່ສຸດ http://trac.transposh.org/wiki/ShortCodes.

ບາງຫຼາຍແກ້ໄຂ bug ໄດ້ຖືກເພີ່ມກັບລຸ້ນນີ້, ສ່ວນໃຫຍ່ແມ່ນການຫຼຸດຜ່ອນການໂຫຼດໄດ້ (ແລະຊໍ້າຊ້ອນ) ບອທ໌ທີ່ອາດສ້າງຢູ່ຫນ້າດັດແກ້, ແລະລົບລ້າງໄຟລ໌ນົດໄລຍະເວ unneeded ສໍາລັບບອທ໌.

ມ່ວນຊື່ນສະບັບນີ້!

, , , , ,

  1. #1 ໂດຍ Meuwissen Fabrice ສຸດ ມີນາ 25, 2011 - 11:33 pm

    After a load of problems with WPML, I have discovered transposh, and I love it. I use it for http://www.obviousidea.com , a few bugs are remaining in the widget, and some options are missing ( like the ability to reset the translation for 1 language only )
    it is very nice to see an update, even if we developped some specific shortcode ( to be able to show a different youtube link and video depending on the current language ), so just keep the good work.

    • #2 ໂດຍ ofer ສຸດ ມີນາ 27, 2011 - 11:19 ຢູ່ໃນ

      Hello Fabrice,

      Please suggest any feature you want and share your bugs with us in our trac site (http://trac.transposh.org)

      I didn’t get the problem with the shortcode, do they collide in some way?

  2. #3 ໂດຍ jay ສຸດ ມີນາ 26, 2011 - 8:00 pm

    Totally retarded to have a translator break down a paragraph by “,”‘s. If the other language uses a different sentence structure then things are messed up. I need a translation tool that lets me put in different language text from a real translator, I like the overall way it translates and that Google can be a fall back but I need a way to cut and paste whole paragraphs or pages in different languages not a wise-ass one that assumes every language will have the same commas and punctuation!

    • #4 ໂດຍ ofer ສຸດ ມີນາ 27, 2011 - 11:20 ຢູ່ໃນ

      Retarded are us, wanted to thank you for this useful comment,
      you can change the parser.php so that breaking would be done in a way more suitable to you. Feel free to share your code with us later.

      • #5 ໂດຍ Meuwissen Fabrice ສຸດ ມີນາ 27, 2011 - 11:23 ຢູ່ໃນ

        good to know, indeed, it is sometimes not very convenient to have the parser of the ‘,’
        maybe it would be a nice option to add in the settings

        • #6 ໂດຍ ຂອບ ສຸດ ເມສາ 19, 2011 - 11:32 ຢູ່ໃນ

          There is also a problem with transposh breaking up translations on the point in numbers like 2.0 – makes a nonsense of anything using phrase ‘web 2.0′ ແລະອື່ນໆ – could you distinguish a decimal number from a full stop by its context?

          • #7 ໂດຍ ofer ສຸດ ເມສາ 19, 2011 - 4:28 pm

            This will only happen if the dot is written in html escaped code. 2.0 is safe enough, the break happens on numbers

  3. #8 ໂດຍ Tamas Gal ສຸດ ມີນາ 31, 2011 - 11:00 pm

    Just made a simple extension to know the current language in a post or page. You can use a [ຍາວ] shortcode for this.

    You have to add this short snippet to your themesfunction.php.


    //Transposh integration
    function get_curr_transposh_lang() {
    $lang = transposh_utils::get_language_from_url($_SERVER['REQUEST_URI'], get_option(‘home’) );
    ຖ້າຫາກວ່າ ($ຍາວ != “”) $lang .= “/”;
    return $lang;
    }

    add_shortcode(‘lang’, ‘get_curr_transposh_lang’);

    Transposh is a great plugin! Credits to the authors!

  4. #9 ໂດຍ techtte ສຸດ ເມສາ 21, 2011 - 5:05 pm

    Is there any way when you are on a translated page, when clicking a link that sends to another page in my site, instead of sending you to the translated version of the page, to send you to the original. This would really help me. Thank you in advance.
    -techtte

    • #10 ໂດຍ ofer ສຸດ ເມສາ 21, 2011 - 8:17 pm

      ແມ່ນ, wrap the link with the no_translate class

      • #11 ໂດຍ techtte ສຸດ ເມສາ 23, 2011 - 12:47 pm

        Is there a way to select this in Transposh and make this happen all the time. It would be a lot easier. ຂໍຂອບໃຈ.

        • #12 ໂດຍ ofer ສຸດ ເມສາ 24, 2011 - 11:39 pm

          ບໍ່ມີ, as this would probably not be expected behavior for most users, you can however make changes to the url rewriting function (or disable it in the parser)

  5. #13 ໂດຍ Bart ສຸດ ເມສາ 23, 2011 - 3:43 pm

    How do I make Transposh ignore this character: ‘
    I made it work forbut can find a line of code to prevent it form breaking a paragraph whenappears.

    • #14 ໂດຍ ofer ສຸດ ເມສາ 24, 2011 - 11:40 pm

      Check that that character does not appear as a html symbol in your page source

  6. #15 ໂດຍ Elda ສຸດ ເມສາ 26, 2011 - 6:15 pm

    If I have a static page as my home page with no widgets enabled on it, how can i still offer my visitors the option to choose their preferred language?

    • #16 ໂດຍ ofer ສຸດ ເມສາ 26, 2011 - 11:36 pm

      Just add static links to the translated pages on this page

  7. #17 ໂດຍ Manfred ສຸດ ເມສາ 28, 2011 - 1:09 ຢູ່ໃນ

    Hi, this morning I installed Transposh, and I am very impressed. There is just one problem: The automatic translation is very slooooooow. There are around 1000 posts and 7000 comments in my blog. Just to translate them all from German to English will probably take until Christmas. Isn’t there any way to make it faster?

    • #18 ໂດຍ ofer ສຸດ ເມສາ 28, 2011 - 11:40 ຢູ່ໃນ

      ສະບາຍດີມີ,

      It is slow because you probably don’t want to overuse the translation service which might result in temporary or permanent interruptions of service, you can always hasten things up by going to pages on your site in the new language as a user, you will see that translation happens quite fast.

      ໂຊກດີ

      • #19 ໂດຍ Manfred ສຸດ ເມສາ 28, 2011 - 4:59 pm

        ດີ, I understandthough I hoped to make the entire content of my blog available to the English speaking public (and to the search engines ;-) ). OK, nevertheless, your plugin is the best translation tool I know.

        There is another problem: I’ve just tried to update to WordPress 3.1.2., and this failed. The system tells me it couldn’t copy the file /wp-content/languages/de_DE.mo. As I saw, this file is set 644, and the system refuses changing it. Is it possible that this problem has to do with the Transposh plugin? (For it is the first time ever an update fails; the problem concerns a language file, and the only major change since the last update was that I installed Transposh.)

        • #20 ໂດຍ ofer ສຸດ ເມສາ 28, 2011 - 5:31 pm

          ສະບາຍດີ,

          Can’t see any relation, and I have upgraded several sites, ແນວໃດກໍ່ຕາມ – you can always remove transposh, update again and reinstall it.

          If you find anything there that is related to Transposh directly I’ll be happy to hear that.

          ໂຊກດີ

  8. #21 ໂດຍ Manfred ສຸດ ເມສາ 28, 2011 - 6:11 pm

    Thank you for the quick response. If I do as you say, do I lose the translations already made (some of them have already been edited)?

    • #22 ໂດຍ ofer ສຸດ ເມສາ 28, 2011 - 7:07 pm

      The translations are stored in a table which is not removed by uninstalling, ແນວໃດກໍ່ຕາມ – backing up is always a good policy

  9. #23 ໂດຍ Alain ສຸດ ເດືອນພຶດສະພາ 2, 2011 - 4:37 pm

    The shortcodes are are a fantastic addion to the plugin, but I am seeing two issues with them:

    1) They don’t seem to work in excerpts. My auto-generated excerpts are blank, and the manually created ones do not abide the shortcode rules (I.E. all the languages are displayed regardless ofonly”/”not_in”)

    2) There appears to be an issue when you have a rule that relates to the default language. So for example, my default is English, plus I have Italian and French.
    [tp not_in="ລັ່ງ"]ສະບາຍດີ[/tp] [tp lang="ລັ່ງ" only="ແລະ"]Bonjour[/tp]
    This works as expected in French (“Bonjour”) and Italian (“ສະບາຍດີ”), but in English (ພາສາໃນຕອນຕົ້ນ), I get both “ສະບາຍດີ” ແລະ “Bonjourdisplayed

    I am on WP 3.1.2.

    I have tried multiple themes, de-acticating/re-activating.

    Please advise.

    ຂໍຂອບໃຈ

    • #24 ໂດຍ ofer ສຸດ ເດືອນພຶດສະພາ 9, 2011 - 12:16 ຢູ່ໃນ

      Hello Alain,

      Regarding number 1, could be, will have to check this,

      Number 2, do you have translate default language enabled?

      Sorry about the late response.

  10. #25 ໂດຍ Charles ສຸດ ເດືອນພຶດສະພາ 18, 2011 - 9:39 ຢູ່ໃນ

    Is there any chance you can show us how to change the parser so that it does not include commas (,) into its strings ?

    This is really the only issue i’m facing with this great plugin. This would trigger a donation right away (not that i’m trying to bribe anyoneBut then why not as it’s really crucial for my website !).

    TIA

    Charles

    • #26 ໂດຍ ofer ສຸດ ເດືອນພຶດສະພາ 18, 2011 - 9:53 ຢູ່ໃນ

      ສະບາຍດີ, just remove the comma from the last line of the function is_sentence_breaker in parser.php. Remember that it might cause old translations to be invalidated. ຍັງ, read my opinion on donations before rushing to donate (not that I am not to be bribed)

      ໂຊກດີ

      • #27 ໂດຍ Charles ສຸດ ເດືອນພຶດສະພາ 23, 2011 - 9:44 ຢູ່ໃນ

        The parser tweak worked like a charm. IT makes it a lot easier to do manual translations of text strings.

        I just have one last question to make the plugin work exactly like i want. Is there a way to display different images in different languages ?

        In french, there’s a saying : “chaque travail mérite salaire”. I’ll let you use this great plugin to have it translated ;)

        • #28 ໂດຍ ofer ສຸດ ເດືອນພຶດສະພາ 23, 2011 - 11:44 pm

          Hi,

          When there is a will, there is away, you can always generate the link to the picture with code and use the transposh_plugin current language in this generation, many have tried, most of them successfully.

          • #29 ໂດຍ Charles ສຸດ ເດືອນພຶດສະພາ 25, 2011 - 3:39 pm

            generate a link to the picture with code” ?

            I’m sorry but i can’t find a way to understand this properly. Arent all links to images in code ?

          • #30 ໂດຍ ofer ສຸດ ເດືອນພຶດສະພາ 25, 2011 - 10:51 pm

            I meant PHP code, when you make sure you output the lang as a part of the image name, most such changes are normally done at the template level, so instead of img src=somethingyou let the something be something + the current language

            ໂຊກດີ

  11. #31 ໂດຍ Manfred ສຸດ ເດືອນພຶດສະພາ 18, 2011 - 7:52 pm

    Three suggestions:

    It would be helpful if one could choose whether to edit parts of a sentence (as is the case now), or a sentence, or a whole paragraph. At present, it is not possible to change the order of sentences or parts of it. As different languages often differ in the usual syntax, this is often necessary, or at least helpful, and leads to more elegant results.

    I would like to edit the puctuation marks between the parts zu be edited.

    Try to include the PROMT Translator. For certain language pairs (f.e German-English, German-French, German-Russian, Promt is much stronger than Bing or Google.

    • #32 ໂດຍ ofer ສຸດ ເດືອນພຶດສະພາ 24, 2011 - 12:34 ຢູ່ໃນ

      Hi,

      Agree to 1 ແລະ 2, this is work in progress and is proving quite hard to achieve, will be done in the future
      3. the PROMT translator does not have a usable ajax interface, although work by proxy is possible, I am not sure how useful it will be because of the limited extent of the language pair selection, if more people will require this, we’ll put more focus on that.

      thanks for the suggestions, will be happy to hear more

  12. #33 ໂດຍ bob33 ສຸດ ເດືອນມິຖຸນາ 3, 2011 - 5:04 pm

    Ofer
    like another version 0,74 work like charm
    Thx for this best plugin

  13. #34 ໂດຍ Cristina ສຸດ ເດືອນມິຖຸນາ 15, 2011 - 12:54 pm

    ສະບາຍດີ,
    bellissimo plugin!
    Però ho un problema
    come fare per:
    -NON tradurre le due CATEGORIE principali del sito
    -NON tradurre i titoli dei POST
    Grazie per la risposta.

    • #35 ໂດຍ ofer ສຸດ ເດືອນມິຖຸນາ 15, 2011 - 1:09 pm

      ສະບາຍດີ,

      If you don’t want post titles translated, just wrap the the_title function in the template with a no_translate class.

      regarding categories, you can use the appropriate shortcode on posts in the category.

      • #36 ໂດຍ Cristina ສຸດ ເດືອນມິຖຸນາ 15, 2011 - 1:30 pm

        ຂໍຂອບໃຈ, per la velocità!
        e scusami, ma sono autodidatta (cioè non ci capisco nulla!!)
        però succede che:
        Se avvolgo il titolo così
        [tp no_translate="ແລະ"]titolo post[/tp]
        poi rimane tutta la scritta nell’elenco dei post pubblicati (non mi piace!)

        Per la categoria se faccio questo
        [tp no_translate="ແລະ"]nome categoria[/tp]
        rimane tutta la scritta come link!
        Dove sbaglio?

        • #37 ໂດຍ Cristina ສຸດ ເດືອນມິຖຸນາ 15, 2011 - 3:35 pm

          PS
          uso WordPress 3.0.5.
          e Transposh Versione 0.7.4…..

  14. #38 ໂດຍ Cristina ສຸດ ເດືອນມິຖຸນາ 16, 2011 - 11:24 ຢູ່ໃນ

    ສະບາຍດີ,
    scusa se insisto: ma ho provato in tutti i modi!!!
    Non riesco proprio a evitare la traduzione dei:
    - titoli dei posts
    - titoli dei widgets
    - categorie principali
    Ho installato la versione 0.7.3 per usare gli shortcode, ma probabilmente sbaglio ad inserirli.
    Ho anche provato a ripetere passo passo quello che fai nel video: ma a me succede che il titolo del post viene comunque tradotto.
    Aiuto!
    Grazie per la disponibilità.
    Cristina

  15. #39 ໂດຍ bob33 ສຸດ ເດືອນມິຖຸນາ 18, 2011 - 3:09 pm

    try titles of posts

    • #40 ໂດຍ bob33 ສຸດ ເດືອນມິຖຸນາ 18, 2011 - 3:13 pm

      span class= no_translate ||| Titles||||| span

      • #41 ໂດຍ Cristina ສຸດ ເດືອນມິຖຸນາ 21, 2011 - 11:04 pm

        Ciao Bob, grazie per il tuo interesse ma anche con il tuo code non succede nulla:
        Per esempio se lo immetto nel titolo del widget, risulta visibile tutta la scritta del code e inoltre il titolo viene comunque tradotto.
        Gli shortcode funzionano solo all’interno dei posts!
        Grazie per la disponiblità

        • #42 ໂດຍ ofer ສຸດ ເດືອນມິຖຸນາ 22, 2011 - 11:52 pm

          Hello Cristina,

          The shortcode will not work on the post title (a wordpress limitation), your best bet is to change the template code and wrap titles in no_translate. you can also insert said spans into titles by manually manipulating the database.

          I would like to know what is the use case for this exactly to see if changes are required to the design in some way.

          ໂຊກດີ

  16. #43 ໂດຍ Greg ສຸດ ເດືອນມິຖຸນາ 26, 2011 - 11:43 pm

    I am trying to display a different youtube video in a post based on the language being viewed.

    [tp lang="es" only="ແລະ"]The Spanish See This Video[/tp]
    [tp lang="de" only="ແລະ"]The Germans See This Video[/tp]
    [tp not_in="es,de" no_translate="ແລະ"]Everyone else see’s the default Video[/tp]

    The almost works but it seems like a bug with the first two lines. Those lines are also always displayed when the default language is being viewed, even if the default language is not Spanish or German. It works correctly once the user goes to different languages but at least according to the documentation those first two lines should only be see by users viewing Spanish and German?? Suggestions? Ver .74

    • #44 ໂດຍ ofer ສຸດ ກໍລະກົດ 9, 2011 - 11:40 ຢູ່ໃນ

      Hello Greg,

      You need to enable translation of the default language, otherwise the page is not processed by the parser, causing the effect you see

      • #45 ໂດຍ Meuwissen Fabrice ສຸດ ກໍລະກົດ 9, 2011 - 11:34 pm

        I confirm the same problem, but enabling the translation of the default language, let anyone be able to translate the english, and from my experience it was a nightmare as some translator translated the english ( main language ) to their own language.
        why it behaves like this ? any workaround ?

        • #46 ໂດຍ ofer ສຸດ ກໍລະກົດ 10, 2011 - 12:09 ຢູ່ໃນ

          Hi,

          Enabling translate of default language should not enable translation of the main language, rather parts that are differently marked, you can see on this site that it is enabled, and yet, you can probably not translate much on the default language.

          it is good for:
          translating comments on default language
          multiple language posts
          different content on this language
          some other neat stuff

          ແນວໃດກໍ່ຕາມ, it is not enabled by default to save resources and avoid unneeded parsing.

          A rare case in which the problem you mention might happen is when one uses a template which marks the default language as different than what it really is.

          • #47 ໂດຍ Meuwissen Fabrice ສຸດ ກໍລະກົດ 10, 2011 - 12:21 ຢູ່ໃນ

            I found a workaround by writing some line of code in php :

            $tp_lang = $GLOBALS[my_transposh_plugin]->target_language;
            extract(shortcode_atts(ຂບວນ(‘arg’ => ‘default’), $atts));
            ຖ້າຫາກວ່າ (isset($atts['only'])) {
            $only = explode(',, $atts['only']);
            ຖ້າຫາກວ່າ (in_array($tp_lang, $only)) {
            return do_shortcode($content);
            }
            } else if (isset($atts['not'])) {
            $not = explode(',, $atts['not']);
            ຖ້າຫາກວ່າ (!in_array($tp_lang, $not)) {
            return do_shortcode($content);
            }
            }

            don’t ask me to comment, I didn’t write it :)

  17. #48 ໂດຍ bob33 ສຸດ ເດືອນມິຖຸນາ 30, 2011 - 4:26 pm

    THx Ofer I can’t really explain very well to Cristina
    she need to operate the modification directly in the source code template
    also i cannot post the real code due the limit comment form
    sorry for that

    • #49 ໂດຍ ofer ສຸດ ເດືອນມິຖຸນາ 30, 2011 - 11:53 pm

      Hi,

      Send me the code and I will pass it to her, just contact using the contact form above and I’ll get back to you, thanks for trying to assist there ;)

    • #50 ໂດຍ Cristina ສຸດ ກໍລະກົດ 5, 2011 - 7:22 ຢູ່ໃນ

      Grazie Bob! aspetto il codice ;-)

  18. #51 ໂດຍ rainer ສຸດ ຕຸລາ 5, 2011 - 1:54 pm

    Helo ofer,

    your best bet is to change the template code and wrap titles in no_translate.

    How do I do this? I have to exclude one whole category from the translation. I would like to do this in the template and not in every single post.

    ກ່ຽວທີ່ດີທີ່ສຸດ
    Rainer

    • #52 ໂດຍ ofer ສຸດ ຕຸລາ 8, 2011 - 12:10 ຢູ່ໃນ

      Hi,

      You need to add a code to the template checking for a certain category, this is not something I can provide from the back of my head, but it will be something like if cat =="something" echo class="no_translate" in the correct place in accordance to your theme

      ໂຊກດີ

      • #53 ໂດຍ rainer ສຸດ ຕຸລາ 10, 2011 - 10:42 ຢູ່ໃນ

        ຂໍຂອບໃຈທີ່ທ່ານ ofer,
        I didn’t realise I just need a different css-class. With this knowledge it is quite easy for me to rig the template.

        Thank you very much again!

  19. #54 ໂດຍ JD ສຸດ ເດືອນພະຈິກ 18, 2011 - 9:32 pm

    I have around 25 custom sidebars on my site (for different categories) and need multiple widgets, or a short code, to display your widget in each custom sidebar.Will you have multi-widget support anytime soon?

    • #55 ໂດຍ ofer ສຸດ ເດືອນພະຈິກ 29, 2011 - 12:31 ຢູ່ໃນ

      This is now supported in 0.8.0

(ຈະບໍ່ໄດ້ຮັບການຈັດພີມມາ)


*