-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Localisation issues in sk.js
(Slovak)
#831
Comments
Thanks. It will be great if you could send us a PR to fix this. And there will be a patch release this weekend.
|
Okay, I’ll tend it now.
Okay, I accept that. However, can’t we add another variable (or whatever you call it, like the |
You can use https://day.js.org/docs/en/plugin/update-locale to suit your need in your project easily/ |
Thanks. Laste question: should I open a PR against the |
Yes, from the dev branch, please. And you can check test/locale/cs.test.js as a reference to make the test pass with 100% coverage. |
I’ll do my best. I What do you think? const T = [
[44.4, 'second'], // a few seconds ← Are `44.4s` considered _a few seconds_?
[89.5, 'second'], // a minute ← Are `89.5s` seconds _a minute_?
// ...
[43, 'minute'], // 44 minutes ← I don’t think that `43` = `44`.
[45, 'minute'], // an hour ← I don’t think that `45m` = `1h`.
// ...
[18, 'month'] // 2 years ← I don’t think that `18mo` = `2y`.
] |
Ha, that's the relative time result in English. And 44 minutes -> should be 43 minutes. Fell free to fix it if you like 😁 |
Okay. Just to confirm: only |
Yes, cheers. You can skip these comments in your test file if you like. |
I see. In order to fix |
Anyway, does week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
} |
I have open moment/moment#5408 issue and created moment/moment#5409 PR, but there are some Travis issues I could not fix. |
Yes, https://day.js.org/docs/en/customization/customization weekStart, yearStart |
Plus, how about we just keep the same result as moment.js at first, to get CI passed with 100% coverage, and release it in this week. After that, we could keep fixing this minor error. |
And you can run |
yearStart: 4, // OPTIONAL, the week that contains Jan 4th is the first week of the year. Is |
|
I have run FAIL test/plugin/utc-utcOffset.test.js
● utc startOf
expect(received).toBe(expected) // Object.is equality
Expected value to be:
1568213999999
Received:
1568217599999
94 | expect(moment(d).utc().utcOffset(480).endOf('day')
95 | .valueOf())
> 96 | .toBe(dayjs(d).utc().utcOffset(480).endOf('day')
97 | .valueOf())
98 |
99 | expect(moment(d).utc().utcOffset(480).endOf('day')
at Object.<anonymous> (test/plugin/utc-utcOffset.test.js:96:6) |
Please add |
wired 😬 |
And now, when I wanted to fix another l10n (I have missed translating $ git commit -am 'Fix `dny` issue'
/home/ts/git/c10n/dayjs/src/index.js
1:20 error Missing file extension "js" for "./constant" import/extensions
2:15 error Missing file extension "js" for "./utils" import/extensions
3:16 error Missing file extension "js" for "./locale/en" import/extensions
/home/ts/git/c10n/dayjs/src/locale/sk.js
71:23 error Multiple spaces found before '// Should be `...' no-multi-spaces
/home/ts/git/c10n/dayjs/src/plugin/advancedFormat/index.js
1:32 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/buddhistEra/index.js
1:32 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/isoWeek/index.js
1:25 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/localizedFormat/index.js
1:32 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/quarterOfYear/index.js
1:25 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/relativeTime/index.js
1:20 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/utc/index.js
1:44 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/plugin/weekOfYear/index.js
1:29 error Missing file extension "js" for "../../constant" import/extensions
/home/ts/git/c10n/dayjs/src/utils.js
1:20 error Missing file extension "js" for "./constant" import/extensions
/home/ts/git/c10n/dayjs/test/comparison.test.js
2:19 error Missing file extension "js" for "../src" import/extensions
/home/ts/git/c10n/dayjs/test/constructor.test.js
2:19 error Missing file extension "js" for "../src" import/extensions
/home/ts/git/c10n/dayjs/test/display.test.js
3:19 error Missing file extension "js" for "../src" import/extensions
4:16 error Missing file extension "js" for "../src/locale/th" import/extensions
5:8 error Missing file extension "js" for "../src/locale/ja" import/extensions
/home/ts/git/c10n/dayjs/test/get-set.test.js
3:19 error Missing file extension "js" for "../src" import/extensions
/home/ts/git/c10n/dayjs/test/locale/cs.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/cs" import/extensions
/home/ts/git/c10n/dayjs/test/locale/et.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/et" import/extensions
/home/ts/git/c10n/dayjs/test/locale/fi.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/fi" import/extensions
/home/ts/git/c10n/dayjs/test/locale/keys.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
/home/ts/git/c10n/dayjs/test/locale/pl.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/pl" import/extensions
/home/ts/git/c10n/dayjs/test/locale/ru.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/ru" import/extensions
/home/ts/git/c10n/dayjs/test/locale/sk.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/sk" import/extensions
/home/ts/git/c10n/dayjs/test/locale/sv.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:28 error Missing file extension "js" for "../../src/plugin/advancedFormat" import/extensions
4:8 error Missing file extension "js" for "../../src/locale/sv" import/extensions
/home/ts/git/c10n/dayjs/test/locale/uk.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/uk" import/extensions
/home/ts/git/c10n/dayjs/test/locale/zh-cn.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/locale/zh.test.js
1:19 error Missing file extension "js" for "../../src" import/extensions
2:28 error Missing file extension "js" for "../../src/plugin/advancedFormat" import/extensions
3:24 error Missing file extension "js" for "../../src/plugin/weekOfYear" import/extensions
/home/ts/git/c10n/dayjs/test/locale.test.js
3:19 error Missing file extension "js" for "../src" import/extensions
4:16 error Missing file extension "js" for "../src/locale/es" import/extensions
/home/ts/git/c10n/dayjs/test/manipulate.test.js
3:19 error Missing file extension "js" for "../src" import/extensions
4:8 error Missing file extension "js" for "../src/locale/zh-cn" import/extensions
5:8 error Missing file extension "js" for "../src/locale/ar" import/extensions
/home/ts/git/c10n/dayjs/test/parse.test.js
3:19 error Missing file extension "js" for "../src" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/advancedFormat.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:28 error Missing file extension "js" for "../../src/plugin/advancedFormat" import/extensions
5:24 error Missing file extension "js" for "../../src/plugin/weekOfYear" import/extensions
6:22 error Missing file extension "js" for "../../src/plugin/weekYear" import/extensions
7:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/badMutable.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:24 error Missing file extension "js" for "../../src/plugin/badMutable" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/buddhistEra.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:25 error Missing file extension "js" for "../../src/plugin/buddhistEra" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/calendar.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:22 error Missing file extension "js" for "../../src/plugin/calendar" import/extensions
5:18 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/customParseFormat.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:31 error Missing file extension "js" for "../../src/plugin/customParseFormat" import/extensions
5:16 error Missing file extension "js" for "../../src/locale/uk" import/extensions
6:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/dayOfYear.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:23 error Missing file extension "js" for "../../src/plugin/dayOfYear" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isBetween.test.js
2:19 error Missing file extension "js" for "../../src/index" import/extensions
3:23 error Missing file extension "js" for "../../src/plugin/isBetween/index" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isLeapYear.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:24 error Missing file extension "js" for "../../src/plugin/isLeapYear" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isMoment.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:22 error Missing file extension "js" for "../../src/plugin/isMoment" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isoWeek.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:21 error Missing file extension "js" for "../../src/plugin/isoWeek" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isoWeeksInYear.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:28 error Missing file extension "js" for "../../src/plugin/isoWeeksInYear" import/extensions
4:24 error Missing file extension "js" for "../../src/plugin/isLeapYear" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isSameOrAfter.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:27 error Missing file extension "js" for "../../src/plugin/isSameOrAfter" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/isSameOrBefore.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:28 error Missing file extension "js" for "../../src/plugin/isSameOrBefore" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/localeData.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:24 error Missing file extension "js" for "../../src/plugin/localeData" import/extensions
5:29 error Missing file extension "js" for "../../src/plugin/localizedFormat" import/extensions
6:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/localizedFormat.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:16 error Missing file extension "js" for "../../src/locale/es" import/extensions
5:18 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
6:29 error Missing file extension "js" for "../../src/plugin/localizedFormat" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/minMax.test.js
2:19 error Missing file extension "js" for "../../src" import/extensions
3:20 error Missing file extension "js" for "../../src/plugin/minMax" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/quarterOfYear.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:27 error Missing file extension "js" for "../../src/plugin/quarterOfYear" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/relativeTime.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/relativeTime" import/extensions
5:17 error Missing file extension "js" for "../../src/plugin/utc" import/extensions
6:8 error Missing file extension "js" for "../../src/locale/ru" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/toArray.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:21 error Missing file extension "js" for "../../src/plugin/toArray" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/toObject.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:22 error Missing file extension "js" for "../../src/plugin/toObject" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/updateLocale.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:26 error Missing file extension "js" for "../../src/plugin/updateLocale" import/extensions
5:29 error Missing file extension "js" for "../../src/plugin/localizedFormat" import/extensions
6:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/utc-utcOffset.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:17 error Missing file extension "js" for "../../src/plugin/utc" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/utc.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:17 error Missing file extension "js" for "../../src/plugin/utc" import/extensions
5:31 error Missing file extension "js" for "../../src/plugin/customParseFormat" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/weekday.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:21 error Missing file extension "js" for "../../src/plugin/weekday" import/extensions
5:8 error Missing file extension "js" for "../../src/locale/zh-cn" import/extensions
6:8 error Missing file extension "js" for "../../src/locale/ar" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/weekOfYear.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:24 error Missing file extension "js" for "../../src/plugin/weekOfYear" import/extensions
5:28 error Missing file extension "js" for "../../src/plugin/advancedFormat" import/extensions
6:8 error Missing file extension "js" for "../../src/locale/en-gb" import/extensions
/home/ts/git/c10n/dayjs/test/plugin/weekYear.test.js
3:19 error Missing file extension "js" for "../../src" import/extensions
4:22 error Missing file extension "js" for "../../src/plugin/weekYear" import/extensions
5:24 error Missing file extension "js" for "../../src/plugin/weekOfYear" import/extensions
/home/ts/git/c10n/dayjs/test/plugin.test.js
2:19 error Missing file extension "js" for "../src" import/extensions
/home/ts/git/c10n/dayjs/test/query.test.js
2:19 error Missing file extension "js" for "../src" import/extensions
/home/ts/git/c10n/dayjs/test/timezone.test.js
3:19 error Missing file extension "js" for "../src" import/extensions
4:17 error Missing file extension "js" for "../src/plugin/utc" import/extensions
/home/ts/git/c10n/dayjs/test/utils.test.js
1:19 error Missing file extension "js" for "../src/utils" import/extensions
✖ 134 problems (134 errors, 0 warnings)
1 error, 0 warnings potentially fixable with the `--fix` option.
pre-commit:
pre-commit: We've failed to pass the specified git pre-commit hooks as the `lint`
pre-commit: hook returned an exit code (1). If you're feeling adventurous you can
pre-commit: skip the git pre-commit hooks by adding the following flags to your commit:
pre-commit:
pre-commit: git commit -n (or --no-verify)
pre-commit:
pre-commit: This is ill-advised since the commit is broken. |
looks like your es-lint issue? |
I run I’ve just run $ npm install eslint
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN rollup-plugin-babel@4.4.0 requires a peer of rollup@>=0.60.0 <3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ eslint@4.19.1
updated 1 package and audited 31231 packages in 23.842s
25 packages are looking for funding
run `npm fund` for details
found 78 vulnerabilities (69 low, 8 moderate, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details |
When I run .git/hooks/pre-commit: line 2: ./node_modules/pre-commit/hook: No such file or directory Therefore, I have removed Anyway, here’s the output of
|
The |
Moment seems to be unmaintained, see moment/moment#5405. Therefore we might wait for the fix in vain. |
can we give them 1 month first 😬 , then we could update it ourself |
The month is up and there is no pulse in the Moment repo (only new open issues and PRs). I think we should not rely on Moment output anymore as there are many unfixed bugs (just open their issues and PRs to see what I mean). I think we should fix those issues in I think that we/I should open a separate issue here to address the Moment comparison removal from Update: Here’s an issue that was opened on 6 March 2020 that asks if Moment is still maintained: moment/moment#5405 |
Yes, I do agree. Let's fix it on our side. 😁 |
How would you like it do it? 😃 |
You can create a pull request with the change, and I can help update the test accordingly. Just leave a comment with the correct result. |
@iamkun, sorry I could not find time to contribute the fix yet. In the meanwhile, one of the team members of Moment responded in moment/moment#5405 if Moment is still maintaned and also there were some new commits made. On the other hand, @k2s user pointed out that my implementation is not entirely correct. Basically, both
Then that user proposed a 'solution': I have no idea how to deal with this issue. PS - It seems that the Moment devs are currently opposed to the correction of this issue, but I hope it'll change. |
@tukusejssirs there's might another way, just make your own locale file at this time. |
Thanks. But I have troubles with the algorithm: how can I determine (without sentence/context) if in [a period of time] is a period during which is something done (then |
@tukusejssirs https://day.js.org/docs/en/customization/relative-time#additional-token-processing You can leave the future field |
Related #302 #4
There are some issues in
sk.js
:ordinal: n => `${n}º`,
→ordinal: n => `${n}.`,
:L: 'DD.MM.YYYY',
→L: 'DD. MM. YYYY',
:weekdays: 'Nedeľa_Pondelok_Utorok_Streda_Štvrtok_Piatok_Sobota'.split('_'),
→weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
weekdaysShort: 'Ne_Po_Ut_St_Št_Pi_So'.split('_'),
→weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
.Then there is as an issue with the the numbers of and declension of the nouns (see also #302). The grammatical rules in Slovak are quite similar to those in Czech, therefore I have just copied the
plural()
andtranslate()
functions from there and replaced the nouns with the Slovak ones. I would open a PR with this, but I am not a good coder, therefore this must be reviewed.All in all, here is the proposed content of
sk.js
. I hope I did not made any mistakes. I have added some comments to make it easier to check if the words are really those that should be assigned to the particular key.sk.js
PS—@prantlf, can I ask you to check the
translate()
function? Thanks in advance! 😃The text was updated successfully, but these errors were encountered: