Skip to content

Traslation #5

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

Open
wilsonfalai opened this issue Nov 5, 2015 · 3 comments
Open

Traslation #5

wilsonfalai opened this issue Nov 5, 2015 · 3 comments

Comments

@wilsonfalai
Copy link

There is support for other languages?

@XAKEPEHOK
Copy link
Contributor

Yes.

http://timeago.yarp.com/
https://github.com/rmm5t/jquery-timeago/tree/master/locales

TimeAgo::widget(['timestamp' => $value, 'language' => substr(\Yii::$app->language,0,2)]);

@crazylion
Copy link

Hi:

This commit causes some problem on Chinese ( zh-TW,zh-CN). because the jquery-timeago do not have zh.js in it's locales directory.

ref : https://github.com/rmm5t/jquery-timeago/tree/master/locales

@XAKEPEHOK
Copy link
Contributor

XAKEPEHOK commented Aug 27, 2016

Yes. I think that can be resolve by something like this

$lang = substr(\Yii::$app->language,0,2);
if ($lang == 'zn') $lang = \Yii::$app->language;
TimeAgo::widget(['timestamp' => $value, 'language' => $lang]);

XAKEPEHOK pushed a commit to XAKEPEHOK/yii2-timeago that referenced this issue Aug 27, 2016
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