license: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
Ottiene informazioni ed esegue le operazioni specifiche di impostazioni locali dell'utente e il fuso orario.
Il globalization oggetto è un bambino del navigator oggetto, e quindi ha ambito globale.
// The global globalization object var globalization = navigator.globalization;
A partire dalla versione 3.0, Cordova implementa le API a livello di dispositivo come plugin. Utilizzare la CLI plugin comando, descritto in Command-Line Interface, aggiungere o rimuovere questa funzionalità per un progetto:
$ cordova plugin add org.apache.cordova.globalization
$ cordova plugin ls
[ 'org.apache.cordova.globalization' ]
$ cordova plugin rm org.apache.cordova.globalization
Questi comandi si applicano a tutte le piattaforme mirate, ma modificano le impostazioni di configurazione specifiche della piattaforma descritte di seguito:
Android (inapp/res/xml/config.xml)
<feature name="Globalization">
<param name="android-package" value="org.apache.cordova.Globalization" />
</feature>
Alcune piattaforme possono supportare questa funzionalità senza richiedere alcuna configurazione speciale. Vedere Supporto piattaforma nella sezione panoramica.