• Hi,

    How would I make this easy to translate?
    In english everything can be fixed with adding a ‘s’ when its a plural. But in dutch there are different letters when its a plural.

    Thanks in advance!

    $time = time() – $time; // to get the time since that moment
    $tokens = array (
    31536000 => ‘year’,
    2592000 => ‘month’,
    604800 => ‘week’,
    86400 => ‘day’,
    3600 => ‘hour’,
    60 => ‘minute’,
    1 => ‘second’
    );

    foreach ($tokens as $unit => $text) {
    if ($time < $unit) continue;
    $numberOfUnits = floor($time / $unit);
    $t = $numberOfUnits.’ ‘.$text.(($numberOfUnits>1)?’s’:”);
    return $t. ” ago “;
    }

    https://wordpress.org/plugins/fbf-facebook-page-feed-widget/

Viewing 1 replies (of 1 total)
  • Thread Starter jstoker

    (@jstoker)

    What i was thinking about is making two arrays:

    $tokens = array (
    31536000 => ‘jaar’,
    2592000 => ‘maand’,
    604800 => ‘week’,
    86400 => ‘dag’,
    3600 => ‘uur’,
    60 => ‘minuut’,
    1 => ‘seconde’
    );

    and

    $tokensplural = array (
    31536000 => ‘jaren’,
    2592000 => ‘maanden’,
    604800 => ‘weken’,
    86400 => ‘dagen’,
    3600 => ‘uren’,
    60 => ‘minuten’,
    1 => ‘seconden’
    );

    and then when the condition $numberOfUnits>1 = true that it uses $tokensplural

Viewing 1 replies (of 1 total)

The topic ‘Translation problem’ is closed to new replies.