aboutsummaryrefslogtreecommitdiffstats
path: root/library/moment/src/locale/lv.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-11-18 23:50:42 +0100
committerMario Vavti <mario@mariovavti.com>2015-11-18 23:50:42 +0100
commite4145deeb7a72ac321113fde672e1b499ecb0d2d (patch)
treece2fb59fd9d2ec1d13ea0960215967600098ca13 /library/moment/src/locale/lv.js
parent68da4d90dcbda1240ae014768a66a164fd5d2b36 (diff)
downloadvolse-hubzilla-e4145deeb7a72ac321113fde672e1b499ecb0d2d.tar.gz
volse-hubzilla-e4145deeb7a72ac321113fde672e1b499ecb0d2d.tar.bz2
volse-hubzilla-e4145deeb7a72ac321113fde672e1b499ecb0d2d.zip
some events refacturing
Diffstat (limited to 'library/moment/src/locale/lv.js')
-rw-r--r--library/moment/src/locale/lv.js87
1 files changed, 87 insertions, 0 deletions
diff --git a/library/moment/src/locale/lv.js b/library/moment/src/locale/lv.js
new file mode 100644
index 000000000..53aec40de
--- /dev/null
+++ b/library/moment/src/locale/lv.js
@@ -0,0 +1,87 @@
+//! moment.js locale configuration
+//! locale : latvian (lv)
+//! author : Kristaps Karlsons : https://github.com/skakri
+//! author : Jānis Elmeris : https://github.com/JanisE
+
+import moment from '../moment';
+
+var units = {
+ 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
+ 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
+ 'h': 'stundas_stundām_stunda_stundas'.split('_'),
+ 'hh': 'stundas_stundām_stunda_stundas'.split('_'),
+ 'd': 'dienas_dienām_diena_dienas'.split('_'),
+ 'dd': 'dienas_dienām_diena_dienas'.split('_'),
+ 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
+ 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
+ 'y': 'gada_gadiem_gads_gadi'.split('_'),
+ 'yy': 'gada_gadiem_gads_gadi'.split('_')
+};
+/**
+ * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
+ */
+function format(forms, number, withoutSuffix) {
+ if (withoutSuffix) {
+ // E.g. "21 minūte", "3 minūtes".
+ return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];
+ } else {
+ // E.g. "21 minūtes" as in "pēc 21 minūtes".
+ // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
+ return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];
+ }
+}
+function relativeTimeWithPlural(number, withoutSuffix, key) {
+ return number + ' ' + format(units[key], number, withoutSuffix);
+}
+function relativeTimeWithSingular(number, withoutSuffix, key) {
+ return format(units[key], number, withoutSuffix);
+}
+function relativeSeconds(number, withoutSuffix) {
+ return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
+}
+
+export default moment.defineLocale('lv', {
+ months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
+ weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
+ weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
+ weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY.',
+ LL : 'YYYY. [gada] D. MMMM',
+ LLL : 'YYYY. [gada] D. MMMM, HH:mm',
+ LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
+ },
+ calendar : {
+ sameDay : '[Šodien pulksten] LT',
+ nextDay : '[Rīt pulksten] LT',
+ nextWeek : 'dddd [pulksten] LT',
+ lastDay : '[Vakar pulksten] LT',
+ lastWeek : '[Pagājušā] dddd [pulksten] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'pēc %s',
+ past : 'pirms %s',
+ s : relativeSeconds,
+ m : relativeTimeWithSingular,
+ mm : relativeTimeWithPlural,
+ h : relativeTimeWithSingular,
+ hh : relativeTimeWithPlural,
+ d : relativeTimeWithSingular,
+ dd : relativeTimeWithPlural,
+ M : relativeTimeWithSingular,
+ MM : relativeTimeWithPlural,
+ y : relativeTimeWithSingular,
+ yy : relativeTimeWithPlural
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ 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.
+ }
+});
+