Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change source code to use translated versions of strings

  • Loading branch information...
commit 4cabdf878c83d2d5a0f3e769bc5367201759b74f 1 parent 2873447
@brianking brianking authored
Showing with 28 additions and 19 deletions.
  1. +28 −19 components/facebook.js
View
47 components/facebook.js
@@ -721,12 +721,12 @@ facebookService.prototype = {
var result; var msg;
debug('users.setStatus:', params, data);
if (data) {
- msg = is_clear ? 'Your status was cleared successfully.'
- : 'Your status was set successfully.';
+ msg = is_clear ? this.stringBundle.GetStringFromName("statuscleared")
+ : this.stringBundle.GetStringFromName("statussuccess");
result = is_clear ? 'clear' : 'set';
} else {
result = 'fail';
- msg = 'Your status could not be set.';
+ msg = this.stringBundle.GetStringFromName("statusfail");
}
fbSvc.notify(null, 'facebook-status-set-result', result);
fbSvc._showPopup('you.status', fbSvc._loggedInUser.pic_sq, msg,
@@ -765,7 +765,8 @@ facebookService.prototype = {
fbSvc._messages = new CountedNotif( data.messages,'facebook-msgs-updated', fbSvc
, function( msgCount ) {
vdebug( "msgCount", msgCount );
- var text = 'You have ' + ( msgCount==1 ? 'a new message' : 'new messages.' );
+ var text = msgCount==1 ? this.stringBundle.GetStringFromName("message")
+ : this.stringBundle.GetStringFromName("messages");
fbSvc.showPopup('you.msg', 'chrome://facebook/skin/images/mail_request.gif',
text, 'http://www.facebook.com/inbox/');
} );
@@ -773,13 +774,13 @@ facebookService.prototype = {
, function( pokeCount ) {
vdebug( "pokeCount", pokeCount );
if( pokeCount > 0 ) {
- var text = 'You have been ';
+ var text = '';
if( 1 == pokeCount )
- text += 'poked.';
+ text = this.stringBundle.GetStringFromName("poked");
else if( 4 >= pokeCount )
- text += 'poked ' + pokeCount + ' times.';
+ text = this.stringBundle.GetStringFromName("pokedfew");
else
- text += 'poked many times.';
+ text = this.stringBundle.GetStringFromName("pokedmany");
fbSvc.showPopup('you.poke', 'chrome://facebook/skin/images/poke.gif',
text, 'http://www.facebook.com/home.php');
@@ -794,7 +795,7 @@ facebookService.prototype = {
for each (var user in users) {
self.items[user.id] = user;
fbSvc.notify(user, 'facebook-new-req', user.id);
- fbSvc.showPopup('you.req', user.pic_sq, user.name + ' wants to be your friend',
+ fbSvc.showPopup('you.req', user.pic_sq, this.stringBundle.formatStringFromName("friendrequest", [user.name]),
'http://www.facebook.com/reqs.php');
}
});
@@ -933,13 +934,13 @@ facebookService.prototype = {
if( pvs_album ) { // album already existed
if( size > pvs_album.size ) {
fbSvc.showPopup( 'friend.album', 'chrome://facebook/skin/images/photo.gif',
- album_owner.name + ' added new photos to "' + name + '"',
+ this.stringBundle.formatStringFromName("albumnewphotos", [album_owner.name, name]),
link + "&src=fftb" );
}
}
else {
fbSvc.showPopup( 'friend.album', 'chrome://facebook/skin/images/photo.gif',
- album_owner.name + ' created the album "' + album.name + '"',
+ this.stringBundle.formatStringFromName("albumcreate", [album_owner.name, album.name]),
link + "&src=fftb" );
}
fbSvc._albumDict[aid] = { 'modified': modified,
@@ -990,8 +991,10 @@ facebookService.prototype = {
if (!onInit) {
if (!fbSvc._friendDict[friend.id]) {
fbSvc.notify(friend, 'facebook-new-friend', friend['id']);
- fbSvc.showPopup('you.friend', friend.pic_sq, friend.name + ' is now your friend',
- 'http://www.facebook.com/profile.php?id=' + friend.id + '&src=fftb');
+ fbSvc.showPopup('you.friend',
+ friend.pic_sq,
+ this.stringBundle.formatStringFromName("friendaccepted", [friend.name]),
+ 'http://www.facebook.com/profile.php?id=' + friend.id + '&src=fftb');
fbSvc._friendCount++; // increment the count
friendUpdate = true;
} else {
@@ -1021,21 +1024,27 @@ facebookService.prototype = {
}
if (fbSvc._friendDict[friend.id].wall < friend.wall) {
fbSvc.notify(friend, 'facebook-friend-updated', 'wall');
- notifyProf = notifyProf && !fbSvc.showPopup('friend.wall', friend.pic_sq, 'Someone wrote on ' + friend.name + "'s wall",
- 'http://www.facebook.com/profile.php?id=' + friend.id + '&src=fftb#wall');
+ notifyProf = notifyProf && !fbSvc.showPopup('friend.wall',
+ friend.pic_sq,
+ this.stringBundle.formatStringFromName("wallpost", [friend.name]),
+ 'http://www.facebook.com/profile.php?id=' + friend.id + '&src=fftb#wall');
vdebug('wall count updated', fbSvc._friendDict[friend.id].wall, friend.wall);
}
if (fbSvc._friendDict[friend.id].notes < friend.notes) {
fbSvc.notify(friend, 'facebook-friend-updated', 'notes');
- notifyProf = notifyProf && !fbSvc.showPopup('friend.note', friend.pic_sq, friend.name + ' wrote a note.',
- 'http://www.facebook.com/notes.php?id=' + friend.id + '&src=fftb');
+ notifyProf = notifyProf && !fbSvc.showPopup('friend.note',
+ friend.pic_sq,
+ this.stringBundle.formatStringFromName("newnote", [friend.name]),
+ 'http://www.facebook.com/notes.php?id=' + friend.id + '&src=fftb');
vdebug('note count updated', fbSvc._friendDict[friend.id].notes, friend.notes);
}
if (fbSvc._friendDict[friend.id].ptime != friend.ptime && 0 != friend.ptime ) {
fbSvc.notify(friend, 'facebook-friend-updated', 'profile');
if (notifyProf) {
- fbSvc.showPopup('friend.profile', friend.pic_sq, friend.name + ' updated his/her profile',
- 'http://www.facebook.com/profile.php?id=' + friend.id + '&src=fftb&highlight');
+ fbSvc.showPopup('friend.profile',
+ friend.pic_sq,
+ this.stringBundle.formatStringFromName("profilechange", [friend.name]),
+ 'http://www.facebook.com/profile.php?id=' + friend.id + '&src=fftb&highlight');
}
friendUpdate = true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.