cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-7102) globalization
Date Mon, 14 Jul 2014 21:02:08 GMT

    [ https://issues.apache.org/jira/browse/CB-7102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14061234#comment-14061234
] 

ASF GitHub Bot commented on CB-7102:
------------------------------------

Github user rodms10 commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-globalization/pull/17#discussion_r14903604
  
    --- Diff: src/firefoxos/GlobalizationProxy.js ---
    @@ -0,0 +1,214 @@
    +/*
    + *
    + * 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) {
    --- End diff --
    
    I think we can support more formats assuming what is [defined here](http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html)
is supported. Got the link from [a comment in l10n_date.js file](https://github.com/zalun/cordova-plugin-globalization/blob/ffos-initial/src/firefoxos/l10n_date.js#L34).
    
    Long time and date is looking good, I'm getting: `Wed Oct 29 2014 5:00:00 PM`. Long time
and short date are fine too. But long date gives me a short date and short time gives me long
time.


> globalization
> -------------
>
>                 Key: CB-7102
>                 URL: https://issues.apache.org/jira/browse/CB-7102
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: FirefoxOS
>            Reporter: Piotr Zalewa
>            Assignee: Piotr Zalewa
>
> Add globalization support for Firefox OS



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message