Hi, Latin speakers!
For romcal project, I need to add Latin locale to dayjs library. I should have no problem with the implementation, but my Latin is not that good that I would trust my translation, therefore I’d like to ask you all to proof the following phrases. Note that my primary usage of the Latin locale is within Roman Catholic Church, therefore I have chosen to use feria weekday names (with Dominica for Sunday and Sabbato for Saturday) instead of the dies weekday names (for more info, see the Hebdomas Wikipedia article).
Here I list some points that I need to have double-checked if there are true.
And for those you can read some code, here’s the current version of the dayjs Latin locale:
For romcal project, I need to add Latin locale to dayjs library. I should have no problem with the implementation, but my Latin is not that good that I would trust my translation, therefore I’d like to ask you all to proof the following phrases. Note that my primary usage of the Latin locale is within Roman Catholic Church, therefore I have chosen to use feria weekday names (with Dominica for Sunday and Sabbato for Saturday) instead of the dies weekday names (for more info, see the Hebdomas Wikipedia article).
Here I list some points that I need to have double-checked if there are true.
- From what I have seen in the Church documents, in Latin we use Roman numerals in weekdays (if not spelled out; i.e. feria II or feria secunda), in days of month (e.g. die XX Decembris) and years (e.g. AD MMXX).
- Month names have the first letter always in uppercase (i.e. September, not september).
- In dates, the day of months should be followed by month name.
- In dates, month name is always in genitive.
- In time (like 13:23), it is okay to use Arabic numerals (I don’t think that in the Ancient Rome, they used any kind of time format like this, but then Latin is used even today, but I could not find any proof on how to format the time in Latin).
- A minute is currently translated as minutum and a second to secundum (as opposed to the historic pars minuta prima and pars minuta secunda, respectively).
- Finally, I need to proof the following phrases if they are grammatically always (i.e. for any number greater than 1) correct (the words in the square brackets should give you some context when that particular phrase would be used within dayjs library; English phrase is followed by Latin phrase separated by an equals sign):
- in NUMBER [in the future] = in NUMBER;
- NUMBER ago [in the past] = ante NUMBER;
- [a] minute [Nominative singular] = minutum;
- NUMBER minutes [Nominative plural] = NUMBER minuta;
- [an] hour [Nominative singular] = hora;
- NUMBER hours [Nominative plural] = NUMBER horae;
- [a] day [Nominative singular] = dies;
- NUMBER days [Nominative plural] = NUMBER dies;
- [a] month [Nominative singular] = mensis;
- NUMBER months [Nominative plural] = NUMBER menses;
- [a] year [Nominative singular] = annus;
- NUMBER years [Nominative plural] = NUMBER anni.
And for those you can read some code, here’s the current version of the dayjs Latin locale:
JavaScript:
// Latin [la]
import dayjs from 'dayjs'
// src: https://stackoverflow.com/a/9083076
function romanise(num) {
if (isNaN(num))
return NaN;
var digits = String(+num).split(''),
key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM',
'', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC',
'', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
roman = '',
i = 3;
while (i--)
roman = (key[+digits.pop() + (i * 10)] || '') + roman;
return Array(+digits.join('') + 1).join('M') + roman;
}
function getMonthInGenitive(month) {
switch(month) {
case 'Ianuarius':
return 'Ianuarii'
case 'Februarius':
return 'Februarii'
case 'Martius':
return 'Martii'
case 'Aprilis':
return 'Aprilis'
case 'Maius':
return 'Maii'
case 'Iunius':
return 'Iunii'
case 'Iulius':
return 'Iulii'
case 'Augustus':
return 'Augusti'
case 'September':
return 'Septembris'
case 'October':
return 'Octobris'
case 'November':
return 'Novembris'
case 'December':
return 'Decembris'
}
}
const locale = {
name: 'la',
weekdays: 'Dominica_feria secunda_feria tertia_feria quarta_feria quinta_feria sexta_Sabbato'.split('_'),
weekdaysShort: 'Dominica_feria II_feria III_feria IV_feria V_feria VI_Sabbato'.split('_'),
weekdaysMin: 'Dom._II_III_IV_V_VI_Sab.'.split('_'),
months: 'Ianuarius_Februarius_Martius_Aprilis_Maius_Iunius_Iulius_Augustus_September_October_November_December'.split('_'),
monthsShort: 'Ian_Feb_Mar_Apr_Mai_Iun_Iul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekStart: 0,
yearStart: 4,
ordinal: n => `${romanise(n)}ᵒ`,
// The relative time variables are in Nominative case only
relativeTime: {
future: `in ${romanise(%s)}`,
past: `ante ${romanise(%s)}`,
// s: 'a few seconds', // secundum, secunda
m: 'minutum',
mm: `${romanise(%d)} minuta`,
h: 'hora',
hh: `${romanise(%d)} horæ`,
d: 'dies',
dd: `${romanise(%d)} dies`,
M: 'mensis',
MM: `${romanise(%d)} menses`,
y: 'annus',
yy: `${romanise(%d)} anni`
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: `${romanise(D)} MM. ${romanise(YYYY)}`,
LL: `${romanise(D)} ${getMonthInGenitive(MMMM)} ${romanise(YYYY)}`,
LLL: `${romanise(D)} ${getMonthInGenitive(MMMM)} ${romanise(YYYY)} HH:mm`,
LLLL: `dddd, ${romanise(D)} ${getMonthInGenitive(MMMM)} ${romanise(YYYY)} HH:mm`
}
}
dayjs.locale(locale, null, true)
export default locale