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 Bosnian locale #2495
Merged
Merged
Add Bosnian locale #2495
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
142296d
Add bosnian locale
BranislavLazic 7ffcf55
Update snapshot
BranislavLazic 9b64c51
Fix terminology
BranislavLazic 9e51435
Fix typings
BranislavLazic 0197afd
Set firstWeekContainsDate to 4
BranislavLazic 074e148
Re-generate snapshots
BranislavLazic File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,191 @@ | ||
var formatDistanceLocale = { | ||
lessThanXSeconds: { | ||
one: { | ||
standalone: 'manje od 1 sekunde', | ||
withPrepositionAgo: 'manje od 1 sekunde', | ||
withPrepositionIn: 'manje od 1 sekundu', | ||
}, | ||
dual: 'manje od {{count}} sekunde', | ||
other: 'manje od {{count}} sekundi', | ||
}, | ||
|
||
xSeconds: { | ||
one: { | ||
standalone: '1 sekunda', | ||
withPrepositionAgo: '1 sekunde', | ||
withPrepositionIn: '1 sekundu', | ||
}, | ||
dual: '{{count}} sekunde', | ||
other: '{{count}} sekundi', | ||
}, | ||
|
||
halfAMinute: 'pola minute', | ||
|
||
lessThanXMinutes: { | ||
one: { | ||
standalone: 'manje od 1 minute', | ||
withPrepositionAgo: 'manje od 1 minute', | ||
withPrepositionIn: 'manje od 1 minutu', | ||
}, | ||
dual: 'manje od {{count}} minute', | ||
other: 'manje od {{count}} minuta', | ||
}, | ||
|
||
xMinutes: { | ||
one: { | ||
standalone: '1 minuta', | ||
withPrepositionAgo: '1 minute', | ||
withPrepositionIn: '1 minutu', | ||
}, | ||
dual: '{{count}} minute', | ||
other: '{{count}} minuta', | ||
}, | ||
|
||
aboutXHours: { | ||
one: { | ||
standalone: 'oko 1 sat', | ||
withPrepositionAgo: 'oko 1 sat', | ||
withPrepositionIn: 'oko 1 sat', | ||
}, | ||
dual: 'oko {{count}} sata', | ||
other: 'oko {{count}} sati', | ||
}, | ||
|
||
xHours: { | ||
one: { | ||
standalone: '1 sat', | ||
withPrepositionAgo: '1 sat', | ||
withPrepositionIn: '1 sat', | ||
}, | ||
dual: '{{count}} sata', | ||
other: '{{count}} sati', | ||
}, | ||
|
||
xDays: { | ||
one: { | ||
standalone: '1 dan', | ||
withPrepositionAgo: '1 dan', | ||
withPrepositionIn: '1 dan', | ||
}, | ||
dual: '{{count}} dana', | ||
other: '{{count}} dana', | ||
}, | ||
|
||
aboutXWeeks: { | ||
one: { | ||
standalone: 'oko 1 nedjelju', | ||
withPrepositionAgo: 'oko 1 nedjelju', | ||
withPrepositionIn: 'oko 1 nedjelju', | ||
}, | ||
dual: 'oko {{count}} nedjelje', | ||
other: 'oko {{count}} nedjelje', | ||
}, | ||
|
||
xWeeks: { | ||
one: { | ||
standalone: '1 nedjelju', | ||
withPrepositionAgo: '1 nedjelju', | ||
withPrepositionIn: '1 nedjelju', | ||
}, | ||
dual: '{{count}} nedjelje', | ||
other: '{{count}} nedjelje', | ||
}, | ||
|
||
aboutXMonths: { | ||
one: { | ||
standalone: 'oko 1 mjesec', | ||
withPrepositionAgo: 'oko 1 mjesec', | ||
withPrepositionIn: 'oko 1 mjesec', | ||
}, | ||
dual: 'oko {{count}} mjeseca', | ||
other: 'oko {{count}} mjeseci', | ||
}, | ||
|
||
xMonths: { | ||
one: { | ||
standalone: '1 mjesec', | ||
withPrepositionAgo: '1 mjesec', | ||
withPrepositionIn: '1 mjesec', | ||
}, | ||
dual: '{{count}} mjeseca', | ||
other: '{{count}} mjeseci', | ||
}, | ||
|
||
aboutXYears: { | ||
one: { | ||
standalone: 'oko 1 godinu', | ||
withPrepositionAgo: 'oko 1 godinu', | ||
withPrepositionIn: 'oko 1 godinu', | ||
}, | ||
dual: 'oko {{count}} godine', | ||
other: 'oko {{count}} godina', | ||
}, | ||
|
||
xYears: { | ||
one: { | ||
standalone: '1 godina', | ||
withPrepositionAgo: '1 godine', | ||
withPrepositionIn: '1 godinu', | ||
}, | ||
dual: '{{count}} godine', | ||
other: '{{count}} godina', | ||
}, | ||
|
||
overXYears: { | ||
one: { | ||
standalone: 'preko 1 godinu', | ||
withPrepositionAgo: 'preko 1 godinu', | ||
withPrepositionIn: 'preko 1 godinu', | ||
}, | ||
dual: 'preko {{count}} godine', | ||
other: 'preko {{count}} godina', | ||
}, | ||
|
||
almostXYears: { | ||
one: { | ||
standalone: 'gotovo 1 godinu', | ||
withPrepositionAgo: 'gotovo 1 godinu', | ||
withPrepositionIn: 'gotovo 1 godinu', | ||
}, | ||
dual: 'gotovo {{count}} godine', | ||
other: 'gotovo {{count}} godina', | ||
}, | ||
} | ||
|
||
export default function formatDistance(token, count, options) { | ||
options = options || {} | ||
|
||
var result | ||
|
||
if (typeof formatDistanceLocale[token] === 'string') { | ||
result = formatDistanceLocale[token] | ||
} else if (count === 1) { | ||
if (options.addSuffix) { | ||
if (options.comparison > 0) { | ||
result = formatDistanceLocale[token].one.withPrepositionIn | ||
} else { | ||
result = formatDistanceLocale[token].one.withPrepositionAgo | ||
} | ||
} else { | ||
result = formatDistanceLocale[token].one.standalone | ||
} | ||
} else if ( | ||
count % 10 > 1 && | ||
count % 10 < 5 && // if last digit is between 2 and 4 | ||
String(count).substr(-2, 1) !== '1' // unless the 2nd to last digit is "1" | ||
) { | ||
result = formatDistanceLocale[token].dual.replace('{{count}}', count) | ||
} else { | ||
result = formatDistanceLocale[token].other.replace('{{count}}', count) | ||
} | ||
|
||
if (options.addSuffix) { | ||
if (options.comparison > 0) { | ||
return 'za ' + result | ||
} else { | ||
return 'prije ' + 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,39 @@ | ||
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index' | ||
|
||
var dateFormats = { | ||
full: 'EEEE, d. MMMM yyyy.', | ||
long: 'd. MMMM yyyy.', | ||
medium: 'd. MMM yy.', | ||
short: 'dd. MM. yy.', | ||
} | ||
|
||
var timeFormats = { | ||
full: 'HH:mm:ss (zzzz)', | ||
long: 'HH:mm:ss z', | ||
medium: 'HH:mm:ss', | ||
short: 'HH:mm', | ||
} | ||
|
||
var dateTimeFormats = { | ||
full: "{{date}} 'u' {{time}}", | ||
long: "{{date}} 'u' {{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,44 @@ | ||
var formatRelativeLocale = { | ||
lastWeek: function (date) { | ||
var day = date.getUTCDay() | ||
|
||
switch (day) { | ||
case 0: | ||
return "'prošle nedjelje u' p" | ||
case 3: | ||
return "'prošle srijede u' p" | ||
case 6: | ||
return "'prošle subote u' p" | ||
default: | ||
return "'prošli' EEEE 'u' p" | ||
} | ||
}, | ||
yesterday: "'juče u' p", | ||
today: "'danas u' p", | ||
tomorrow: "'sutra u' p", | ||
nextWeek: function (date) { | ||
var day = date.getUTCDay() | ||
|
||
switch (day) { | ||
case 0: | ||
return "'sledeće nedjelje u' p" | ||
case 3: | ||
return "'sledeću srijedu u' p" | ||
case 6: | ||
return "'sledeću subotu u' p" | ||
default: | ||
return "'sledeći' EEEE 'u' p" | ||
} | ||
}, | ||
other: 'P', | ||
} | ||
|
||
export default function formatRelative(token, date, _baseDate, _options) { | ||
var format = formatRelativeLocale[token] | ||
|
||
if (typeof format === 'function') { | ||
return format(date) | ||
} | ||
|
||
return format | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think that
sljedeće
is correct one here. https://bs.wikipedia.org/wiki/Wikipedia:Pravilno-nepravilno_u_bosanskom_jeziku/2018.#SThere 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.
Also
sedmica
instead ofnedjelja
.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.
Fixed. Thank you!