oblik / kirby-memsource
Kirby integration for the Phrase (formerly Memsource) TMS service.
Installs: 90
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 4
Forks: 1
Open Issues: 0
Type:kirby-plugin
Requires
- getkirby/cms: >=3.5 <3.6
- getkirby/composer-installer: ^1.1
- oblik/kirby-walker: 3.0.0
This package is auto-updated.
Last update: 2024-11-27 09:26:22 UTC
README
This plugin allows you to translate your entire site content in the powerful TMS Memsource:
- Create Memsource jobs with great control over what's exported
- Import Memsource jobs with reports for what has changed
- Great control over the exported format of fields via kirby-walker
- Support for the Kirby Editor
Note: Currently does not support Kirby 3.6
and above.
Installation
With Composer from oblik/kirby-memsource on Packagist:
composer require oblik/kirby-memsource
Sign up for a developer account in Memsource.
Context notes
You can specify comments to aid translators by adding them in the blueprint:
fields: heading: type: text memsource: note: This is the title of the page.
When exported, the JSON will look like this:
{ "pages": { "home": { "heading": { "$value": "Hello World!", "$note": "This is the title of the page." } } } }
Then, you can configure Memsource's context note functionality to trigger on $note
keys.
Settings
You can configure the plugin in your site/config.php
:
return [ 'oblik.memsource' => [ // settingsā¦ ] ];
Credentials
Add your Memsource account credentials:
return [ 'oblik.memsource' => [ 'login' => [ 'username' => 'john', 'password' => '1234' ] ] ];
Remove <br>
tags
You might want to put <br>
to force text to break at specific positions in order to achieve a certain layout effect. This is pretty much impossible to be achieved in translations because the text will have different word length and overall length.
For this reason, you might want to remove <br>
tags from your exports:
return [ 'oblik.memsource' => [ 'walker' => [ 'removeBrTags' => true ] ] ];
Dynamic context notes
You may generate context notes on the fly:
return [ 'oblik.memsource' => [ 'walker' => [ 'contextNote' => function ($value) { if (strpos($value, '{{ year }}') !== false) { return "{{ year }} is the current calendar year."; } } ] ] ];