2012-01-27 10:14:09 +04:00
|
|
|
/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2012-01-27 10:14:09 +04:00
|
|
|
|
|
|
|
#import "MacUtils.h"
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
#include "Accessible.h"
|
2012-01-27 10:14:09 +04:00
|
|
|
|
|
|
|
#include "nsCocoaUtils.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
namespace utils {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a localized string from the a11y string bundle.
|
|
|
|
* Return nil if not found.
|
|
|
|
*/
|
2019-01-21 20:18:16 +03:00
|
|
|
NSString* LocalizedString(const nsString& aString) {
|
2012-01-27 10:14:09 +04:00
|
|
|
nsString text;
|
2015-06-08 17:59:19 +03:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible::TranslateString(aString, text);
|
2015-06-08 17:59:19 +03:00
|
|
|
|
2012-01-27 10:14:09 +04:00
|
|
|
return text.IsEmpty() ? nil : nsCocoaUtils::ToNSString(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|