# Translations // Keep track of translation status

**URL:** <https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338>\
**Category:** Plugins\
**Created:** [June 7, 2016, 11:17am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338 "2016-06-07T11:17:10Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [August 23, 2016, 7:11pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/21 "2016-08-23T19:11:48Z")

</div>

As mentioned above, I finally added a third state (so far only to the [develop](https://github.com/flokosiol/kirby-translations/tree/develop) branch) which indicates that the language `.txt` file exists, but the content is not up to date. It looks like this …

![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/6/651cdf817790c6fe8b668eec02575cab68940da1.png)

Unfortunately the checkbox isn’t always set correctly as reported [in this topic](https://forum.getkirby.com/t/checkbox-value-for-different-languages/5059). 😕

### Next steps

- Some more testing
- Translate „Translation is up to date“ (or maybe make it customizable via the blueprint??)
- Add possibility to delete a translation

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [August 23, 2016, 8:09pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/22 "2016-08-23T20:09:40Z")

</div>

Amazing! That looks like a must-have for upcoming multilanguage sites.

…when the checkbox value issue is solved at least 😅

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [August 24, 2016, 6:09am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/23 "2016-08-24T06:09:31Z")

</div>

Nice! 🙂

**Some feedback on the screenshot:**

- I would **not** translate the “Translation is up to date” with a blueprint option. Because it’s in the blueprint it’s needed to be set on every new site. If it’s a `l::set` it’s added once in the plugin and then never again. Go for `l::set`. At least I would.
- “Translation is up to date” is quite long. I don’t know if it’s possible but a shorter label would look good, but not if comes with the cost of not understanding it.
- A really minor thing I see is that the space is not the same between the languages and the checkbox block.

**Questions:**

- What happends if there are more languages than these? Will it break the layout?
- About the checkbox problem, you probably can go around this issue with js and just a textfield. When I use js I almost always use input text or textarea because they are easy to work with. But maybe a fix will be in 2.4 and then there is no need for another solution? Just a thougt.

Anyway, nice field and great idea!

**For my Splitview plugin I built a language switcher. Maybe it can be helpful?**

In this case a path looks like this:

- `/my-plugin/languages/en.php`
- `/my-plugin/languages/de.php`

[https://github.com/jenstornell/splitview/blob/master/core/language-switcher.php](https://github.com/jenstornell/splitview/blob/master/core/language-switcher.php)

## Update

I just made a language switcher class which is probably much better…

> [@Kirby Language Switcher Class](https://forum.getkirby.com/t/kirby-language-switcher-class/5062):
>
> [https://github.com/jenstornell/kirby-language-switcher-class](https://github.com/jenstornell/kirby-language-switcher-class) A class to help loading the to the correct translation, expecially in a panel field. Example usage Field Here is a simple example of a panel field: include \_\_DIR\_\_ . DS . 'language-switcher.php'; class YourField extends BaseField { public function input() { new LanguageSwitcher(); return l::get('test', 'Translation missing!'); } } If the file or translation is missing it will fallback to Translation missing! in this case. L…

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [August 24, 2016, 7:22am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/24 "2016-08-24T07:22:19Z")

</div>

Thanks for your feedback, Jens!

> [@jenstornell](#):
>
> What happends if there are more languages than these? Will it break the layout?

I hope not. 😉 If there’s not enough space for the checkbox, it will move to the next line (but I didn’t check it for all browsers so far).

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [August 24, 2016, 10:58am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/25 "2016-08-24T10:58:27Z")

</div>

If you use the built-in grid classes it should work. The Panel uses them internally as well to define field widths. And if there’s no more room, the next field just wraps around to the next line.

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [August 24, 2016, 11:00am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/26 "2016-08-24T11:00:47Z")

</div>

I’ll give it a try. But the language fields should “grow” up to fullwidth if necessary. This doesn’t match any grid, right?

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [August 24, 2016, 11:05am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/27 "2016-08-24T11:05:41Z")

</div>

No, the grid classes only support fixed percentages as far as I know.  
Flexbox sounds like a good fit for this kind of behavior.

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [September 3, 2016, 6:06pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/28 "2016-09-03T18:06:44Z")

</div>

## Version 0.3

Just release an update for [Kirby Translations](https://github.com/flokosiol/kirby-translations). And while I’m typing these words I recognize, that I forgot to add a changelog 😊 Here are some changes I made so far ([more to come](https://github.com/flokosiol/kirby-translations#roadmap-and-ideas)):

- Translations can be deleted without deleting the whole page (all other translations and the uploaded files)
- A new checkbox makes it possible to mark a translation as “up to date”. This can also be used to filter or hide pages based on the editors input (as with any other checkbox).

* * *

**Please notice that Kirby Translations now comes as a plugin** , not as a simple field. Keep that in mind if you are updating from a previous version.

* * *

**BIG THANKS** to @lenatwitteada for super fast testing and feedback and to @texnixe for verifying the [checkbox issue](https://forum.getkirby.com/t/checkbox-value-for-different-languages/5059?u=flokosiol) 🎉

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [September 13, 2016, 7:50pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/29 "2016-09-13T19:50:15Z")

</div>

## Version 0.4

There’s a [new version](https://github.com/flokosiol/kirby-translations) available. The two main changes are the following:

- option to activate/deactivate up to date checkbox
- option to activate/deactivate delete functionality

Please find all changes in the new [changelog](https://github.com/flokosiol/kirby-translations/blob/master/CHANGELOG.md).

---

<div class="post-metadata">

**Author:** ![sylvainjule](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/sylvainjule/32/4338_2.png) [@sylvainjule](https://forum.getkirby.com/u/sylvainjule)\
**Post date:** [January 16, 2017, 10:08pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/30 "2017-01-16T22:08:57Z")

</div>

First of all, this field is very useful, many many thanks ! 🙂

But have a few concerns with the way it’s currently displayed for a client’s website :

- Dealing with this field in the middle of the other content fields is quite confusing, it is not a content field per-say but more an indicator of the page’s architecture and its status.
- One consequence is that it disappears on scroll, that’s quite teddious if I’m editing a field at the bottom of a long page, have to scroll up then scroll down again to translate what I just wrote (whereas having it in the sidebar keeps the scrollTop of the mainbar).
- With tabbed pages, the addition of tabs + translation buttons becomes a quite complex and unintuitive visual structure (-\> [too many options up here](http://i.imgur.com/47ksZ84.jpg)).

Therefore I wanted to display it in the sidebar instead :

[![](http://i.imgur.com/6UUcsrW.jpg) ](http://i.imgur.com/6UUcsrW.jpg)

That’s about when you should be warned, I’ve never messed around with the sidebar before and this is a very quick and dirty fix (but hey, it sort of works). From what I understood there’s no easy path-to-the-sidebar-field, besides javascript ? Here’s what I did if someone wants to do something similar :  
_(so, it goes without saying, use this at your own risk or don’t)_

First, I renamed this plugin as `/plugins/sidetranslations` (and all the files / references that come with), so that I don’t get confused when added via the blueprint.

I call it in my blueprint within a field called ‘sidetranslations’ :

```
fields:
  sidetranslations:
    type: sidetranslations

```

In short, a few javascript prepends the field to the `$('.sidebar-content')` and makes sure it stays that way.  
I didn’t manage to get the ‘_Translate is up to date_’ input working when I completely moved the field (saving the page didn’t search for the checked attribute in the sidebar and always reloaded a blank input), so instead it clones it.

Meaning I have a sidetranslations field in the `$('.mainbar')` which I visually hide :

```
.mainbar .field-name-sidetranslations {
    opacity: 0;
    height: 0;
    pointer-events: none;
}

```

and a cloned (and visible) one in the sidebar (though, it’s the regular and hidden one that does all the work).

I added this bit at the beginning of the .js file :

```
(...)

moveField();

// Deletes the current clone if it exists and prepend an actualized one
function moveField() {
       var _sidebar = $('.sidebar-content');
           _sidebar.find('.field-name-sidetranslations').remove();
           _sidebar.prepend($('.field-name-sidetranslations').clone());
}

// Listens to changes in the DOM and makes sure the clone is refreshed
$(document).on('change pageReload', function() {
    if ($('.field-name-sidetranslations')) {
        moveField();
    }
});

// On click on the cloned input, preventDefault() and triggers click on the original input instead
$(document).on('click','.sidebar-content .input-with-checkbox .checkbox', function (e) {
      $('.mainbar .input-with-checkbox .checkbox').trigger('click');
      e.preventDefault();
      return false;
});

(...)

```

`pageReload` is an event I added in the panel’s js source files :

- in `./components/content.js`, inside the replace function.
- in `./app.js`, basically everywhere 😇 (after the `form().trigger('submit')`, iniside the `load` function and inside the `isLoading` function, when the fn is done).

Then added a bit of styling so that it’s well displayed at [every screen sizes](http://recordit.co/fjvnxyv6qf.gif).

Now, it’s working fine on pages with few assets to load ([no blank screen](http://i.imgur.com/nidQF5X.gif)), ~~but there’s a [short delay](http://i.imgur.com/mNaCPf7.gif) when the page reloads more content~~. There’s no delay anymore when triggering the `pageReload` as stated above, even with pages [with a bit of content to load](http://i.imgur.com/bENPVaF.gif). Yay !

If you’ve survived all this hacky stuff, do you see a way ~~to shorten this delay /~~ achieve this in a prettier way ? (or is it a terrible idea and it will backfire somehow ? 😬)

[edit] Edited with a fix for the inconsistent and delayed rendering of the field.

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [January 17, 2017, 12:55pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/31 "2017-01-17T12:55:09Z")

</div>

Thanks for the kind feedback and your detailed explanation. I like that idea.

**To keep it short:** I don’t know any better ways to achieve this. As you mentioned, there’s no other way (so far) to extend the sidebar than using JavaScript.

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [January 17, 2017, 1:18pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/32 "2017-01-17T13:18:05Z")

</div>

There is a great suggestion regarding sidebar widgets by @jenstornell in the panel issues on GitHub: [https://github.com/getkirby/panel/issues/940](https://github.com/getkirby/panel/issues/940)

I’m not sure if there’s any active development on this, though.

By the way, does anyone know what happened to the Trello board linked in the issue?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 17, 2017, 1:38pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/33 "2017-01-17T13:38:32Z")

</div>

The board still exists, but not publicly, I’m afraid.

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [March 10, 2017, 7:35pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/34 "2017-03-10T19:35:49Z")

</div>

I changed the way how textfiles for a single language get deleted. Now it should be more robust (and with panel notification). Furthermore there’s a first draft of a **panel widget** which lists untranslated pages of the currently active language.

Both changes are available in the [develop branch](https://github.com/flokosiol/kirby-translations/tree/develop).

**Anyone who would like to test it?**  
Any feedback appreciated 😉

Thanks in advance and have a nice weekend, folks.

---

<div class="post-metadata">

**Author:** ![flokosiol](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/flokosiol/32/468_2.png) [@flokosiol](https://forum.getkirby.com/u/flokosiol)\
**Post date:** [October 16, 2017, 11:48am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/35 "2017-10-16T11:48:53Z")

</div>

## Version 0.5

There’s a new version available which comes along with a nice **resync functionality** added by @sylvainjule. It’s explained in detail and demonstrated with an animated gif in the pull request:

> <https://github.com/flokosiol/kirby-translations/pull/7>

---

<div class="post-metadata">

**Author:** ![kitzunegari](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kitzunegari/32/5885_2.png) [@kitzunegari](https://forum.getkirby.com/u/kitzunegari)\
**Post date:** [January 16, 2019, 9:15pm UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/36 "2019-01-16T21:15:42Z")

</div>

Very nice!  
Thank you for sharing @flokosiol

---

<div class="post-metadata">

**Author:** ![Peleke](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/peleke/32/4935_2.png) [@Peleke](https://forum.getkirby.com/u/Peleke)\
**Post date:** [August 27, 2021, 8:38am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/37 "2021-08-27T08:38:07Z")

</div>

Would be nice to use it with Kirby 3 as well 🙂

---

<div class="post-metadata">

**Author:** ![Andreas\_1](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Andreas\_1](https://forum.getkirby.com/u/Andreas_1)\
**Post date:** [September 9, 2023, 8:28am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/38 "2023-09-09T08:28:33Z")

</div>

@daan may I ask, are you planning an update for Kirby v4 compatability?

---

<div class="post-metadata">

**Author:** ![daan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/daan/32/7784_2.png) [@daan](https://forum.getkirby.com/u/daan)\
**Post date:** [September 11, 2023, 11:31am UTC](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338/39 "2023-09-11T11:31:30Z")

</div>

I’d like to, but I’m a bit overwhelmed with AFK projects at the moment. I’d say not before spring 2024.

[Previous page](https://forum.getkirby.com/t/translations-keep-track-of-translation-status/4338.md?page=1)
