Closed Tim-Wils closed 4 years ago
Hi there! Thanks for the kind words. I’ll fix the first two points on monday and I’ll look into the third one.
I fixed the first two issues in the 1.5.1 release.
For the 3rd one, I don't think there is really a fix for that as Yii2 translations work for languages only.
But what you could do is to define a category based on the current site in twig:
{% set translateCat = craft.app.sites.currentSite.handle == 'formal-site' ? 'formal' : 'informal' %}
And then, when you use the t
filter, you can pass the category:
{{ 'Hello' | t(translateCat) }}
Finally, you can create a file translate.php
in your config
directory to define the categories used by the plugin:
<?php
return [
'categories' => [
'formal',
'informal'
],
];
Awesome! Seems like it works like a charm, thank you! As for the 3rd one: Your solution seem to can do the job just fine. Thanks again :)
Hey! First off all, the plugin is awesome! Just played with it and seems to be the right tool for me on a certain project.
I have two small requests and one larger request:
[CTRL/CMD + S] should be saving the list and it doesn't :)
Instead of an input , you should replace it for a textarea, so that multilines are supported. Textarea could initially be the same height as the inputs now, so it'll keep the looks: Multiline translations in twig: {% filter t %}this is awesome not? {% endfilter %}
initially:![afbeelding](https://user-images.githubusercontent.com/90032/70311814-a9795300-1812-11ea-8ecd-8d7f8c9e3318.png)
with multiline translation:![afbeelding](https://user-images.githubusercontent.com/90032/70312103-37edd480-1813-11ea-981e-e06fd063ee8f.png)
For example, both English, but different style: formal site: "Contact us in the form below." informal site: "Send me your thoughts." or formal site: "Welcome" informal site: "Hi there!"