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

locale translations are needed #19

Open
39 of 65 tasks
hustcc opened this issue Sep 10, 2016 · 9 comments
Open
39 of 65 tasks

locale translations are needed #19

hustcc opened this issue Sep 10, 2016 · 9 comments

Comments

@hustcc
Copy link
Owner

hustcc commented Sep 10, 2016

The locales is here, you can add the miss name.

  1. Please sort by dictionary.
  2. Please ensure the accuracy.
  3. Please keep file size tiny.

How to ?

  1. Add you locale file into locales dir.
  2. Add you locale key into file.
  3. Add testcases into tests/lang dir.
  4. Then run npm test, if all passed, then commit the pr.

  • ar
  • az
  • az
  • be
  • bg
  • bs
  • ca
  • cs
  • cy
  • da
  • de
  • dv
  • el
  • en
  • en_short
  • es
  • et
  • eu
  • fa
  • fi
  • fr
  • gl
  • he
  • hr
  • hu
  • hy
  • id
  • in_BG
  • in_HI
  • in_ID
  • is
  • it
  • ja
  • jv
  • ko
  • ky
  • lt
  • lv
  • mk
  • ml
  • my
  • nb_NO
  • nl
  • nn_NO
  • no
  • pl
  • pt_BR
  • pt
  • ro
  • rs
  • ru
  • rw
  • si
  • sk
  • sl
  • sr
  • sv
  • ta
  • th
  • tr
  • uk
  • uz
  • vi
  • zh_CN
  • zh_TW

Thanks ^_^

@hustcc hustcc changed the title Italian locale needed locale translations are needed Sep 12, 2016
hustcc pushed a commit that referenced this issue Sep 12, 2016
hustcc pushed a commit that referenced this issue Sep 12, 2016
hustcc pushed a commit that referenced this issue Sep 12, 2016
@hustcc hustcc reopened this Sep 12, 2016
hustcc pushed a commit that referenced this issue Sep 12, 2016
* Add Thai locale
* Fix README.md typo
hustcc pushed a commit that referenced this issue Sep 13, 2016
Updating portuguese version of "Just now" label to something more close to the english version.

Current translation:
"há pouco" => "some time ago" (it gives a notion of little time ago, but now of "just now")

After this PR:
"agora mesmo" => "just now"
This was referenced Sep 13, 2016
This was referenced Sep 13, 2016
@NicoJuicy NicoJuicy mentioned this issue Sep 13, 2016
hustcc pushed a commit that referenced this issue Sep 13, 2016
niklasf added a commit to niklasf/timeago.js that referenced this issue Dec 5, 2017
@craftystudio
Copy link

Polish locale has mistakes @jcubic .

@jcubic
Copy link
Contributor

jcubic commented Apr 23, 2019

@craftystudio what mistakes?

@hustcc hustcc pinned this issue Oct 12, 2019
@alexbutav
Copy link

alexbutav commented Apr 22, 2020

Russian locale doesn't work
post.timePassed = timeago.format(new Date(dateStringUTC), 'ru');
echoes 4 hours ago
while zh_CN locale echoes 4 小时前

@lolobosse
Copy link

@alexbutav I could reproduce your issue by using a CDN. Is that what you did?

Actually I didn't know how it works (I'm the maintainer of the python version) and I had the same error.

If you look at CDNJS (for instance), you will see following:

image

The min version only contains en and zh. I guess that this is related to #204

I took the full and ru was working:

image

@alexbutav
Copy link

alexbutav commented Apr 22, 2020

Greetings. No, i didn't use CDN, i installed it with npm

"dependencies": {
        "axios": "^0.19",
        "chart.js": "^2.9.3",
        "js-cookie": "^2.2.1",
        "json-bigint": "^0.3.0",
        "laravel-echo": "^1.7.0",
        "laravel-echo-server": "^1.6.1",
        "nanobar": "^0.4.2",
        "timeago.js": "^4.0.2",
        "socket.io-client": "^2.3.0",
        "vue": "^2.6.11",
        "vue-analytics": "^5.22.1",
        "vue-i18n": "^8.12.0",
        "vue-router": "^3.1.5",
        "vuex": "^3.1.2"
    }

then imported in Vue Component
import * as timeago from 'timeago.js';
build with webpack
and then run

For now i took original ru locale and adapted it according to the doc. So after importing of timeago.js i register it manually:

    import localeRU from '../library/timeago_ru';
    timeago.register('ru', localeRU);

timeago_ru,js

function formatNum(f1, f, s, t, n) {
    const n10 = n % 10;
    let str = t;

    if (n === 1) {
        str = f1;
    } else if (n10 === 1 && n > 20) {
        str = f;
    } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
        str = s;
    }

    return str;
}
const seconds = formatNum.bind(null, 'секунду', '%s секунду', '%s секунды', '%s секунд'),
    minutes = formatNum.bind(null, 'минуту', '%s минуту', '%s минуты', '%s минут'),
    hours = formatNum.bind(null, 'час', '%s час', '%s часа', '%s часов'),
    days = formatNum.bind(null, 'день', '%s день', '%s дня', '%s дней'),
    weeks = formatNum.bind(null, 'неделю', '%s неделю', '%s недели', '%s недель'),
    months = formatNum.bind(null, 'месяц', '%s месяц', '%s месяца', '%s месяцев'),
    years = formatNum.bind(null, 'год', '%s год', '%s года', '%s лет');

    export default function(number, index, totalSec) {
    // number: the time ago / time in number;
    // index: the index of array below;
    // totalSec: total seconds between date to be formatted and today's date;
    return [
        ['только что', 'через несколько секунд'],
        [seconds(number) + ' назад', 'через ' + seconds(number)],
        [minutes(number) + ' назад', 'через ' + minutes(number)],
        [minutes(number) + ' назад', 'через ' + minutes(number)],
        [hours(number) + ' назад', 'через ' + hours(number)],
        [hours(number) + ' назад', 'через ' + hours(number)],
        ['вчера', 'завтра'],
        [days(number) + ' назад', 'через ' + days(number)],
        [weeks(number) + ' назад', 'через ' + weeks(number)],
        [weeks(number) + ' назад', 'через ' + weeks(number)],
        [months(number) + ' назад', 'через ' + months(number)],
        [months(number) + ' назад', 'через ' + months(number)],
        [years(number) + ' назад', 'через ' + years(number)],
        [years(number) + ' назад', 'через ' + years(number)],
    ][index];
};

Interesting thing is that i can see 'ru' locale installed with package inside lib directory
Аннотация 2020-04-22 200434

@lolobosse
Copy link

Is that not what you're looking for? #175 (comment)

Found it, might be an idea to add it to the documentation
import { nl as locale_NL } from 'timeago.js/lib/lang';

So I would import it and then register it (without copying the locale code)

@alexbutav
Copy link

Feel myself very stupid... great thanks!

@gnurgeldiyev
Copy link
Contributor

Hey, @hustcc I just added tk locale.

here is the PR #220

@idc77
Copy link

idc77 commented Dec 23, 2022

#259 hr, rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants