This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from LaravelRUS/2.0
Added Japanese support
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/Laravelrus/LocalizedCarbon/DiffFormatters/JaDiffFormatter.php
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,18 @@ | ||
<?php namespace Laravelrus\LocalizedCarbon\DiffFormatters; | ||
|
||
|
||
class JaDiffFormatter implements DiffFormatterInterface { | ||
|
||
public function format($isNow, $isFuture, $delta, $unit) { | ||
$unitStr = \Lang::choice("localized-carbon::units." . $unit, $delta, array(), 'ja'); | ||
$txt = $delta . ' ' . $unitStr; | ||
|
||
if ($isNow) { | ||
$txt .= ($isFuture) ? '今' : '前'; | ||
return $txt; | ||
} | ||
|
||
$txt .= ($isFuture) ? '前' : '後'; | ||
return $txt; | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
return array( | ||
"january" => "1月", | ||
"february" => "2月", | ||
"march" => "3月", | ||
"april" => "4月", | ||
"may" => "5月", | ||
"june" => "6月", | ||
"july" => "7月", | ||
"august" => "8月", | ||
"september" => "9月", | ||
"october" => "10月", | ||
"november" => "11月", | ||
"december" => "12月", | ||
); |
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,11 @@ | ||
<?php | ||
|
||
return array( | ||
"second" => "秒", | ||
"minute" => "分", | ||
"hour" => "時間", | ||
"day" => "日", | ||
"week" => "週間|", | ||
"month" => "ヶ月", | ||
"year" => "年", | ||
); |