Download the PHP package johannschopplich/kirby-lingohub without Composer

On this page you can find all versions of the php package johannschopplich/kirby-lingohub. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-lingohub

Kirby Lingohub

The Kirby Lingohub plugin integrates the Lingohub translation service into your Kirby website. The plugin allows you to upload content from Kirby to Lingohub for translation and download the translations back to Kirby. It handles the whole serialization and deserialization process, including nested data structures like blocks and structures.

[!NOTE] For this plugin to work, you need to have a Lingohub account and a project set up. You can create a free account at Lingohub.

Requirements

Kirby is not free software. However, you can try Kirby and the Starterkit on your local machine or on a test server as long as you need to make sure it is the right tool for your next project. … and when you're convinced, buy your license.

Installation

Composer

Download

Download and copy this repository to /site/plugins/kirby-lingohub.

Getting Started

1️⃣ Kirby Language Configuration

Set up a multi-language Kirby site. For each desired language, create a language file in the site/languages folder. The language file should contain the following information:

[!NOTE] Make sure to set the locale option to the correct locale for each language. This is important for the mapping between Kirby and Lingohub.

2️⃣ Lingohub Setup

First, create a new project in your Lingohub workspace. Use the file format JSON (Standard):

Now, configure the project to use the same source and target languages as you have in Kirby. The language code in Lingohub should match the locale in Kirby. From the example above, the locale in Kirby is en_US. Set the language code in Lingohub to en-US. (Note the difference in the delimiter.)

As another example: If the Kirby language code is de and the locale is de_DE, the Lingohub language code should be de-DE.

Finally, create an API key for your workspace. Follow the Linoghub API key guide to create an API key with read/write access.

[!NOTE] Enable full permissions for the Resources section in the API key settings. This is required to upload and download translations. No other permissions are needed.

3️⃣ Kirby Plugin Configuration

After setting up the languages in Kirby and Lingohub, configure the plugin in the site/config/config.php file.

4️⃣ Blueprint Configuration

Kirby 5 introduces new extensions that allow you to add custom view buttons to most Panel views (e.g. page, site, or file). The Lingohub plugin provides a dropdown button that can be added alongside the default buttons, such as the languages dropdown button.

To add the lingohub dropdown button to a particular view, set the buttons option in the corresponding blueprint. The following example shows how to reference the default buttons and add the lingohub button to a page blueprint:

[!NOTE] Kirby 4 does not support custom view buttons, but the lingohub button has been backported. It is always placed before the language dropdown.

Finalize your blueprints by adding the necessary translation configuration to each field, e.g. translate: false if a field should not be translated. The plugin will skip these fields when uploading content to Lingohub.

Usage

Translation Status

The translation status is automatically retrieved from Lingohub and displayed in the user interface. It shows the minimum status of all segments of the page. Only if all segments are in status Approved, the translation language will be shown as Approved in green color:

Click on the status to open a dialog with more detailed information:

Upload Translations for a Page or File

Click on the Lingohub dropdown button in the Panel header and select Upload Translations.

As soon as you click on the button, the plugin will:

Instruct your translators to translate the content in Lingohub. When the translations are done, download the translations back to Kirby.

Download Translations from Lingohub

Click on the Lingohub dropdown button in the Panel header and select Download Translations. This will open a dialog where you can select the languages and status of the translations to download:

The dialog contains the following fields:

Submit the form to download the translations. The page will be updated with the new translations.

Features

translateExternalOnly Blueprint Field Option

The translateExternalOnly option allows you to mark fields that should only be translatable using the external translation service (i.e. Lingohub). For these fields, only the source language is editable. In translations, these fields cannot be edited. Admins can always edit the fields, independent of this setting. Set it to true when editors should only edit translations in Lingohub, and when the Lingohub translation memory is important to you.

Translation Status Table Section

The status section is similar to Lingohub's statuses overview and displays the translation status for all available languages. The status section is read-only and cannot be edited.

To add the status section to a blueprint, use the following configuration:

FAQ

How Is Kirby Content Data Mapped to Lingohub?

With the JSON (Standard) file format, Lingohub requires a key-value hierarchy structure where all elements in the chain have a long-term consistent key. Thus, nested data structures like block fields or structure fields in Kirby must be flattened to a key-value map. For example, block fields are transformed into a key-value map where the key is generated from the field name, block type, and block field name: {fieldName}_{blockId}_{blockType}_{blockFieldName}.

Lingohub uses a path based approach to identify the content. The path is generated from the Kirby model ID (which doesn't contain any draft status or sort numbers) and the language code.

While Kirby uses a language code as file suffix (e.g., en), Lingohub uses a locale code (e.g., en-US). The plugin maps the Kirby language code to the Lingohub locale code.

Some special rules apply when uploading content to Lingohub:

Roadmap

Media Files

Mass Operations

License

Johann Schopplich


All versions of kirby-lingohub with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package johannschopplich/kirby-lingohub contains the following files

Loading the files please wait ....