🌐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:
Ritthikrai W
2022-06-15 19:47:36 +07:00
committed by GitHub
parent 33bc9ded65
commit 204483836a
22 changed files with 1664 additions and 30 deletions

View File

@ -17,6 +17,7 @@ import sk from './sk.json'
import vi from './vi.json'
import el from './el.json'
import hr from './hr.json'
import th from './th.json'
export default {
cs,
@ -37,5 +38,6 @@ export default {
vi,
pl,
el,
hr
hr,
th
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -386,6 +386,10 @@
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>

View File

@ -408,6 +408,10 @@
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>

View File

@ -346,6 +346,10 @@
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>

View File

@ -327,6 +327,10 @@
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>

View File

@ -377,6 +377,10 @@
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>

View File

@ -2,7 +2,7 @@
<html>
<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" />
<style type="text/css">
@ -187,7 +187,7 @@
.total-display-table {
border-top: none;
border-top: none;
page-break-inside: avoid;
page-break-before: auto;
page-break-after: auto;
@ -304,7 +304,12 @@
.pl-0 {
padding-left: 0;
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>
@ -312,10 +317,10 @@
<table width="100%">
<tr>
<td width="50%" class="header-section-left">
@if($logo)
<img class="header-logo" style="height: 50px;" src="{{ $logo }}" alt="Company Logo">
@if ($logo)
<img class="header-logo" style="height: 50px;" src="{{ $logo }}" alt="Company Logo">
@else
<h1 class="header-logo"> {{$invoice->customer->company->name}} </h1>
<h1 class="header-logo"> {{ $invoice->customer->company->name }} </h1>
@endif
</td>
<td width="50%" class="text-right company-address-container company-address">
@ -331,14 +336,14 @@
<div class="main-content">
<div class="customer-address-container">
<div class="billing-address-container billing-address">
@if($billing_address)
@if ($billing_address)
<b>@lang('pdf_bill_to')</b> <br>
{!! $billing_address !!}
@endif
</div>
<div @if($billing_address !== '</br>') class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" @endif>
@if($shipping_address)
<div @if ($billing_address !== '</br>') class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" @endif>
@if ($shipping_address)
<b>@lang('pdf_ship_to')</b> <br>
{!! $shipping_address !!}
@endif
@ -350,15 +355,15 @@
<table>
<tr>
<td class="attribute-label">@lang('pdf_invoice_number')</td>
<td class="attribute-value"> &nbsp;{{$invoice->invoice_number}}</td>
<td class="attribute-value"> &nbsp;{{ $invoice->invoice_number }}</td>
</tr>
<tr>
<td class="attribute-label">@lang('pdf_invoice_date')</td>
<td class="attribute-value"> &nbsp;{{$invoice->formattedInvoiceDate}}</td>
<td class="attribute-value"> &nbsp;{{ $invoice->formattedInvoiceDate }}</td>
</tr>
<tr>
<td class="attribute-label">@lang('pdf_invoice_due_date')</td>
<td class="attribute-value"> &nbsp;{{$invoice->formattedDueDate}}</td>
<td class="attribute-value"> &nbsp;{{ $invoice->formattedDueDate }}</td>
</tr>
</table>
</div>
@ -368,7 +373,7 @@
@include('app.pdf.invoice.partials.table')
<div class="notes">
@if($notes)
@if ($notes)
<div class="notes-label">
@lang('pdf_notes')
</div>

View 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>

View File

@ -276,6 +276,10 @@
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>@lang('pdf_expense_report_label')</title>
<style type="text/css">
@ -11,7 +12,7 @@
border-collapse: collapse;
}
.sub-container{
.sub-container {
padding: 0px 20px;
}
@ -132,8 +133,14 @@
line-height: 21px;
color: #5851D8;
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>
<div class="sub-container">
<table class="report-header">
@ -190,4 +197,5 @@
</tr>
</table>
</body>
</html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>@lang('pdf_profit_loss_label')</title>
<style type="text/css">
@ -11,7 +12,7 @@
border-collapse: collapse;
}
.sub-container{
.sub-container {
padding: 0px 20px;
}
@ -157,8 +158,14 @@
line-height: 21px;
color: #5851D8;
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>
<div class="sub-container">
<table class="report-header">
@ -222,9 +229,10 @@
<p class="report-footer-label">@lang("pdf_net_profit_label")</p>
</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>
</tr>
</table>
</body>
</html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>@lang('pdf_sales_customers_label')</title>
<style type="text/css">
@ -11,7 +12,7 @@
border-collapse: collapse;
}
.sub-container{
.sub-container {
padding: 0px 20px;
}
@ -132,11 +133,18 @@
line-height: 21px;
color: #5851D8;
}
.text-center {
text-align: center;
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>
<div class="sub-container">
<table class="report-header">
@ -201,4 +209,5 @@
</tr>
</table>
</body>
</html>

View File

@ -1,17 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>@lang('pdf_sales_items_label')</title>
<style type="text/css">
body {
font-family: "DejaVu Sans";
}
table {
border-collapse: collapse;
}
.sub-container{
.sub-container {
padding: 0px 20px;
}
@ -132,11 +133,18 @@
line-height: 21px;
color: #5851D8;
}
.text-center {
text-align: center;
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>
<div class="sub-container">
<table class="report-header">
@ -154,7 +162,7 @@
</td>
</tr>
</table>
<p class="sales-items-title">@lang('pdf_items_label')</p>
@foreach ($items as $item)
<div class="items-table-container">
@ -175,15 +183,15 @@
</div>
@endforeach
<table class="sales-total-indicator-table">
<tr>
<td class="sales-total-cell">
<p class="sales-total-amount">
{!! format_money_pdf($totalAmount) !!}
</p>
</td>
</tr>
</table>
<table class="sales-total-indicator-table">
<tr>
<td class="sales-total-cell">
<p class="sales-total-amount">
{!! format_money_pdf($totalAmount) !!}
</p>
</td>
</tr>
</table>
</div>
@ -200,4 +208,5 @@
</tr>
</table>
</body>
</html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>@lang('pdf_tax_summery_label')</title>
<style type="text/css">
@ -11,7 +12,7 @@
border-collapse: collapse;
}
.sub-container{
.sub-container {
padding: 0px 20px;
}
@ -133,8 +134,14 @@
line-height: 21px;
color: #5851D8;
}
</style>
@if (App::isLocale('th'))
@include('app.pdf.locale.th')
@endif
</head>
<body>
<div class="sub-container">
<table class="report-header">
@ -200,4 +207,5 @@
</tr>
</table>
</body>
</html>