Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Scketer,

    1.- You will need a po files editor: https://poedit.net/
    2.- Cretate a new .po file based on dpa.po you will find in the achievements plugin folder wp-content/plugins/achievements/dpa.po
    3.- Saved your new file as dpa-pt_PT.po and upload as child translation in folder wp-content/languages/plugins/dpa-pt_PT.po

    Regards

    Thread Starter scketer

    (@scketer)

    Thanks for the answer.
    Now I can translate almost everything, except the text that is shown in the pop-up label that comes with the unlock achievement.
    For instance: “achievement unlock. You unlocked xxx achievement”.

    I checked my po and I translated everything. Can it be an update that is causing this?
    Thanks in advance.

    Hi scketer,

    Yes, this is a Known bug.
    To solve this you have to modify directly the file: feedback-notifications.php. You will find it inside the Achievements plugin folder: wp-content/plugins/achievements/feedback-notifications.php

    1.- Create a new folder inside your active theme folder and name it “achievements”. Like this: wp-content/themes/your-active-theme/achievements/

    2.- Copy and paste the original file feedback-notifications.php inside the folder. Like this: wp-content/themes/your-active-theme/achievements/feedback-notifications.php

    3.- Modify this lines:
    <h1><?php _e( ‘Achievement Unlocked’, ‘dpa’ ); ?></h1>
    and
    <?php
    ( “Hey, you’ve unlocked the “{{ data.title }}” achievement. Congratulations!”, ‘dpa’ );
    ?>

    Regards

    Thread Starter scketer

    (@scketer)

    Hi there.
    Thanks for the answer. I replaced the code in the .php with the lines you mentioned, but unfortunately it didn’t work. Am I doing something wrong?

    <?php
    /**
    * Notifications template part; usually used for the “you’ve unlocked an achievement!” pop-ups.
    *
    * @package Achievements
    * @since Achievements (3.5)
    * @subpackage ThemeCompatibility
    */

    // Exit if accessed directly
    if ( ! defined( ‘ABSPATH’ ) ) exit;
    ?>

    <script type=”text/html” id=”tmpl-achievements-wrapper”>
    <ul aria-live=”polite” id=”dpa-toaster” role=”status” style=”display: none”>
    <h1><?php _e( ‘Achievement Unlocked’, ‘dpa’ ); ?></h1>

    </script>

    <script type=”text/html” id=”tmpl-achievements-item”>
    <li class=”dpa-toast” id=”dpa-toast-id-{{ data.ID }}”>
    <# if (data.image_url) { #>
    <img class=”attachment-medium dpa-toast-image” src=”{{ data.image_url }}” style=”width: {{ data.image_width }}px” />
    <# } #>

    <h2>{{ data.title }}</h2>
    <p>
    <?php
    ( “Hey, you’ve unlocked the a€?{{ data.title }}a€? achievement. Congratulations!”, ‘dpa’ );
    ?>
    </p>

    <p>“><?php _e( ‘See your other achievements’, ‘dpa’ ); ?></p>

    </script>

    Hi scketer,

    Not sure if I understood what you did?
    You only have to change the text inside <?php _e(‘ ‘);?>

    For example:
    <h1><?php _e( ‘Achievement Unlocked’, ‘dpa’ ); ?></h1>
    to
    <h1><?php _e( ‘TEXT YOU WANT’, ‘dpa’ ); ?></h1>

    and for the second line of popup:

    <?php
    // translators: “{{ data.title }}” will be replaced with the name of the achievement; leave this bit exactly as is.
    _e( “Hey, you’ve unlocked the “{{ data.title }}” achievement. Congratulations!”, ‘dpa’ );
    ?>

    to
    <?php
    // translators: “{{ data.title }}” will be replaced with the name of the achievement; leave this bit exactly as is.
    _e( “TEXT YOU WANT “{{ data.title }}” TEXT YOU WANT!”, ‘dpa’ );
    ?>

    Not modify nothing else of the original file.
    Sorry if I have confused you.
    regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Translations’ is closed to new replies.