Skip to:
Content
Pages
Categories
Search
Top
Bottom

Japanese Translation Ready and some Customization for 2.7.1

  • Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    As I reported the “Reviews”, I have used the plugin for some of these days.
    In order for Japanese buddypress users to use this plugin, I have made Japanese Translation.

    On the way of making translation, along with verifying the plugin, I have found the following points:

    1: Though the plugin is ready-for-translation style, not all of the messages and items can be translated.
    =>
    I have altered whole plugin scripts to reflect each country langage, if users provide their own language files.

    2: There is no directories/folders to save language files.
    =>
    I have make “languages” directory/folder in the plugin directory/folder.

    3: There is no pot file for making language files.
    =>
    I have made “buddypress-group-email-subscription.pot” file and place it into the above-mentioned “languages” directory/folder.
    Note that though each line has a comment showing where the message is written, the line number might be wrong because I altered some scripts, see below, to help the plugin apparently work as it is wanted.

    4: Japanese Translation files, namely buddypress-group-email-subscription.po and buddypress-group-email-subscription.mo, are placed in the “languages” directory/folder.

    5: At the Admin Panel, within the “BuddyPress” filed, the time and day are displayed in UTC format.
    This happens because WordPress ignores “date_default_timezone_set” in php.ini and set to UTC as default in the “wp-settings.php” file.
    =>
    For this reason, I added “date_default_timezone_set” in the plugin’s bp-activity-subscription-digest.php file, which is now set “Asia/Tokyo” as default.

    Note that “date(‘l’) always return day’s name in English, thus I changed the way of displaying day. Now the day is displayed in each country language if you provide translation in the “languages” folder/directory.

    6: Becase the digest (HTML) mail is fixed to “iso-8859-1″, users can not read it if it is written in languages other than English.
    This is because the plugin doesn’t convey CharSet to phpmailer, though part of the setting is written in bp-activity-subscription-digest.php,
    =>
    Looing Into bp-activity-subscription-digest.php, you will find the setting `”$charset =?get_bloginfo( ‘charset’ );”`, however, this “$charset” is not conveyed to phpmailer. Thus I added the following:
    `$phpmailer->CharSet = apply_filters( ‘wp_mail_charset’, $charset );`
    Now that almost all WordPress and BuddyPress are set up with UTF-8, this can be changed to the following:
    `$phpmailer->CharSet = apply_filters( ‘wp_mail_charset’, ‘UTF-8′ );`
    When you change as the above, the setting of `”$charset = get_bloginfo( ‘charset’ );”` may be deleted.

    7: In the digest mail, the time and day of the activity is fixed to GMT format.
    This is because the plugin uses “date_recorded” which is provided by “function bp_core_current_time in “bp-core.php”, located in buddypress plugin folder/directory, and this function fixes time zone to GMT.
    =>
    In order to read the correct “local” time and day, I altered part of “bp-activity-subscription-digest.php” as following:
    — Delete –
    `$timestamp = strtotime( $item->date_recorded );`

    — Add –
    `/* Because BuddyPress core set gmt = true, timezone must be added */
    $timestamp = strtotime( $item->date_recorded ) +date(‘Z’);`

    Though I still am testing the plugin with WP 3.0.1 and BP 1.2.6, I will be very much glad if my altered package is helpful for the plugin furture development.

    Anyone who wants my customized package, please download from the following:
    http://staff.blog.bng.net/downloads/buddypress-group-email-subscription-2.7.1.1.zip

    Please note that the package is named as 2.7.1.1, since I made such a big correction to 2.7.1. The original plugin’s version is 2.7.1 up to date, and there is no version number of 2.7.1.1 as the original plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    I have just found a problem existing in the original plugin: that is when you select “Sunday” for weekly digest at the admin panel within “BuddyPress”, the setting is forced to change to “Friday”.

    This seems to be because of:
    ‘if ( !$ass_weekly_digest = get_option( ‘ass_weekly_digest’ ) )
    $ass_weekly_digest = 5; // friday’
    Perhaps as Sunday’s value is “0”.
    =>
    I have changed it as following and just made a 2.7.1.2

    ‘if ( !$ass_weekly_digest = get_option( ‘ass_weekly_digest’ ) )
    // $ass_weekly_digest = 5; // friday
    $ass_weekly_digest = 0; // sunday’

    Available at:

    http://staff.blog.bng.net/downloads/buddypress-group-email-subscription-2.7.1.2.zip

    Avatar of lovesaif
    lovesaif
    Participant

    @lovesaif

    Hi
    chestnut_jp , thnx for the customization , i m using your modified plugin with Urdu language.
    the orignal plugin should also be updated according to these changes

    Avatar of lovesaif
    lovesaif
    Participant

    @lovesaif

    site->groups->
    navigation of group
    the tab “Email Options”
    is not translated , and not included in the pot file

    Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    @lovesaif,

    Sorry for this late reply.
    Thank you for your testing my customized version.
    The lack of sentence in POT file should be reviewed by me, and I will open updated version. Please give me some time as I am being busy some of these days.

    Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    @lovesaif,
    Maybe you are using my customized 2.7.1 version?
    Please use:
    http://staff.blog.bng.net/downloads/buddypress-group-email-subscription-2.7.3.zip
    Perhaps “Email Options” are already ready-for-translation.

    Avatar of Dwenaus
    Dwenaus
    Participant

    @dwenaus

    @chestnut_jp sorry it took so long to get around to incorporating your changes. Your changes are perfect – thank you for making them! I’ve added a thanks to you in the readme file. the new version based on your work will be out in a few hours. 2.7.5

    @lovesaif send me your translation file so I can include it.

    Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    @dwenaus
    Thank you for takling your precious time to verify my changes.
    I just found that my changes affetct activity time display.

    Please use the following which I still am testing though.

    In “bp-activity-subscription-digest.php”,

    Line 1:
    [ Previous ]
    `
    /**
    * Change this to reflect local time as WordPress has changed it to UTC as default.
    * You can comment out the following if you accept time zone as UTC.
    * The following default setting is for Japanese.
    **/
    date_default_timezone_set(‘Asia/Tokyo’);
    `

    =>

    [ Delete ]
    `
    /**
    * Change this to reflect local time as WordPress has changed it to UTC as default.
    * You can comment out the following if you accept time zone as UTC.
    * The following default setting is for Japanese.
    **/
    //date_default_timezone_set(‘Asia/Tokyo’);
    `

    Line 252:
    [ Previous ]
    `
    /* Because BuddyPress core set gmt = true, timezone must be added */
    $timestamp = strtotime( $item->date_recorded ) +date(‘Z’);
    `

    =>
    [ Changes ]
    `
    /* Because BuddyPress core set gmt = true, timezone must be added */
    if ($item) {
    date_default_timezone_set(‘Asia/Tokyo’);
    $timestamp = strtotime( $item->date_recorded ) +date(‘Z’);
    }
    `

    In “bp-activity-subscription-functions.php”,

    Line 1169
    [ Previous ]
    `


    `

    =>
    [ Changes ]
    `


    `

    These deletes and changes are essential, as they seem to affect other plugins and WP/BP settings, especially activity time display. For example, the activity time shows “sometime ago” instead of “one second ago”, “10 minutes ago” or so.

    As I mentioned above, these new changes are not yet verified but I think they work.

    I add the following for the digest review:

    In “function ass_digest_fire_test()”, line 163 or so, in “bp-activity-subscription-functions.php”,

    [ Original ]
    `
    function ass_digest_fire_test() {
    if ( $_GET && is_site_admin() ){
    `

    [ Adds ]
    `
    function ass_digest_fire_test() {
    if ( $_GET && is_site_admin() ){
    date_default_timezone_set(‘Asia/Tokyo’);
    echo “

    “;
    $sched = wp_next_scheduled( ‘ass_digest_event’ );
    echo “Scheduled: ” . date( ‘h:i’, $sched );
    $until = ( (int)$sched – time() ) / ( 60 * 60 );
    echo ” Until: ” . $until . ” hours”;
    echo “

    “;
    `

    As a result, Administrator can see how long it takes to send the digest.

    I hope this time the plugin works much better.

    Note that users must change “Asia/Tokyo” to their location.

    Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    @dwenaus

    I found that the latest version is now available.
    Since the new changes are not yet reflected, I will make a zip like before incorporating new changes.
    So please wait, as it is 9 am in Japan and I am still sleepless. I must go to bed ASAP!!

    Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    I would like to continue discuss, so I posted the new topic:
    http://buddypress.org/community/groups/buddypress-group-email-subscription/forum/topic/regarding-2-7-5/

    Please see and continue discussion at the new topic.

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

You must be logged in to reply to this topic.