illycz
1
Maybe I have bad day,
but I have variable in language definition:
<?php
return [
'code' => 'en',
'default' => true,
'direction' => 'ltr',
'locale' => 'en_US',
'name' => 'English',
'url' => '/',
'translations' => [
'video_label' => 'Tralala'
]
];
and I’m using this function: <?= t('video_label') ?>
Nothing is returned
texnixe
2
Just tested and works for me…
Looks like it.
Questions => Please choose questions category and correct Kirby version next time?
illycz
3
I tried to update to 3.0.2, switch to different PHP versions and still not working.
I’m desperate
texnixe
4
Is caching enabled, so changes don’t show up?
illycz
5
When I print $kirby->language()
I get only:
Kirby\Cms\Language Object
(
[code] => en
[default] => 1
[direction] => ltr
[locale] => en_US
[name] => English
[url] => //localhost:3000
)
texnixe
7
That’s normal, the language array doesn’t provide any more information.
What is your Kirby version?
What does
dump(i18n::translation('en'));
give you? Your custom translation should be somewhere at the end.
illycz
8
Kirby 3.0.2
And my custom translation strings are not in array when I dump i18n::translation('en')
Are you useing any plugins?
I had the same problem and the issue was with a plugin wich had this issue: https://github.com/getkirby/kirby/issues/1307
illycz
10
YES!
When I remove my plugin which define custom kirbytag language variables working.
illycz
11
So second question is, where is the problem within plugin:
In index.php I have:
<?php
Kirby::plugin('soma/tags', [
'tags' => [
'sometag' => require_once __DIR__ . '/tags/sometag.php'
]
]);
And in sometag.php:
<?php
return [
'html' => function($tag) {
return '<sometag>' . $tag->value . '</somateg>';
}
];
illycz
12
Correction: problems is within another plugin which set different blueprints by user roles.