Identifying the Language Code / Locale
文章推薦指數: 80 %
ZF is the SAP language code for Simplified Chinese. The most generic representation in BCP47 is zh-Hant . zh-TW (Chinese, Taiwan) is another representation, but ... IdentifyingtheLanguageCode/Locale Fortheidentificationoflanguages,theframeworkusesalanguagecodeoftype string. Currently,SAPUI5acceptsthefollowingsyntaxforms: ThelanguagecodesaccordingtothedefactostandardBCP-47,whichareusedbymostbrowsers forlanguageidentification.AsofJDK1.7theyarealsosupportedbytheJava localeclass. Example:de,en-US,zh-Hans-CN TheJavaLocalesyntaxthatcombinesalowercase ISO639alpha-2oralpha-3languagecodewithanISO3166alpha-2countrycode. Bothcodesarecombinedwithanunderscore.Anarbitrarysequenceofvariant identifiers(alsoseparatedbyunderscores)canbeappendedasathird component. Example:de,en_US,zh_TW_Traditional TheSAPproprietarylanguagecodes.SAPUI5applicationsareoftenusedtoconnectto ABAP-basedSAPapplicationservers.TheseserversuseSAPproprietarylanguage codesforcompatibilityreasons.TheselanguagecodesoftenmatchanISO639 alpha-2languagecode,butnotinallcases.IfthelanguagecodeforaSAPUI5 applicationisspecifiedwiththetraditionalURLparameter sap-language,SAPUI5assumesthatitisaSAPproprietary languagecodeandconvertsittoaBCP-47languagetagasfollows: SAPLanguageCode BCP47LanguageTag Description ZH zh-Hans ZHistheSAPlanguagecodeforSimplified Chinese.ThemostgenericrepresentationinBCP47is zh-Hans.zh-CN(Chinese,China)is anotherrepresentation,butSAPUI5decidedtouse zh-Hans. ZF zh-Hant ZFistheSAPlanguagecodeforSimplified Chinese.ThemostgenericrepresentationinBCP47is zh-Hant.zh-TW(Chinese,Taiwan) isanotherrepresentation,butSAPUI5decidedtouse zh-Hant. 1Q en-US-x-saptrc 1QisatechnicalSAPlanguagecodeusedin supportscenarios,forexamplefortranslationissues.Whenyouselect thislanguagecode,thetechnicalkeysaredisplayinsteadoftheactual data.AsnoISO639codeforthisexists,theinformationhasbeenadded asaBCP47privateextensiontotheen-USlanguagetag: "trc"standsfor"trace"or"traceability". 2Q en-US-x-sappsd 2QisalsousedasatechnicalSAPlanguagecode insupportscenariosanddisplaysapseudotranslation("psd"inthe privateextensionsname). CurrentLanguageCode/Locale SAPUI5hasthenotionofacurrentlanguage.Itisdeterminedfromthefollowing sourcesofinformation.Thesourcesareorderedincreasinglybypriorityandthe lastavailableuserlanguage/localewins: Hard-codedUI5defaultlocale('en') Potentiallyconfiguredbrowserlanguage(window.navigator.browserLanguage);for InternetExplorerthisisthelanguageoftheOperatingSystem Potentiallyconfigureduserlanguage(window.navigator.userLanguage);for InternetExplorerthisisthelanguageintheRegionsettings Generallanguageinformationfromthebrowser(window.navigator.language) Android:Languagecontainedintheuseragentstring (window.navigator.userAgent) Localeconfiguredintheapplicationcoding (jsdoc:symbols/sap.ui.core.Configuration) LocaleconfiguredviaURLparameters YouusetheconfigurationAPItoretrievethe resultingcurrentlanguageasfollows: #!js varsCurrentLocale=sap.ui.getCore().getConfiguration().getLanguage(); NoteThesyntaxofthereturnedvaluedependson thesyntaxusedforconfiguration.Iftheinformationsourceisoneofthe browserlanguageproperties,thereturnedlanguagemostlikelyisinBCP-47 format.IfitisconfiguredasaURLparameter,theusermighthavechoosenthe JDKLocalesyntax. NoteNoneofthewindow.navigator.* propertiesinInternetExplorer(IE)reflectthesettingsoftheLanguage Preferencedialog.Instead,IEreturnsthelanguageoftheOperating SysteminstallationasbrowserLanguageandthelanguagefromthe OperatingSystemregionalsettingsasuserLanguage.Asaresult, thesettingsintheLanguagePreferencedialogcannotbe usedforthecurrentlanguageofSAPUI5.Thisisoftenconfusingfordevelopersand aknownshortcominginIE.Tocircumventthis,anadditionalserverrequestis requiredwhereIEprovidesthecorrespondingsettingin theAccept-Languageheader.Thisserverrequest,however, requiresabackendcomponent.SAPUI5mustbeabletorunwithoutaservercomponent and,thus,theserverrequestisnotimplementedyet.
延伸文章資訊
- 1Identifying the Language Code / Locale
ZF is the SAP language code for Simplified Chinese. The most generic representation in BCP47 is z...
- 2Language Codes - Israel Science and Technology Directory
- 3zh-tw language code - 社群貼文懶人包
zh-TW, Chinese (T).。 List of ISO 639-1 codes - Wikipedia。 ISO 639 is a standardized nomenclature ...
- 4ISO language codes
- 5Language Codes - Alchemy Software Development
These are the allowable Language Codes that must be used when setting the Source and Target langu...