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

Localization support for the timePassed method on DateExtensions.swift #462

Open
jaja-digitalspaceexplorer opened this issue Oct 17, 2017 · 7 comments

Comments

@jaja-digitalspaceexplorer
Copy link
Contributor

No description provided.

@Khalian
Copy link
Collaborator

Khalian commented Nov 25, 2017

The concept of time passed is relative. For instance if I live in the United States, and it passed 5 seconds for me, the method would return 5 seconds. For someone in India, if it passes 5 seconds for them, it still records 5 seconds.

I am unsure as to what your requirement here is. Could you give some examples of intended behavior?

I could update the calendar to be auto updating, but i do not see why locales should be passed as an arg here.

@Khalian
Copy link
Collaborator

Khalian commented Nov 25, 2017

#467

@jaja-digitalspaceexplorer
Copy link
Contributor Author

I apologize for not clarifying this. I meant to say was, if we could add localization support to the units of time returned by the timePassed method. I have something on my mind right now, which is to return an enum instead of string.

Sample Snippet

enum TimePassed { case year(Int) case month(Int) case day(Int) case hour(Int) case minute(Int) case second(Int) }

Returning this type of enum would force the consumer of this method to read the value returned, localize and pluralize it to their needs. This solution also removes our obligation to produce localization for each languages.

I like to hear your opinion about this.

Thanks!

@Khalian
Copy link
Collaborator

Khalian commented Dec 24, 2017

@jaja-digitalspaceexplorer I am all for inventing a completely new extension method with this enum as a return type, but i cannot break backwards compatibility by changing the return type signature of the existing timePassed method.

@jaja-digitalspaceexplorer
Copy link
Contributor Author

@Khalian I'll make sure it's still backwards compatible with the existing consumers of the extension method.

@110100110101
Copy link
Contributor

Referencing #486

@110100110101
Copy link
Contributor

@Khalian This issue can now be closed, because the #486 solves this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants