mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 03:31:09 -04:00
🌐Update: support Thai language (#768)
* add thai language config
* update thai translation
* update thai translation
* add THSarabunNew fonts to using in pdf
* update: pdf file to support thai language by checking isLocale('th') and include thai font-family
* update: thai translation
* remove the index.php file (not used)
* move THSarabunNew fonts to resoureces/static/fonts
* Add .gitkeep to storage/fonts to pre-build the fonts directory
Co-authored-by: Ritthikrai (Champ) Wiengchai <ritthikrai.w@aware.co.th>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ Homestead.yaml
|
|||||||
.gitkeep
|
.gitkeep
|
||||||
/public/docs
|
/public/docs
|
||||||
/.scribe
|
/.scribe
|
||||||
|
!storage/fonts/.gitkeep
|
||||||
@ -71,6 +71,7 @@ return [
|
|||||||
["code" => "cs", "name" => "Czech"],
|
["code" => "cs", "name" => "Czech"],
|
||||||
["code" => "el", "name" => "Greek"],
|
["code" => "el", "name" => "Greek"],
|
||||||
["code" => "hr", "name" => "Crotian"],
|
["code" => "hr", "name" => "Crotian"],
|
||||||
|
["code" => "th", "name" => "ไทย"],
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import sk from './sk.json'
|
|||||||
import vi from './vi.json'
|
import vi from './vi.json'
|
||||||
import el from './el.json'
|
import el from './el.json'
|
||||||
import hr from './hr.json'
|
import hr from './hr.json'
|
||||||
|
import th from './th.json'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
cs,
|
cs,
|
||||||
@ -37,5 +38,6 @@ export default {
|
|||||||
vi,
|
vi,
|
||||||
pl,
|
pl,
|
||||||
el,
|
el,
|
||||||
hr
|
hr,
|
||||||
|
th
|
||||||
}
|
}
|
||||||
|
|||||||
1525
resources/scripts/locales/th.json
Normal file
1525
resources/scripts/locales/th.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
resources/static/fonts/THSarabunNew-Bold.ttf
Normal file
BIN
resources/static/fonts/THSarabunNew-Bold.ttf
Normal file
Binary file not shown.
BIN
resources/static/fonts/THSarabunNew-BoldItalic.ttf
Normal file
BIN
resources/static/fonts/THSarabunNew-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
resources/static/fonts/THSarabunNew-Italic.ttf
Normal file
BIN
resources/static/fonts/THSarabunNew-Italic.ttf
Normal file
Binary file not shown.
BIN
resources/static/fonts/THSarabunNew.ttf
Normal file
BIN
resources/static/fonts/THSarabunNew.ttf
Normal file
Binary file not shown.
@ -386,6 +386,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -408,6 +408,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -346,6 +346,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -327,6 +327,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -377,6 +377,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>@lang('pdf_invoice_label') - {{$invoice->invoice_number}}</title>
|
<title>@lang('pdf_invoice_label') - {{ $invoice->invoice_number }}</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -187,7 +187,7 @@
|
|||||||
|
|
||||||
|
|
||||||
.total-display-table {
|
.total-display-table {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
page-break-before: auto;
|
page-break-before: auto;
|
||||||
page-break-after: auto;
|
page-break-after: auto;
|
||||||
@ -304,7 +304,12 @@
|
|||||||
.pl-0 {
|
.pl-0 {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -312,10 +317,10 @@
|
|||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="50%" class="header-section-left">
|
<td width="50%" class="header-section-left">
|
||||||
@if($logo)
|
@if ($logo)
|
||||||
<img class="header-logo" style="height: 50px;" src="{{ $logo }}" alt="Company Logo">
|
<img class="header-logo" style="height: 50px;" src="{{ $logo }}" alt="Company Logo">
|
||||||
@else
|
@else
|
||||||
<h1 class="header-logo"> {{$invoice->customer->company->name}} </h1>
|
<h1 class="header-logo"> {{ $invoice->customer->company->name }} </h1>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td width="50%" class="text-right company-address-container company-address">
|
<td width="50%" class="text-right company-address-container company-address">
|
||||||
@ -331,14 +336,14 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="customer-address-container">
|
<div class="customer-address-container">
|
||||||
<div class="billing-address-container billing-address">
|
<div class="billing-address-container billing-address">
|
||||||
@if($billing_address)
|
@if ($billing_address)
|
||||||
<b>@lang('pdf_bill_to')</b> <br>
|
<b>@lang('pdf_bill_to')</b> <br>
|
||||||
{!! $billing_address !!}
|
{!! $billing_address !!}
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div @if($billing_address !== '</br>') class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" @endif>
|
<div @if ($billing_address !== '</br>') class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" @endif>
|
||||||
@if($shipping_address)
|
@if ($shipping_address)
|
||||||
<b>@lang('pdf_ship_to')</b> <br>
|
<b>@lang('pdf_ship_to')</b> <br>
|
||||||
{!! $shipping_address !!}
|
{!! $shipping_address !!}
|
||||||
@endif
|
@endif
|
||||||
@ -350,15 +355,15 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="attribute-label">@lang('pdf_invoice_number')</td>
|
<td class="attribute-label">@lang('pdf_invoice_number')</td>
|
||||||
<td class="attribute-value"> {{$invoice->invoice_number}}</td>
|
<td class="attribute-value"> {{ $invoice->invoice_number }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="attribute-label">@lang('pdf_invoice_date')</td>
|
<td class="attribute-label">@lang('pdf_invoice_date')</td>
|
||||||
<td class="attribute-value"> {{$invoice->formattedInvoiceDate}}</td>
|
<td class="attribute-value"> {{ $invoice->formattedInvoiceDate }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="attribute-label">@lang('pdf_invoice_due_date')</td>
|
<td class="attribute-label">@lang('pdf_invoice_due_date')</td>
|
||||||
<td class="attribute-value"> {{$invoice->formattedDueDate}}</td>
|
<td class="attribute-value"> {{ $invoice->formattedDueDate }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -368,7 +373,7 @@
|
|||||||
@include('app.pdf.invoice.partials.table')
|
@include('app.pdf.invoice.partials.table')
|
||||||
|
|
||||||
<div class="notes">
|
<div class="notes">
|
||||||
@if($notes)
|
@if ($notes)
|
||||||
<div class="notes-label">
|
<div class="notes-label">
|
||||||
@lang('pdf_notes')
|
@lang('pdf_notes')
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
34
resources/views/app/pdf/locale/th.blade.php
Normal file
34
resources/views/app/pdf/locale/th.blade.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
@font-face {
|
||||||
|
font-family: 'THSarabunNew';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
src: url("{{ resource_path('static/fonts/THSarabunNew.ttf') }}") format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'THSarabunNew';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: bold;
|
||||||
|
src: url("{{ resource_path('static/fonts/THSarabunNew-Bold.ttf') }}") format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'THSarabunNew';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: normal;
|
||||||
|
src: url("{{ resource_path('static/fonts/THSarabunNew-Italic.ttf') }}") format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'THSarabunNew';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: bold;
|
||||||
|
src: url("{{ resource_path('static/fonts/THSarabunNew-BoldItalic.ttf') }}") format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: "THSarabunNew", sans-serif !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -276,6 +276,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>@lang('pdf_expense_report_label')</title>
|
<title>@lang('pdf_expense_report_label')</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -11,7 +12,7 @@
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-container{
|
.sub-container {
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,8 +133,14 @@
|
|||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
color: #5851D8;
|
color: #5851D8;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="sub-container">
|
<div class="sub-container">
|
||||||
<table class="report-header">
|
<table class="report-header">
|
||||||
@ -190,4 +197,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>@lang('pdf_profit_loss_label')</title>
|
<title>@lang('pdf_profit_loss_label')</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -11,7 +12,7 @@
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-container{
|
.sub-container {
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,8 +158,14 @@
|
|||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
color: #5851D8;
|
color: #5851D8;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="sub-container">
|
<div class="sub-container">
|
||||||
<table class="report-header">
|
<table class="report-header">
|
||||||
@ -222,9 +229,10 @@
|
|||||||
<p class="report-footer-label">@lang("pdf_net_profit_label")</p>
|
<p class="report-footer-label">@lang("pdf_net_profit_label")</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p class="report-footer-value">{!! format_money_pdf(($income-$totalExpense)) !!}</p>
|
<p class="report-footer-value">{!! format_money_pdf($income - $totalExpense) !!}</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>@lang('pdf_sales_customers_label')</title>
|
<title>@lang('pdf_sales_customers_label')</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -11,7 +12,7 @@
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-container{
|
.sub-container {
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,11 +133,18 @@
|
|||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
color: #5851D8;
|
color: #5851D8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-center {
|
.text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="sub-container">
|
<div class="sub-container">
|
||||||
<table class="report-header">
|
<table class="report-header">
|
||||||
@ -201,4 +209,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,17 +1,18 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>@lang('pdf_sales_items_label')</title>
|
<title>@lang('pdf_sales_items_label')</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
font-family: "DejaVu Sans";
|
font-family: "DejaVu Sans";
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-container{
|
.sub-container {
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,11 +133,18 @@
|
|||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
color: #5851D8;
|
color: #5851D8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-center {
|
.text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="sub-container">
|
<div class="sub-container">
|
||||||
<table class="report-header">
|
<table class="report-header">
|
||||||
@ -154,7 +162,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p class="sales-items-title">@lang('pdf_items_label')</p>
|
<p class="sales-items-title">@lang('pdf_items_label')</p>
|
||||||
@foreach ($items as $item)
|
@foreach ($items as $item)
|
||||||
<div class="items-table-container">
|
<div class="items-table-container">
|
||||||
@ -175,15 +183,15 @@
|
|||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<table class="sales-total-indicator-table">
|
<table class="sales-total-indicator-table">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="sales-total-cell">
|
<td class="sales-total-cell">
|
||||||
<p class="sales-total-amount">
|
<p class="sales-total-amount">
|
||||||
{!! format_money_pdf($totalAmount) !!}
|
{!! format_money_pdf($totalAmount) !!}
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -200,4 +208,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>@lang('pdf_tax_summery_label')</title>
|
<title>@lang('pdf_tax_summery_label')</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -11,7 +12,7 @@
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-container{
|
.sub-container {
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,8 +134,14 @@
|
|||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
color: #5851D8;
|
color: #5851D8;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@if (App::isLocale('th'))
|
||||||
|
@include('app.pdf.locale.th')
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="sub-container">
|
<div class="sub-container">
|
||||||
<table class="report-header">
|
<table class="report-header">
|
||||||
@ -200,4 +207,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
0
storage/fonts/.gitkeep
Normal file
0
storage/fonts/.gitkeep
Normal file
Reference in New Issue
Block a user