-
-
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
Add initial version of Latin locale #966
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #966 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 172 175 +3
Lines 1547 1641 +94
Branches 328 359 +31
=========================================
+ Hits 1547 1641 +94
Continue to review full report at Codecov.
|
There's no need to create a unit test compared with moment.js's result. Just compare with normal string, please. |
- fix outputing month names in nominative and genitive cases; - add full stop (`.`) after `monthsShort` values; - move `isNaN()` test at the beginning of `romanise()` function; - revert romanising years as it does not work ATM; - add tests of: - names of months in nominative and genitive; - relatime time (based on `cs.test.js`).
I have updated this PR with additional tests. I tried to create tests for everything in
|
@iamkun, okay, I’ve found the cause of the non-100-% issue: Anyway, now the code is working, passes all tests ( As a sidenote/question: could I open a new issue for dom/month/year romanisation that would be done within |
Added a commit with small update: now |
Is there anything that blocks this PR from being merged? Is there anything else I need to do before this PR could be merged? |
Cool, thx. Waiting for native speaker review ( 0 / 1 ) |
@iamkun, I see. @igneus, could you review this PR from the linguistic point of view? We (the romcal dev/users) need this merged, because otherwise Some notes to guide to in the review to do it real quick:
PS—@igneus, sorry if I the above description is too detailed, however, I wish you’d find some time to review this PR ASAP. However, I don’t want to hurry you nor push you into anything. 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through the code and tests and so far haven't found any obvious errors.
But it has to be clearly said that the authority of my approval is quite low. I'm just a theologian, no Latin expert, and without any training in "modern Latinity".
ordinal: n => [romanise(n), 'ᵒ'].join(''), | ||
// The relative time variables are in nominative case only | ||
relativeTime: { | ||
future: 'ad %s', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Yes, I'm lazy to install the library, understand it and try myself.)
@tukusejssirs would you please post one (preferably non-trivial) example for both relative time in future and in the past?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see the output in the locale test (L64-80), in the T
constant (it is a multi-dimensional array consisting of [number, 'English word', 'number Latin word']
; I think it is quite readable 😉).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it isn't readable. It's code, DRY as a desert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, here’s a simple ‘conversion‘ table:
English | Latin |
---|---|
a few seconds | paucæ secundæ |
a minute | minuta |
2-∞ minutes | 2-∞ minutæ |
an hour | hora |
2-∞ hours | 2-∞ horæ |
a day | dies |
2-∞ days | 2-∞ dies |
a month | mensis |
2-∞ months | 2-∞ menses |
a year | annus |
2-∞ years | 2-∞ anni |
Update: I have updated the table to better reflect that the plural forms are used for any number from 2-∞
interval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pinging you, @igneus. When you find some time, please check the table above if it is sufficiently readable for you. All other issues you raised were fixed in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'll manage to communicate what I really wanted to see, so I cloned your repo and checked out the latin
branch with hope that I will be able to play with the code myself, but it turns out that my NodeJS skills don't suffice to load the package from development sources.
I ran npm run-script build
, managed to load dayjs.min.js
in the interactive console (var dayjs = require('dayjs.min.js');
), but attempts to load locales fail, probably due to my lack of understanding of some basic NodeJS concepts.
Since I personally don't care much about dayjs' Latin locale, I probably just give up and 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'll manage to communicate what I really wanted to see
I’m sorry I didn’t understand you. Anyway, I still think that you proofed everything in the Latin locale except for those string in the ‘conversion’ table.
Anyway, in the Czech locale, they use different inflection of those strings when they are used in the past (e.g. a few seconds ago
) or future tense (in a few seconds
). If any of the strings from relativeTime
should be in different grammar case in the past and future tenses, we would need to update it accordingly.
I cloned your repo and checked out the
latin
branch with hope that I will be able to play with the code myself, but it turns out that my NodeJS skills don't suffice to load the package from development sources.
All you should need to do after cloning the repo is as follows:
# Install the dependencies
npm install
# Build `dayjs`
# Note: This is same as running `npm run-script build`
npm run build
# Run the `la.test.js` test
# Note: Run the following command from repo root or modify both relative paths
node node_modules/jest/bin/jest.js test/locale/la.test.js --coverage=false
I think the easiest way to test things without any deeper knowledge of Node.js, it to modify the test/locale/la.test.js
to include console.log()
command(s), where you put the output of whatever you want to see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I personally don't care much about dayjs' Latin locale, I probably just give up and see_no_evil
Pinging @igneus. Are you determined to give up on this review? As I understand it, you have not reviewed only one part, the relativeTime
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping, @igneus. No answer from you for more than a month. I presume you are occupied with some other stuff, however, I’d be very happy if you at least say something. 😉 Thanks in advance with all your help! 😃
Thanks, @igneus, for such a prompt review! 👍
IMHO, still better a review than no review. 😉 Anyway, I aim this PR to add Ecclesiastical Latin, i.e. one used in the current (port Vatican II) liturgical books. |
- remove `ᵒ` from ordinal numbers; - use lowercase first letter in `dominica` and `sabbato`.
Fixes #961