| Index: src/extensions/i18n/locale.h
|
| diff --git a/src/extensions/i18n/i18n-extension.h b/src/extensions/i18n/locale.h
|
| similarity index 63%
|
| copy from src/extensions/i18n/i18n-extension.h
|
| copy to src/extensions/i18n/locale.h
|
| index 050c336a67a21fd6cb32892e14215cac11971111..c39568e5d9d69104b8b4d3dbb35ca197a813c9a3 100644
|
| --- a/src/extensions/i18n/i18n-extension.h
|
| +++ b/src/extensions/i18n/locale.h
|
| @@ -26,26 +26,31 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| // limitations under the License.
|
|
|
| -#ifndef V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| -#define V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +#ifndef V8_EXTENSIONS_I18N_SRC_LOCALE_H_
|
| +#define V8_EXTENSIONS_I18N_SRC_LOCALE_H_
|
|
|
| +#include "unicode/uversion.h"
|
| #include "v8.h"
|
|
|
| namespace v8_i18n {
|
|
|
| -class Extension : public v8::Extension {
|
| - public:
|
| - Extension();
|
| +// Canonicalizes the BCP47 language tag using BCP47 rules.
|
| +// Returns 'invalid-tag' in case input was not well formed.
|
| +void JSCanonicalizeLanguageTag(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
| - virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
|
| - v8::Handle<v8::String> name);
|
| +// Returns a list of available locales for collator, date or number formatter.
|
| +void JSAvailableLocalesOf(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
| - static void Register();
|
| +// Returns default ICU locale.
|
| +void JSGetDefaultICULocale(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
| - private:
|
| - static Extension* extension_;
|
| -};
|
| +// Returns an array of objects, that have maximized and base names of inputs.
|
| +// Unicode extensions are dropped from both.
|
| +// Input: ['zh-TW-u-nu-thai', 'sr']
|
| +// Output: [{maximized: 'zh-Hant-TW', base: 'zh-TW'},
|
| +// {maximized: 'sr-Cyrl-RS', base: 'sr'}]
|
| +void JSGetLanguageTagVariants(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
| } // namespace v8_i18n
|
|
|
| -#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +#endif // V8_EXTENSIONS_I18N_LOCALE_H_
|
|
|