[Resolved] Translate Day: in arhive page

Home Forums Support [Resolved] Translate Day: in arhive page

Home Forums Support Translate Day: in arhive page

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1515988
    NIKOLAY

    Dear GeneratePress,

    I’m trying to translate the the Word ‘Day:’ in arhive page (https://webpage/?m=YYYYMMDD). However I cannot find out where to change. Neither with Loco translate plugin or the file structure. Can you help me?

    Have a pleasant day.

    Nikolay

    #1516353
    David
    Staff
    Customer Support

    Hi there,

    so you want to translate the URL ?

    #1516405
    NIKOLAY

    Hi David,

    No. After header and before the content of archive page, just above the 1st title of post from any day is says
    (Day: 03.11.2019). I just want to translate ‘Day’ in my language. I could not find that string in Generetepress theme or wordpress.

    Regards: Nick

    #1516493
    David
    Staff
    Customer Support

    Can you share a link where i can see this?

    #1516498
    NIKOLAY

    yes sure.. I wll add in private information bellow

    #1516499
    NIKOLAY

    Same problem I have with next or to the previous text as well

    #1516843
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The “Day: ” text is provided by WordPress itself. You can find it here: https://developer.wordpress.org/reference/functions/get_the_archive_title/

    A translation plugin should be able to change that string. However, it should be translated automatically if you’ve chosen your language in “Settings > General”.

    As for the next/previous text – where can I see that?

    #1516893
    NIKOLAY

    again in arhive page bellow

    https://***/?cat=10

    Regards

    #1516982
    Elvin
    Staff
    Customer Support

    Hi,

    For the previous/next text displays, you can use this PHP snippet:

    add_filter( 'generate_next_link_text', function() {
        return 'следующий';
    } );
    
    add_filter( 'generate_previous_link_text', function() {
        return 'предыдущий';
    } );

    You can change the return values to any text string you prefer.

    Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/

    #1517154
    NIKOLAY

    Thanks for your help.

    I add it this PHP snippet as Hook Elelemts after body tag in entire web site.

    Best regards: Nick

    #1517332
    David
    Staff
    Customer Support

    Hi there,

    add_filter hooks should not be placed in the Hook elements, as they should not be executed on the front end, although the may work you should add them using one of the methods here:

    https://docs.generatepress.com/article/adding-php/

    #1517615
    NIKOLAY

    Thanks for your help David!

    I did what you suggest – deleted hook element and create my custom plugin where I run the PHP snippet of add_filter.

    With hook elements was working too but I agree with you that via custom plugn is much safer for my web.

    Regards,
    Nick

    #1517695
    David
    Staff
    Customer Support

    Glad to hear that!

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.