diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/locale/countrylanguagenames_test.html')
-rw-r--r-- | contexts/data/lib/closure-library/closure/goog/locale/countrylanguagenames_test.html | 237 |
1 files changed, 0 insertions, 237 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/locale/countrylanguagenames_test.html b/contexts/data/lib/closure-library/closure/goog/locale/countrylanguagenames_test.html deleted file mode 100644 index 9507c39..0000000 --- a/contexts/data/lib/closure-library/closure/goog/locale/countrylanguagenames_test.html +++ /dev/null @@ -1,237 +0,0 @@ -<!DOCTYPE html> -<html> -<!-- -Copyright 2006 The Closure Library Authors. All Rights Reserved. - -Use of this source code is governed by the Apache License, Version 2.0. -See the COPYING file for details. ---> -<!-- ---> -<head> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<title>Closure Unit Tests - goog.locale.LocaleNameConstants</title> -<!-- UTF-8 needed for character encoding --> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - -<script src="../base.js"></script> -<script> - goog.require('goog.locale'); - goog.require('goog.locale.nativeNameConstants'); - goog.require('goog.testing.jsunit'); -</script> -</head> -<body> -<script> - -// Test data from //googledata/i18n/js_locale_data/LocaleNameConstants__de.js -var LocaleNameConstants_de = { - LANGUAGE: { - 'cad': 'Caddo', - 'fr': 'Franz\u00f6sisch', - 'fr_CA': 'Canadian French', - 'fr_CH': 'Swiss French', 'zh': 'Chinesisch', - 'zh_Hans': 'Chinesisch (vereinfacht)', - 'zh_Hant': 'Chinesisch (traditionell)' - }, - COUNTRY: { - 'CN': 'China', - 'ES': 'Spanien', - 'FR': 'Frankreich' - } -}; -registerLocalNameConstants(LocaleNameConstants_de, 'de'); - -// Test data from //googledata/i18n/js_locale_data/LocaleNameConstants__en.js -var LocaleNameConstants_en = { - LANGUAGE: { - 'cad': 'Caddo', - 'fr': 'French', - 'fr_CA': 'Canadian French', - 'fr_CH': 'Swiss French', - 'zh': 'Chinese', - 'zh_Hans': 'Simplified Chinese', - 'zh_Hant': 'Traditional Chinese' - }, - COUNTRY: { - 'CN': 'China', - 'ES': 'Spain', - 'FR': 'France' - } -}; -registerLocalNameConstants(LocaleNameConstants_en, 'en'); - -goog.locale.setLocale('de'); - -function testLoadLoacleSymbols() { - var result = goog.locale.getLocalizedCountryName('fr-FR'); - assertEquals('Frankreich', result); -} - -function testGetNativeCountryName() { - var result = goog.locale.getNativeCountryName('de-DE'); - assertEquals('Deutschland', result); - - result = goog.locale.getNativeCountryName('de_DE'); - assertEquals('Deutschland', result); - - result = goog.locale.getNativeCountryName('und'); - assertEquals('und', result); - - result = goog.locale.getNativeCountryName('de-CH'); - assertEquals('Schweiz', result); - - result = goog.locale.getNativeCountryName('fr-CH'); - assertEquals('Suisse', result); - - result = goog.locale.getNativeCountryName('it-CH'); - assertEquals('Svizzera', result); -} - -function testGetLocalizedCountryName() { - var result = goog.locale.getLocalizedCountryName('es-ES'); - assertEquals('Spanien', result); - - result = goog.locale.getLocalizedCountryName('es-ES', LocaleNameConstants_en); - assertEquals('Spain', result); - - result = goog.locale.getLocalizedCountryName('zh-CN-cmn'); - assertEquals('China', result); - - result = goog.locale.getLocalizedCountryName('zh_CN_cmn'); - assertEquals('China', result); - - // 'und' is a non-existing locale, default behavior is to - // return the locale name itself if no mapping is found. - result = goog.locale.getLocalizedCountryName('und'); - assertEquals('und', result); -} - -function testGetNativeLanguageName() { - var result = goog.locale.getNativeLanguageName('fr'); - assertEquals('fran\u00E7ais', result); - - result = goog.locale.getNativeLanguageName('fr-latn-FR'); - assertEquals('fran\u00E7ais', result); - - result = goog.locale.getNativeLanguageName('fr_FR'); - assertEquals('fran\u00E7ais', result); - - result = goog.locale.getNativeLanguageName('error'); - assertEquals('error', result); -} - -function testGetLocalizedLanguageName() { - var result = goog.locale.getLocalizedLanguageName('fr'); - assertEquals('Franz\u00F6sisch', result); - - result = goog.locale.getLocalizedLanguageName('fr', - LocaleNameConstants_en); - assertEquals('French', result); - - result = goog.locale.getLocalizedLanguageName('fr-latn-FR'); - assertEquals('Franz\u00F6sisch', result); - - result = goog.locale.getLocalizedLanguageName('fr_FR'); - assertEquals('Franz\u00F6sisch', result); - - result = goog.locale.getLocalizedLanguageName('cad'); - assertEquals('Caddo', result); - - result = goog.locale.getLocalizedLanguageName('error'); - assertEquals('error', result); - - result = goog.locale.getLocalizedLanguageName('zh_Hans', - LocaleNameConstants_en); - assertEquals('Simplified Chinese', result); -} - - -function testGetLocalizedLanguageNameForGivenSymbolset() { - var result = goog.locale.getLocalizedCountryName('fr-FR'); - assertEquals('Frankreich', result); - - result = goog.locale.getLocalizedCountryName( - 'fr-FR', - LocaleNameConstants_en); - assertEquals('France', result); - - result = goog.locale.getLocalizedCountryName('fr-FR'); - assertEquals('Frankreich', result); -} - -/** - * Valid combination of sub tags: - * 1) LanguageSubtag'-'RegionSubtag - * 2) LanguageSubtag'-'ScriptSubtag'-'RegionSubtag - * 3) LanguageSubtag'-'RegionSubtag'-'VariantSubtag - * 4) LanguageSubtag'-'ScriptSubTag'-'RegionSubtag'-'VariantSubtag - */ - -function testGetRegionSubTag() { - - var result = goog.locale.getRegionSubTag('de-CH'); - assertEquals('CH',result); - - result = goog.locale.getRegionSubTag('de-latn-CH'); - assertEquals('CH',result); - - result = goog.locale.getRegionSubTag('de_latn_CH'); - assertEquals('CH',result); - - result = goog.locale.getRegionSubTag('de-CH-xxx'); - assertEquals('CH',result); - - result = goog.locale.getRegionSubTag('de-latn-CH-xxx'); - assertEquals('CH',result); - - result = goog.locale.getRegionSubTag('es-latn-419-xxx'); - assertEquals('419',result); - - result = goog.locale.getRegionSubTag('es_latn_419_xxx'); - assertEquals('419',result); - - // No region sub tag present - result = goog.locale.getRegionSubTag('de'); - assertEquals('',result); -} - -function testGetLanguageSubTag() { - - var result = goog.locale.getLanguageSubTag('de'); - assertEquals('de', result); - - result = goog.locale.getLanguageSubTag('de-DE'); - assertEquals('de', result); - - result = goog.locale.getLanguageSubTag('de-latn-DE-xxx'); - assertEquals('de', result); - - result = goog.locale.getLanguageSubTag('nds'); - assertEquals('nds', result); - - result = goog.locale.getLanguageSubTag('nds-DE'); - assertEquals('nds', result); -} - -function testGetScriptSubTag() { - - var result = goog.locale.getScriptSubTag('fr'); - assertEquals('', result); - - result = goog.locale.getScriptSubTag('fr-Latn'); - assertEquals('Latn', result); - - result = goog.locale.getScriptSubTag('fr-Arab-AA'); - assertEquals('Arab', result); - - result = goog.locale.getScriptSubTag('de-Latin-DE'); - assertEquals('', result); - - result = goog.locale.getScriptSubTag('srn-Ar-DE'); - assertEquals('', result); -} - -</script> -</body> -</html> |