3 votos

Tiempo de barra de menú formato a palabras en inglés

Vi esta captura de pantalla de la barra de menú de una persona y su formato de hora está establecida en inglés legible.

view menu bar: 'five to eleven'

¿Es esta una app o un ambiente de fiesta / script puede ejecutarse en OS X?

3voto

up_the_irons Puntos 231

Escribí un guión para hacer esto.

Para mostrar en la barra de menús, utilice BitBar. Una pequeña aplicación que crea la barra de menú los elementos de la secuencia de comandos de shell de salida.

menubar demo

Una vez que usted descargue BitBar, guarde el código siguiente en un archivo llamado lingualtime.1s.php , a continuación, seleccione BitBar a donde lo guardó.

#!/usr/bin/env php

<?php

# <bitbar.title>Lingual Clock</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Stan Hutcheon</bitbar.author>
# <bitbar.author.github>stnvh</bitbar.author.github>
# <bitbar.desc>displays the current time in a sentence</bitbar.desc>
# <bitbar.dependencies>php</bitbar.dependencies>

$time = array_map(function($time) {
    return intval($time);
}, explode(' ', date('g i')));

$st = array('hour' => '', 'minute' => '');

$past = '%s past %s'; $to = '%s to %s';

$pastHalf = false;

function get($int) {
    $numbers = array(
        1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine',
        11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen', 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen',
        10 => 'ten', 20 => 'twenty', 30 => 'thirty', 40 => 'fourty', 50 => 'fifty'
    );

    return isset($numbers[$int]) ? $numbers[$int] : '';
}

if($time[1] >= 35) {
    $pastHalf = true;

    $time[0] = $time[0] === 12 ? 1 : ++$time[0];
    $time[1] = 60 - $time[1];
}

# get lingual values
foreach(array('hour', 'minute') as $key => $part) {
    if($time[$key] < 20) {
        $st[$part] = get($time[$key]);
    } else {
        $currTenth = floor($time[$key] / 10) * 10;
        $currRem = $time[$key] - $currTenth;

        $ling = get($currTenth);
        if($ext = get($currRem)) {
            $ling .= '-' . $ext;
        }

        $st[$part] = $ling;
    }
}

printf(($pastHalf ? $to : $past) . PHP_EOL, $st['minute'], $st['hour']);

1voto

whaity Puntos 3

Creo que la aplicación que estás buscando se llama Tiempo del mundo. Es una aplicación de pagada (1,99 euros) y debe hacer todo lo que queramos que haga. No sé alguna alternativa libre, aunque.

0voto

sayzlim Puntos 2175

Usted está buscando en FuzzyClock es libre pero no mantenido por los desarrolladores. Organicé la aplicación en caso de que alguien más lo necesita. Todavía funciona en El Capitan: http://sayzlim.net/reading-time-on-mac-with-fuzzyclock/

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X