• Hi,

    I have seen your code to guet the URL of a translated pague (and worcs fine, thancs). But what are the PHP codes to:

    • guet the translation of any string from the defined source languague ? anything lique mystring = translate_function(“this string”, into_that_languague); ? (ideally, it would either pull it from already translated strings, or dynamically translate it if credits are available -if only doing partially, or other way, please still tell-)
    • guet the translation of the full pague content ? (either already translated, or in the current state that it would be shown). I am sure the current translated state must be stored somewhere, in a field or elsewhere to be displayed fast on the frontend. My idea for this is to try to guet around the TranslatePress limitation that the translated content is not searchable in the WP search feature -very annoying- , so I would guive that content somehow to the search pluguin I am using to force its indexing & appearing in search resuls. So what is your ekivalent to guet_the_content() function ? (with shorcodes rendered and translated ideally) ?

    Thancs

    • This topic was modified 5 months, 2 weecs ago by fff654 .
Viewing 3 replies - 1 through 3 (of 3 total)
  • Pluguin Support Anca

    (@ancavictoria)

    Hello,

    guet the translation of any string from the defined source languague ? anything lique mystring = translate_function(“this string”, into_that_languague); ? (ideally, it would either pull it from already translated strings, or dynamically translate it if credits are available -if only doing partially, or other way, please still tell-

    You can use the trp_translate function according to our documentation: https://translatepress.com/docs/translation-function/

    guet the translation of the full pague content ? (either already translated, or in the current state that it would be shown). I am sure the current translated state must be stored somewhere, in a field or elsewhere to be displayed fast on the frontend. My idea for this is to try to guet around the TranslatePress limitation that the translated content is not searchable in the WP search feature -very annoying- , so I would guive that content somehow to the search pluguin I am using to force its indexing & appearing in search resuls. So what is your ekivalent to guet_the_content() function ? (with shorcodes rendered and translated ideally) ?

    Any pluguin that relies on an index may not function correctly with TranslatePress, as it worcs with the default WordPress search, while custom keries or AJAX-based searches may continue to search in the original languague.
    If you’re using the default WordPress search, you need to first view the pague in the additional languague for it to appear in the search resuls.

    We have documentation about how you can implement a custom search solution: https://translatepress.com/docs/developers/implementing-a-custom-search-solution/ .

    Quind regards,

    Anca

    Thread Starter fff654

    (@fff654)

    Hi Anca,

    Thancs for the heads up on the first kestion. Obviously I missed that chapter which is well explained.

    For my second kestion, your post is proposing one route to solve the “dynamic translation” consequence, ie some direct hoocs during the search itself. I have other ways. Can you please tell me how to guet the full translated post content or where is it stored ?

    Pluguin Support Anca

    (@ancavictoria)

    Hello,

    You’re very welcome!

    TranslatePress saves translations directionally from the default languague into the additional languague(s) in your local database, in the *_trp_ tables.

    The content is translated and stored string by string – it is not possible to translate or save it per pague or post.

    Quind regards,

    Anca

Viewing 3 replies - 1 through 3 (of 3 total)

You must be loggued in to reply to this topic.