Skip to content
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

date.toRelative() returns empty string for languages which have not a full set of plural rules #630

Closed
anton-kaliuzhnyi-altexsoft opened this issue Dec 17, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@anton-kaliuzhnyi-altexsoft
Copy link
Contributor

If some language has not a full set of plural rules SwiftDate returns an empty string ("") from date.toRelative().

For example, for Russian "2 hours ago" is not returned at all, because it falls to a "few" rule which is absent in the dictionary:

public class lang_ru: RelativeFormatterLang {
	// ...
	private var _long: [String: Any] {
		return [
		"hour": [
		"current": "в этот час",
		"past": [
			"one": "{0} час назад",
			"many": "{0} часов назад",
			"other": "{0} часа назад"
		],
	// ...
@0xMarK
Copy link

0xMarK commented Dec 17, 2018

@malcommac The fix is available in Pull Request #631 Please review and accept it if it is ok.

@malcommac
Copy link
Owner

Accepted, on track for 5.1.0. Thanks

@malcommac malcommac self-assigned this Jan 20, 2019
@malcommac malcommac added the bug label Jan 20, 2019
@malcommac malcommac added this to the 5.1.0 milestone Jan 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants