mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-06-10 02:29:43 +00:00
#405: localize Cancel button
This commit is contained in:
parent
1ee0078cfb
commit
66f5bfc7e7
|
@ -12,6 +12,8 @@
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsIComponentManager.h"
|
#include "nsIComponentManager.h"
|
||||||
|
#include "nsQueryObject.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsCocoaFeatures.h"
|
#include "nsCocoaFeatures.h"
|
||||||
#include "nsCocoaUtils.h"
|
#include "nsCocoaUtils.h"
|
||||||
|
@ -280,6 +282,8 @@ NS_IMPL_ISUPPORTS(nsDatePicker, nsIDatePicker)
|
||||||
nsDatePicker::nsDatePicker()
|
nsDatePicker::nsDatePicker()
|
||||||
{
|
{
|
||||||
mHasDefault = false;
|
mHasDefault = false;
|
||||||
|
mHasMin = false;
|
||||||
|
mHasMax = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsDatePicker::~nsDatePicker()
|
nsDatePicker::~nsDatePicker()
|
||||||
|
@ -311,13 +315,28 @@ int16_t
|
||||||
nsDatePicker::GetDate()
|
nsDatePicker::GetDate()
|
||||||
{
|
{
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||||
|
nsCOMPtr<nsIStringBundle> stringBundle;
|
||||||
|
NSString *cancelString = @"Cancel";
|
||||||
|
nsXPIDLString intlString;
|
||||||
|
nsresult rv;
|
||||||
|
|
||||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||||
[formatter setFormatterBehavior:NSDateFormatterBehavior10_4];
|
[formatter setFormatterBehavior:NSDateFormatterBehavior10_4];
|
||||||
[formatter setDateFormat:@"yyyy-MM-dd"];
|
[formatter setDateFormat:@"yyyy-MM-dd"];
|
||||||
|
|
||||||
|
nsCOMPtr<nsIStringBundleService> bundleSvc = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
|
||||||
|
rv = bundleSvc->CreateBundle("chrome://global/locale/commonDialogs.properties", getter_AddRefs(stringBundle));
|
||||||
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
stringBundle->GetStringFromName(MOZ_UTF16("Cancel"), getter_Copies(intlString));
|
||||||
|
if (intlString)
|
||||||
|
cancelString = [NSString stringWithCharacters:reinterpret_cast<const unichar*>(intlString.get())
|
||||||
|
length:intlString.Length()];
|
||||||
|
}
|
||||||
|
|
||||||
NSDoubleDatePicker *alert = [NSDoubleDatePicker
|
NSDoubleDatePicker *alert = [NSDoubleDatePicker
|
||||||
alertWithMessageText:@" "// XXX: localize this eventually
|
alertWithMessageText:@" "// XXX: localize this eventually
|
||||||
defaultButton:nil // "OK"
|
defaultButton:nil // "OK"
|
||||||
alternateButton:nil // "Cancel"
|
alternateButton:cancelString // "Cancel"
|
||||||
otherButton:nil // nothin'
|
otherButton:nil // nothin'
|
||||||
informativeTextWithFormat:@""];
|
informativeTextWithFormat:@""];
|
||||||
if (mHasDefault) {
|
if (mHasDefault) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user