[翻译] NSDate-TimeAgo
NSDate-TimeAgo
https://github.com/kevinlawler/NSDate-TimeAgo
NSDate+TimeAgo has merged with DateTools. DateTools is the parent project and Matthew York is the project head.
NSDate+TimeAgo是一个处理日期用的工具,他是Matthew York项目中的一部分.
This project is now part of DateTools. Please visit https://github.com/MatthewYork/DateTools
你可以在 https://github.com/MatthewYork/DateTools 中查看相关信息.
This repo is here in archive form. New work should be contributed to DateTools.
这个资源只是一个存档的形式.我们只会在New work里面更新关于这个资源的信息.
Description
This is an iOS, Objective-C, Cocoa Touch, iPhone, iPad category for NSDate. It gives NSDate the ability to report times like "A moment ago", "30 seconds ago", "5 minutes ago", "Yesterday", "Last month", "2 years ago", and so on.
这是用于苹果开发中的关于NSDate的category.你可以这么用"A moment ago", "30 seconds ago", "5 minutes ago", "Yesterday", "Last month", "2 years ago"
This functionality has variously been referred to as a "time ago", "time since", "relative date", or "fuzzy date" feature.
当然也支持这些"time ago", "time since", "relative date", or "fuzzy date"特性
NSDate+TimeAgo currently supports the following languages:
目前,他支持以下这些语言:
en (English) es (Spanish) zh_Hans (Chinese Simplified) zh_Hant (Chinese Traditional) pt (Portuguese) fr (French) it (Italian) ru (Russian) de (German) nl (Dutch) hu (Hungarian) fi (Finnish) ja (Japanese) vi (Vietnamese) ro (Romanian) da (Danish) cs (Czech) nb (Norwegian) lv (Latvian) tr (Turkish) ko (Korean) bg (Bulgarian) he (Hebrew) ar (Arabic) gre (Greek) pl (Polish) sv (Swedish) th (Thai) uk (Ukrainian) is (Icelandic) sq (Albanian) sk (Slovak)If you know a language not listed here, please consider submitting a translation. Localization codes by language.
如果你的母语不在这份列表中,你可以可以提供一份翻译的列表.
This project is user driven (by people like you). Pull requests close faster than issues (merged or rejected).
这份源码需要我们一起来维护,如果你喜欢,贡献你的一份力量吧.
Use
Add the files to your project - manually or via Cocoapods (pod NSDate+TimeAgo) 你可以直接拖源码,或者是使用Cocoapods Import the header using #import "NSDate+TimeAgo.h" 然后倒入头文件 Call the timeAgo method in the following way: 调用
NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:0]; NSString *ago = [date timeAgo]; NSLog(@"Output is: \"%@\"", ago); 2011-11-12 17:19:25.608 Proj[0:0] Output is: "41 years ago"
2 other methods are available: 当然也支持这些方法
dateTimeUntilNow: returns only "yesterday" / "this morning" / "last week" / "this month" -- less precise than dateTimeAgo but more natural
Those three methods can be interchanged as they have the same signature.
Future Directions
Would be nice to
add customization options (e.g., should it report seconds or just "a minute ago") 添加定制选项 add string customization 添加string的定制 have more localizations 更多的本地化语言 make dateTimeUntilNow more precise: instead of "Last week" use "Last Friday", "Last Monday" etc. other
License
Released under ISC (similar to 2-clause BSD)
http://wikipedia.org/wiki/ISC_license
Credits
Originally based on code Christopher Pickslay posted to Forrst. Used with permission.http://twitter.com/cpickslay
Ramon Torres began support for internationalization/localization. Added es strings. http://rtorres.me/
Dennis Zhuang added zh_Hans Chinese Simplified strings. http://fnil.net/
Mozart Petter added pt_BR Brazilian Portuguese strings. http://www.mozartpetter.com/
Stéphane Gerardot added fr French strings.
Marco Sanson added it Italian strings. http://marcosanson.tumblr.com/
Almas Adilbek added ru Russian strings. Extended logic to support Russian idioms.http://mixdesign.kz/
Mallox51 added de German strings. https://github.com/Mallox51
Tieme van Veen added nl Dutch strings. http://www.tiemevanveen.nl
Árpád Goretity added hu Hungarian strings. http://apaczai.elte.hu/~13akga/
Anajavi added fi Finnish strings. https://github.com/anajavi
Tonydyb added ja Japanese strings.
Vinhnx added vi Vietnamese strings. http://vinhnx.github.io/
Ronail added zh_Hant Traditional Chinese strings. https://github.com/ronail
SorinAntohi added ro Romanian strings. https://github.com/SorinAntohi
spookd added da Danish strings. https://github.com/spookd
Barrett Jacobsen added cs Czech strings. https://github.com/barrettj
Dmitry Shmidt added nb Norwegian strings. https://github.com/shmidt
Martins Rudens added lv Latvian strings. https://github.com/rudensm
Osman Saral added tr Turkish strings. https://github.com/osrl
analogstyle added ko Korean strings. http://almacreative.net/
Flavio Caetano fixed pt Portuguese strings. http://flaviocaetano.com
kolarski added bg Bulgarian strings. http://github.com/kolarski
Vladimir Kofman added he Hebrew strings. https://github.com/vladimirkofman
Viraf Sarkari added ar Arabic, gre Greek, pl Polish, sv Swedish, and th Thai strings.https://github.com/viraf
Vasyl Skrypii added uk Ukranian strings. https://github.com/medlay
Maggi Trymbill added is Icelandic strings. https://github.com/grundvollur
Erid Bardhaj added sq Albanian strings. https://github.com/eridbardhaj
相关文章
- [翻译] LLSimpleCamera
- [翻译] FeSpinner
- [翻译] VICMAImageView
- [翻译] LLSimpleCamera
- [翻译] KYCircularProgress
- 机器学习笔记 - 使用 Pix2Pix 进行图像翻译
- CRM WebClient UI的翻译问题和 SAP ABAP 报表的 SE63 翻译问题调试
- Paper之EfficientDet: 《Scalable and Efficient Object Detection—可扩展和高效的目标检测》的翻译及其解读
- AI:Algorithmia《2020 state of enterprise machine learning—2020年企业机器学习状况》翻译与解读
- Paper:《NÜWA: Visual Synthesis Pre-training for Neural visUal World creAtion,女娲:用于神经视觉世界创造的视觉》翻译与解读
- ML之XGBoost:XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》(三)
- Qt翻译教程
- 深度 | AI芯片之智能边缘计算的崛起——实时语言翻译、图像识别、AI视频监控、无人车这些都需要终端具有较强的计算能力,从而AI芯片发展起来是必然,同时5G网络也是必然