Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d8e2850
commit 41c494b
Showing
7 changed files
with
776 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
var formatDistanceLocale = { | ||
lessThanXSeconds: { | ||
one: 'ավելի քիչ քան 1 վայրկյան', | ||
other: 'ավելի քիչ քան {{count}} վայրկյան' | ||
}, | ||
xSeconds: { | ||
one: '1 վայրկյան', | ||
other: '{{count}} վայրկյան' | ||
}, | ||
halfAMinute: 'կես րոպե', | ||
lessThanXMinutes: { | ||
one: 'ավելի քիչ քան 1 րոպե', | ||
other: 'ավելի քիչ քան {{count}} րոպե' | ||
}, | ||
xMinutes: { | ||
one: '1 րոպե', | ||
other: '{{count}} րոպե' | ||
}, | ||
aboutXHours: { | ||
one: 'մոտ 1 ժամ', | ||
other: 'մոտ {{count}} ժամ' | ||
}, | ||
xHours: { | ||
one: '1 ժամ', | ||
other: '{{count}} ժամ' | ||
}, | ||
xDays: { | ||
one: '1 օր', | ||
other: '{{count}} օր' | ||
}, | ||
aboutXMonths: { | ||
one: 'մոտ 1 ամիս', | ||
other: 'մոտ {{count}} ամիս' | ||
}, | ||
xMonths: { | ||
one: '1 ամիս', | ||
other: '{{count}} ամիս' | ||
}, | ||
aboutXYears: { | ||
one: 'մոտ 1 տարի', | ||
other: 'մոտ {{count}} տարի' | ||
}, | ||
xYears: { | ||
one: '1 տարի', | ||
other: '{{count}} տարի' | ||
}, | ||
overXYears: { | ||
one: 'ավելի քան 1 տարի', | ||
other: 'ավելի քան {{count}} տարի' | ||
}, | ||
almostXYears: { | ||
one: 'համարյա 1 տարի', | ||
other: 'համարյա {{count}} տարի' | ||
} | ||
} | ||
|
||
export default function formatDistance(token, count, options) { | ||
options = options || {} | ||
var result | ||
|
||
if (typeof formatDistanceLocale[token] === 'string') { | ||
result = formatDistanceLocale[token] | ||
} else if (count === 1) { | ||
result = formatDistanceLocale[token].one | ||
} else { | ||
result = formatDistanceLocale[token].other.replace('{{count}}', count) | ||
} | ||
|
||
if (options.addSuffix) { | ||
if (options.comparison > 0) { | ||
return result + ' հետո' | ||
} else { | ||
return result + ' առաջ' | ||
} | ||
} | ||
|
||
return result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js' | ||
|
||
var dateFormats = { | ||
full: 'd MMMM, y, EEEE', | ||
long: 'd MMMM, y', | ||
medium: 'd MMM, y', | ||
short: 'dd.MM.yyyy' | ||
} | ||
var timeFormats = { | ||
full: 'HH:mm:ss zzzz', | ||
long: 'HH:mm:ss z', | ||
medium: 'HH:mm:ss', | ||
short: 'HH:mm' | ||
} | ||
var dateTimeFormats = { | ||
full: "{{date}} 'ժ․'{{time}}", | ||
long: "{{date}} 'ժ․'{{time}}", | ||
medium: '{{date}}, {{time}}', | ||
short: '{{date}}, {{time}}' | ||
} | ||
|
||
var formatLong = { | ||
date: buildFormatLongFn({ | ||
formats: dateFormats, | ||
defaultWidth: 'full' | ||
}), | ||
time: buildFormatLongFn({ | ||
formats: timeFormats, | ||
defaultWidth: 'full' | ||
}), | ||
dateTime: buildFormatLongFn({ | ||
formats: dateTimeFormats, | ||
defaultWidth: 'full' | ||
}) | ||
} | ||
export default formatLong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var formatRelativeLocale = { | ||
lastWeek: "'նախորդ' eeee p'֊ին'", | ||
yesterday: "'երեկ' p'֊ին'", | ||
today: "'այսօր' p'֊ին'", | ||
tomorrow: "'վաղը' p'֊ին'", | ||
nextWeek: "'հաջորդ' eeee p'֊ին'", | ||
other: 'P' | ||
} | ||
|
||
export default function formatRelative(token, _date, _baseDate, _options) { | ||
return formatRelativeLocale[token] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index.js' | ||
|
||
var eraValues = { | ||
narrow: ['Ք', 'Մ'], | ||
abbreviated: ['ՔԱ', 'ՄԹ'], | ||
wide: ['Քրիստոսից առաջ', 'Մեր թվարկության'] | ||
} | ||
var quarterValues = { | ||
narrow: ['1', '2', '3', '4'], | ||
abbreviated: ['Ք1', 'Ք2', 'Ք3', 'Ք4'], | ||
wide: ['1֊ին քառորդ', '2֊րդ քառորդ', '3֊րդ քառորդ', '4֊րդ քառորդ'] | ||
} | ||
var monthValues = { | ||
narrow: ['Հ', 'Փ', 'Մ', 'Ա', 'Մ', 'Հ', 'Հ', 'Օ', 'Ս', 'Հ', 'Ն', 'Դ'], | ||
abbreviated: [ | ||
'հուն', | ||
'փետ', | ||
'մար', | ||
'ապր', | ||
'մայ', | ||
'հուն', | ||
'հուլ', | ||
'օգս', | ||
'սեպ', | ||
'հոկ', | ||
'նոյ', | ||
'դեկ' | ||
], | ||
wide: [ | ||
'հունվար', | ||
'փետրվար', | ||
'մարտ', | ||
'ապրիլ', | ||
'մայիս', | ||
'հունիս', | ||
'հուլիս', | ||
'օգոստոս', | ||
'սեպտեմբեր', | ||
'հոկտեմբեր', | ||
'նոյեմբեր', | ||
'դեկտեմբեր' | ||
] | ||
} | ||
var dayValues = { | ||
narrow: ['Կ', 'Ե', 'Ե', 'Չ', 'Հ', 'Ո', 'Շ'], | ||
short: ['կր', 'եր', 'եք', 'չք', 'հգ', 'ուր', 'շբ'], | ||
abbreviated: ['կիր', 'երկ', 'երք', 'չոր', 'հնգ', 'ուրբ', 'շաբ'], | ||
wide: [ | ||
'կիրակի', | ||
'երկուշաբթի', | ||
'երեքշաբթի', | ||
'չորեքշաբթի', | ||
'հինգշաբթի', | ||
'ուրբաթ', | ||
'շաբաթ' | ||
] | ||
} | ||
var dayPeriodValues = { | ||
narrow: { | ||
am: 'a', | ||
pm: 'p', | ||
midnight: 'կեսգշ', | ||
noon: 'կեսօր', | ||
morning: 'առավոտ', | ||
afternoon: 'ցերեկ', | ||
evening: 'երեկո', | ||
night: 'գիշեր' | ||
}, | ||
abbreviated: { | ||
am: 'AM', | ||
pm: 'PM', | ||
midnight: 'կեսգիշեր', | ||
noon: 'կեսօր', | ||
morning: 'առավոտ', | ||
afternoon: 'ցերեկ', | ||
evening: 'երեկո', | ||
night: 'գիշեր' | ||
}, | ||
wide: { | ||
am: 'a.m.', | ||
pm: 'p.m.', | ||
midnight: 'կեսգիշեր', | ||
noon: 'կեսօր', | ||
morning: 'առավոտ', | ||
afternoon: 'ցերեկ', | ||
evening: 'երեկո', | ||
night: 'գիշեր' | ||
} | ||
} | ||
var formattingDayPeriodValues = { | ||
narrow: { | ||
am: 'a', | ||
pm: 'p', | ||
midnight: 'կեսգշ', | ||
noon: 'կեսօր', | ||
morning: 'առավոտը', | ||
afternoon: 'ցերեկը', | ||
evening: 'երեկոյան', | ||
night: 'գիշերը' | ||
}, | ||
abbreviated: { | ||
am: 'AM', | ||
pm: 'PM', | ||
midnight: 'կեսգիշերին', | ||
noon: 'կեսօրին', | ||
morning: 'առավոտը', | ||
afternoon: 'ցերեկը', | ||
evening: 'երեկոյան', | ||
night: 'գիշերը' | ||
}, | ||
wide: { | ||
am: 'a.m.', | ||
pm: 'p.m.', | ||
midnight: 'կեսգիշերին', | ||
noon: 'կեսօրին', | ||
morning: 'առավոտը', | ||
afternoon: 'ցերեկը', | ||
evening: 'երեկոյան', | ||
night: 'գիշերը' | ||
} | ||
} | ||
|
||
function ordinalNumber(dirtyNumber, _dirtyOptions) { | ||
var number = Number(dirtyNumber) // If ordinal numbers depend on context, for example, | ||
// if they are different for different grammatical genders, | ||
// use `options.unit`: | ||
// | ||
// var options = dirtyOptions || {} | ||
// var unit = String(options.unit) | ||
// | ||
// where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear', | ||
// 'day', 'hour', 'minute', 'second' | ||
|
||
var rem100 = number % 100 | ||
|
||
if (rem100 < 10) { | ||
if (rem100 % 10 === 1) { | ||
return number + '֊ին' | ||
} | ||
} | ||
|
||
return number + '֊րդ' | ||
} | ||
|
||
var localize = { | ||
ordinalNumber: ordinalNumber, | ||
|
||
era: buildLocalizeFn({ | ||
values: eraValues, | ||
defaultWidth: 'wide' | ||
}), | ||
|
||
quarter: buildLocalizeFn({ | ||
values: quarterValues, | ||
defaultWidth: 'wide', | ||
argumentCallback: function(quarter) { | ||
return Number(quarter) - 1 | ||
} | ||
}), | ||
|
||
month: buildLocalizeFn({ | ||
values: monthValues, | ||
defaultWidth: 'wide' | ||
}), | ||
|
||
day: buildLocalizeFn({ | ||
values: dayValues, | ||
defaultWidth: 'wide' | ||
}), | ||
|
||
dayPeriod: buildLocalizeFn({ | ||
values: dayPeriodValues, | ||
defaultWidth: 'wide', | ||
formattingValues: formattingDayPeriodValues, | ||
defaultFormattingWidth: 'wide' | ||
}) | ||
} | ||
|
||
export default localize |
Oops, something went wrong.