Giter VIP home page Giter VIP logo

vue2-timeago's Issues

Romanian translation

file, ro.js

function formatToLongString (time, type) {
    if(type == 'zi')
        return ` ${time == 1 ? 'o ' : time} ${ time == 1 ? '' : 'e'} în urmă`
    
    return ` ${time == 1 ? 'o ' : time} ${type}${ time == 1 ? 'ă' : 'e'} în urmă`
  }
  
  export default {
    short: {
      now: 'chiar acum',
      sec:'s',
      min: 'm',
      hour: 'o',
      day: 'z',
    },
    long: {
      now: 'chiar acum',
      sec: time => formatToLongString(time, 'secund'),
      min: time => formatToLongString(time, 'minut'),
      hour: time => formatToLongString(time, 'or'),
      day: time => formatToLongString(time, 'zi'),
    }
  }

Critical dependency

WARNING in ./node_modules/vue2-timeago/dist/vue2-timeago.js 1:294-298
Critical dependency: the request of a dependency is an expression

Any idea how to fix that?

Russian translation

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, ['день', 'дня', 'дней']),
    }
  }

[Locale] Arabic support

export default {
short: {
now: "قبل قليل",
sec: " ثانية",
min: " دقيقة",
hour: " ساعة",
day: " يوم"
},
long: {
now: "قبل قليل",
sec: " ثواني مضت",
min: " دقائق مضت",
hour: " ساعات مضت",
day: " أيام مضت"
}
}

Please note that we don't have the same as English. This means that instead of 5 minutes ago, we write before 5 minutes

There fore, if you can replace the $value with the time-left, it would be better. Otherwise, you can use the first list, which doesn't require you to reorder the logic of your code. The first list above uses the same as English. I prefer the second one.

Also, there's a difference between singular and plural. If you could implement this, please let me know so i can give you a better translation.

export default {
short: {
now: "قبل قليل",
sec: " ثانية",
min: " دقيقة",
hour: " ساعة",
day: " يوم"
},
long: {
now: "قبل قليل",
sec: " قبل $time ثواني",
min: " قبل $time دقائق",
hour: " قبل $time ساعات",
day: " قبل $time أيام"
}
}

翻页时有问题

不知道怎么回事,在翻页的时候,时间显示的是第一页的数据,比如12条数据,第一页都是正常的,但第二页开始,前2条的时间数据是第一页的前两条。

我换了 vue-timeago 是没有问题的,请测试下。

Italian translation

function formatToLongString(time, type) {
  return `${time} ${type}${time > 1 ? 's' : ''} fa`
}

export default {
  short: {
    now: 'adesso',
    sec: 's',
    min: 'm',
    hour: 'o',
    day: 'g',
  },
  long: {
    now: 'adesso',
    sec: (time) => formatToLongString(time, 'secondi'),
    min: (time) => formatToLongString(time, 'minuti'),
    hour: (time) => formatToLongString(time, 'ore'),
    day: (time) => formatToLongString(time, 'giorni'),
  },
}

Polish translation

Below I paste the Polish translation. Thanks!

locale="pl"

function formatToLongString (time, type) {
  return ` ${time} ${type}${ time > 1 ? 's' : ''} temu`
}

export default {
  short: {
    now: 'przed chwilą',
    sec:'s',
    min: 'm',
    hour: 'g',
    day: 'd',
  },
  long: {
    now: 'przed chwilą',
    sec: time => formatToLongString(time, 'sekund'),
    min: time => formatToLongString(time, 'minut'),
    hour: time => formatToLongString(time, 'godzin'),
    day: time => formatToLongString(time, 'dni'),
  }
}

Question: Formatting

Is it possible to get rid of the timestamp and just leave the "xxx min/days ago"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.