The JSON response from the API could not be parsed

I have this issue only when I add TR language on my server. I don’t have any issue on my local server. When I remove layout field I don’t have that issue. Interesting!

My config file;

    <?php

return [

    'debug' => true,

    'panel' => [
      'css' => 'assets/css/panel.css'
    ],

    'email' => [
      'transport' => [
        'type' => 'smtp',
        'host' => 'srvc104.turhost.com',
        'port' => 465,
        'security' => true,
        'auth' => true,
        'username' => 'support@aristotheme.com',
        'password' => '***'
      ]
    ],

    'smartypants' => true,

    'kirby3-webp' => true,

    'date'  => [
      'handler' => 'strftime'
    ],

    'languages' => true,


    // Plugin / Automatically resize images on upload.
    'medienbaecker.autoresize.maxWidth' => 1920,

    // Cachebuster
    'schnti.cachebuster.active' => true,

    // converting JPG, JPEG and PNG into much smaller WEBP
    //'mrfd.webp.autoconvert' => true,


    // Robots
    'bnomei.robots-txt.sitemap' => 'sitemap.xml',
    'bnomei.robots-txt.groups' => [ // array or callback
      '*' => [ // user-agent
          'disallow' => [
              '/kirby/',
              '/site/',
          ],
          'allow' => [
              '/media/',
          ]
      ]
    ],

    

];

en.php;

    <?php

return [
    'code' => 'en',
    'default' => true,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'en_US'
    ],
    'name' => 'EN',
    'translations' => [

    ],
    'url' => '/'
];

tr.php;

<?php

return [
    'code' => 'tr',
    'default' => false,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'tr_TR'
    ],
    'name' => 'TR',
    'translations' => [

    ],
    'url' => NULL
];

And my server php modules;

Could you please help me?
I really didn’t solve that issue

Have you updated your content locally maybe but not on the server?

Hi Texnixe

Yes I can update and work fine locally but I got that issue on the server.

Yes, I understand that. But what I meant was that maybe the content on your remote server differs from your local content. It’s just a guess because you said that if you remove the layout field it works.

Maybe post the blueprint where you are using the layout field.

Ahh :slight_smile: I re-uploaded content to server and same issue. I tried everything :frowning:

When exactly does this error occur? And again, could you elaborate regarding the layout field? Blueprint?

Which Kirby version? Which plugins? Which PHP version? Any custom code? Does the same happen with a fresh Starterkit on the same server?

1 Like

I suspect my remote server because It works well on the my local server. Yes I didn’t try Starterkit on my server :slight_smile: I will test it. If I will have same issue then the issue related my server.

I’m sorry I’m late. Would you try following options for the Turkish locale setting: /site/languages/tr.php?

'locale' => [
    'LC_COLLATE' => 'tr_TR.utf-8',
    'LC_MONETARY' => 'tr_TR.utf-8',
    'LC_NUMERIC' => 'tr_TR.utf-8',
    'LC_TIME' => 'tr_TR.utf-8',
    'LC_CTYPE' => 'en_US.utf-8'
],
1 Like

That is the solution. You are my hero Bora… :slight_smile: Thank you so much for helping Texnixe and Bora!

1 Like

Glad it works :tada:

Keywords to get detailed information about the issue; This issue occurs on servers with locale tr for 2 reasons. LC_MESSAGES constant and LC_CTYPE value.

So 'LC_ALL' => 'tr_TR' doesn’t work always on tr locale servers.

Hımm. I learned new things :slight_smile: Thank you so much again!