/* Copyright 2009 Palm, Inc.  All rights reserved. */

var ServiceStrings = Class.create( {
	initialize: function() {
	}	
});

Email.identifier = 'palm://com.palm.mail';

ServiceStrings.sendLocalizedStrings = function() {
	var defaultSignature = ServiceStrings.stringsNeededByService.defaultSignature;
	var getSignatureCallback = function(signature) {
		if (signature) {
			defaultSignature = signature;
		}
		// Add some styling to the default signature before sending it to the service
		ServiceStrings.stringsNeededByService.defaultSignature = EmailAccount.addStylingToSig(defaultSignature);
		var request = new Mojo.Service.Request(Email.identifier, {
			method: 'localizedStrings',
			parameters: ServiceStrings.stringsNeededByService
		});
	};
	
	EmailAppDepot.getDepot().getDefaultSignature(getSignatureCallback);
}

// A localized version of these strings is needed by the service
ServiceStrings.stringsNeededByService = {
	defaultSignature: $L("-- Sent from my Palm #{modelNameAscii}").interpolate(Mojo.Environment.DeviceInfo),
	gmailLocalized: $L("Gmail"),		// This is "Googlemail" in Germany and UK
	defaultSignatureStub: $L("-- Sent from my Palm ")
};


// These strings are hard coded in the service, and must exists here so they are localized
ServiceStrings.strings = {
	SmartFolders: $L("Smart Folders"),
	AllInboxes: $L("All Inboxes"),
	AllUnread: $L("All Unread"),
	AllFlagged: $L("All Flagged"),
	InboxFolders: [ $L("Inbox") ],
	OutboxFolders: [ $L("Outbox") ],
	DraftsFolders: [ $L("Drafts"), $L("Saved") ],
	SentFolders: [ $L("Sent"), $L("Sent Mail"), $L("Sent Items") ],
	TrashFolders: [ $L("Trash"), $L("Deleted Items") ],
	SpamFolders: [ $L("Spam"), $L("Junk E-Mail") ],
	ErrDuplicateFolder: $L("A folder with that name already exists: %s."),
	ErrUnknownHost: $L("The host is unknown: %s."),
	ErrNoOutboxForSending: $L("There is no outbox that can be used for sending."),
	ErrMessageNotInFolder: $L("The message is not in a folder."),
	ErrCannotFindMessageFolder: $L("The Email application cannot find the folder for the message."),
	ErrCannotFindMessageAccount: $L("The Email application cannot find the account for the message.")
}

