Download the PHP package medienbaecker/kirby-translation-progress without Composer

On this page you can find all versions of the php package medienbaecker/kirby-translation-progress. 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-translation-progress

Kirby Translation Progress

Extends the Panel's Languages view with a translation overview: a completion percentage per language and a collapsible page tree showing per-page progress.

Installation

Composer

Manual

Download and extract to site/plugins/kirby-translation-progress.

Requirements

How it works

The plugin reads Kirby's content files, compares them field by field against the default language, and reports a percentage.

Pages without a content file for a language are marked as missing. A field is considered translated when its content differs from the default language. A field that's empty in the translation counts as untranslated. A field that's identical to the default language is where it gets tricky:

Identical content

When a field has the same value in both languages, is it translated or not? "API" in English is "API" in German and that's fine. But a full paragraph that's identical in both languages probably hasn't been translated yet.

The plugin uses a length heuristic: identical values shorter than minValueLength (default: 50 characters) are assumed to be loan words or proper nouns. Longer identical values are flagged as untranslated.

Field types

The plugin reads the blueprint to find translatable fields. Fields with translate: false are excluded, and so are non-text types (files, pages, users, link, color, date, time) that don't contain translatable content.

For complex fields, the plugin extracts text before comparing:

Field type What gets compared
text, textarea The raw value
writer, list HTML with tags stripped
blocks Text from each block's content fields
layout Text from blocks inside each column
structure Each sub-field per row, individually
object Each sub-field individually
tiptap Text nodes from ProseMirror JSON

Object and structure fields are expanded recursively, nested compounds (e.g. a structure inside an object) should work too.

Language variables

The translations array from your language files is also compared, shown as a separate row. Disable it with languageVariables: false.

Options

[!TIP] Use Kirby's built-in translate: false option in your blueprints to exclude specific fields from secondary languages:

Ignoring content

Some content keeps a language from ever reaching 100% even when nothing's wrong: a language variable that happens to read the same as the default in most languages (a unit or shared term like {{time}} min), a field that doesn't need translating, or an entire page type. Three callbacks exclude it from the calculation, each returning true to exclude:

ignoreField runs once per template and only sees top-level fields, so sub-fields of object and structure fields follow ignoreFieldTypes instead. It also receives the field's blueprint type as an optional third argument, which scopes a type to one template (ignoreFieldTypes drops it everywhere). ignorePage skips a page's own progress but still descends into its children, so a parent kept only to hold translatable children stays in the tree.

Custom adapters

For third-party field types that store text in a custom format, register an adapter that returns plain text:

Built-in adapters cover writer, list, blocks, layout, structure, object, and my tiptap plugin. A custom adapter with the same name overrides the built-in one.

Limitations

License

MIT


All versions of kirby-translation-progress with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
getkirby/composer-installer Version ^1.2
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 medienbaecker/kirby-translation-progress contains the following files

Loading the files please wait ...