cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rodms10 <...@git.apache.org>
Subject [GitHub] cordova-plugin-globalization pull request: CB-7102 - Initial imple...
Date Thu, 10 Jul 2014 23:16:13 GMT
Github user rodms10 commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-globalization/pull/17#discussion_r14799288
  
    --- Diff: src/firefoxos/GlobalizationProxy.js ---
    @@ -0,0 +1,217 @@
    +/*
    + *
    + * 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
    + * under the License.
    + *
    +*/
    +
    +var GlobalizationError = require('./GlobalizationError');
    +
    +
    +function addLinkToLocales() {
    +  // Adding globalization file to the HEAD section
    +  // <link rel="resource" type="application/l10n" href="locales/date.ini" />
    +	var link = document.createElement("link");
    +	link.setAttribute("rel", "resource");
    +	link.setAttribute("type", "application/l10n");
    +	link.setAttribute("href", "locales/date.ini");
    +
    +	document.head.appendChild(link);
    +}
    +
    +addLinkToLocales();
    +
    +
    +function getPreferredLanguage(successCB, errorCB) {
    +    // WARNING: this isn't perfect - there is a difference between UI language
    +    // and preferred language, however it doesn't happen too often.
    +    navigator.mozL10n.ready(function() {
    +      successCB({value: navigator.mozL10n.language.code});
    +    });
    +}
    +
    +function getLocaleName(successCB, errorCB) {
    +    navigator.mozL10n.ready(function() {
    +      successCB(navigator.mozL10n.language.code);
    +    });
    +}
    +
    +function dateToString(successCB, errorCB, params) {
    +    var dateString;
    --- End diff --
    
    This variable is unused.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message