Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #55 from LaravelRUS/2.0
Browse files Browse the repository at this point in the history
Added Japanese support
  • Loading branch information
Amegatron committed Mar 23, 2015
2 parents d7631bf + 1c4f324 commit 70f8d14
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Laravelrus/LocalizedCarbon/DiffFormatters/JaDiffFormatter.php
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;
}
}
16 changes: 16 additions & 0 deletions src/lang/ja/months.php
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月",
);
11 changes: 11 additions & 0 deletions src/lang/ja/units.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return array(
"second" => "",
"minute" => "",
"hour" => "時間",
"day" => "",
"week" => "週間|",
"month" => "ヶ月",
"year" => "",
);

0 comments on commit 70f8d14

Please sign in to comment.