Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Russian translation #16

Closed
wdarins opened this issue Nov 9, 2019 · 1 comment
Closed

Russian translation #16

wdarins opened this issue Nov 9, 2019 · 1 comment
Labels
good first issue Good for newcomers

Comments

@wdarins
Copy link

wdarins commented Nov 9, 2019

function formatToLongString (time, words) {
    let _time = time % 100;

    if (_time > 19) {
        _time = _time % 10;
    }

    switch ( _time ) {
        case 1: {
            return ` ${time} ${words[0]} назад`;
        }
        case 2: case 3: case 4: {
            return ` ${time} ${words[1]} назад`;
        }
        default: {
            return ` ${time} ${words[2]} назад`;
        }
    }
  }
  
  export default {
    short: {
      now: 'только что',
      sec:'с',
      min: 'м',
      hour: 'ч',
      day: 'дн',
    },
    long: {
      now: 'только что',
      sec: time => formatToLongString(time, ['секунда', 'секунды', 'секунд']),
      min: time => formatToLongString(time, ['минута', 'минуты', 'минут']),
      hour: time => formatToLongString(time, ['час', 'часа', 'часов']),
      day: time => formatToLongString(time, ['день', 'дня', 'дней']),
    }
  }
@runkids runkids added the good first issue Good for newcomers label Nov 14, 2019
@runkids
Copy link
Owner

runkids commented Feb 3, 2020

Release with version 1.2.6. Thank you for your help.

@runkids runkids closed this as completed Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants