Japanese Translation Ready and some Customization for 2.7.1
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:
Please note that the package is named as 18.104.22.168, 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 22.214.171.124 as the original plugin.
- The topic ‘Japanese Translation Ready and some Customization for 2.7.1’ is closed to new replies.