DocKing - ShipSaaS
Docking GitHub
  • DocKing from ShipSaaS
  • Architecture
  • Requirements
  • PDF Engines
    • Gotenberg
    • WkHTMLtoPDF
    • mPDF
  • Upgrade Notes
    • v1.4.0
    • v1.3.2
    • v1.3.1
    • v1.3.0
    • v1.2.0
    • v1.1.2
    • v1.1.1
    • v1.1.0
  • Usage
    • Basic
    • Endpoints
    • Webhook
    • Maintain IDs/Keys from Services
  • Getting Started
    • Environment Variables
    • Run on Local
      • Normal Run
      • Docker
    • Storage
    • Console UI
    • Document Template
      • Gotenberg's Metadata
      • wkHTMLtoPDF's metadata
      • mPDF's metadata
    • Templating Mode
    • Fonts
    • Octane / High-perf mode
    • Localization
  • Deployment
    • Linux VPS / Dedicated Server
    • Docker
Powered by GitBook
On this page
  • Glossary
  • Console UI
  • Get the translated texts in Templates
  • Render PDF metadata
  1. Getting Started

Localization

[v1.4.0+] Localization for your rendered PDF files

PreviousOctane / High-perf modeNextLinux VPS / Dedicated Server

Last updated 1 year ago

This feature is only available on DocKing v1.4.0 and above.

In case you need to deliver your PDF in multilingual, worry no more. DocKing is finally supporting that 😎

DocKing's Localization is built on top of Laravel Localization, meaning you can use every feature/helper/... from Laravel's Localization.

Learn more about Laravel Localization:

Glossary

  • Languages: languages that you want to use from your applications (for example, I want English & Vietnamese, I'll create 2 languages)

  • Translation Groups: for grouping the translation texts

    • E.g.: Base Group, Invoicing Group, etc.

    • Note: if you delete a Translation Group, the associated Translations will be deleted as well.

  • Translations: holding the translation texts

Console UI

You can manage Languages, Translation Groups & Translations in the Console UI.

Get the translated texts in Templates

In your Document Templates, you would be able to use these functions to get the translation:

@lang('key')
{{ __('key') }}
{{ trans('key') }}

For example: this is my template with some translations.

Hitting "Preview", I'll able to see the rendered version.

Render PDF metadata

POST api/v1/document-templates/{uuid}/pdfs
metadata: {
  "language": "en" // or vi, es,...
}

From and endpoints, you can specify the language in the metadata object

And that's all

😉
https://laravel.com/docs/10.x/localization#retrieving-translation-strings
Listing
Create
Listing
Listing
Create/Edit Translation
#post-v1-document-templates-uuid-pdfs
#post-v1-document-templates-uuid-pdfs-async