• I created new zodiacpress-pl_PL.mo file with my Polish translation but the planets and aspects names are displayed still in English in the report and in the admin section. (All other phrases work properly except two other cases but I changed the source file to correct that problem.)

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter anope

    (@anope)

    I have replaced English terms in source file and now it works. It’s not correct I know but it works.

    net

    (@krstarica)

    Yes, there are hard-coded English phrases.

    in template.php:

    echo apply_filters( 'zp_unknown_birth_time_checkbox', 'If birth time is unknown, check this box.', 'zodiacpress' );

    should be changed to:

    echo apply_filters( 'zp_unknown_birth_time_checkbox', __('If birth time is unknown, check this box.', 'zodiacpress' ));

    in includes/class-zp-birth-report.php:

    $planet['label']

    should be changed to:

    __($planet['label'], 'zodiacpress' )

    in includes/class-zp-birth-report.php:

    ' in '

    should be changed to:

    __(' in ', 'zodiacpress' )

    Probably there are more.

    Thread Starter anope

    (@anope)

    There are some more, thanks for the tips

    vladowsky

    (@vladowsky)

    I had same problem and above solution works fine… however for aspects are missing so here they are

    $asp['label']
    should be changed to:
    __($asp['label'], 'zodiacpress' )

    $p_1['label']
    should be changed to:
    __($p_1['label'], 'zodiacpress' )

    $p_2['label']
    should be changed to:
    __($p_2['label'], 'zodiacpress' )

    Isabel, would you be so kind to fix hard-coded phrases. Some examples are shown in this thread. Many thanks.

    Plugin Author isabel104

    (@isabel104)

    Yes, the recent update (1.5.7) fixes the first one you mentioned (a typo). And the ' in '. Thank you for listing those.

    However, the other examples with variables, such as $planet[‘label’], $asp[‘label’], $p_1[‘label’], and $p_2[‘label’] are not hard-coded. Those are already translated strings. They’re translated before being used in this file.

    Please note: in WordPress, we cannot use variables in __() and other gettext functions. For example, this would be wrong:

    __($planet['label'], 'zodiacpress' )

    If the translation still doesn’t work after the latest plugin update, please let me know and I’ll be happy to investigate further. To be sure, please clear any browser cache and/or cache plugins after updating the plugin.

    I understand using variables in strings for translation is not recommended, but don’t see other way to do it. Since planet names are extracted from astro-functions.php, this should work anyway.

    Here are changes to apply in the code for version 1.5.7:

    $asp[‘label’]
    should be changed to:
    __($asp[‘label’], ‘zodiacpress’ )

    $p_1[‘label’]
    should be changed to:
    __($p_1[‘label’], ‘zodiacpress’ )

    $p_2[‘label’]
    should be changed to:
    __($p_2[‘label’], ‘zodiacpress’ )

    $planet[‘label’]
    should be changed to:
    __($planet[‘label’], ‘zodiacpress’ )

    Also there are bunch of unnecessary numbers in .pot file, for example:

    #: includes/time-functions.php:143
    msgid “1905”
    msgstr “”

    #: includes/time-functions.php:157
    msgid “8”
    msgstr “”

    #: includes/time-functions.php:178
    msgid “02”
    msgstr “”

    #: includes/time-functions.php:197
    msgid “77”
    msgstr “”

    net

    (@krstarica)

    Still having the same issue in version 1.8.1.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Planets and aspects names not translated in report’ is closed to new replies.