• Resolved MorgunovVit

    (@morgunovvit)


    Hi!
    I’ve met the problem – Russian translation doesn’t work.
    Abracadabra and question symbols instead of text.
    (Plugin worked perfectly before the update)

    See the screenshots here: https://imgur.com/a/3bdB1sA

    • This topic was modified 6 years, 2 months ago by MorgunovVit.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Your MO file is corrupt.

    Was this generated by my plugin? I notice it contains a hash table, which is disabled in Loco Translate by default. Did you enable this option?

    Compiling your PO file through my plugin I don’t have a problem generating a valid MO file.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Hi!
    Thanks for the answer.
    Yes, this was generated by Loco Translate for WordPress.
    I see that the hash table option is enabled, but I don’t remember, that I controlled this option.

    Plugin Author Tim W

    (@timwhitlock)

    ok, well forget about the hash table. I was just checking some other software hadn’t been used to compile it.

    I can’t think of any reason MO compilation could fail without the PO parsing also failing, and I certainly can’t reproduce any such issue.

    Do you have the mbstring extension installed? Check the diagnostics page for warnings: wp-admin/admin.php?page=loco-config&action=debug

    Plugin Author Tim W

    (@timwhitlock)

    I have looked deeper into this and discovered exactly in what way your MO file is corrupt.

    The string lengths in your file have been measured in characters, not bytes. For example “Русский” is 7 unicode characters, but encoded as 14 bytes in UTF-8. The MO compiler in Loco Translate measures in bytes, which is correct for binary files. Hence I am clueless as to how my plugin could produce this result. I have spent several hours trying to re-create an error like this and cannot.

    Worth noting that all the UTF-8 strings are correctly written into the file, so it doesn’t look like anything is wrong with the encoding or the data posted to the server. Simply that the lengths are calculated wrongly, and that doesn’t add up.

    I asked you about the mbstring extension, but that should make no difference here because my plugin does a basic strlen() to get the byte length.

    Please ensure you’re running the latest version of Loco Translate and try re-compiling the MO file by re-saving the PO from the editor. If this still produces bad files then I am out of ideas.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Hi, Tim!
    I’ve tried to re-compiling the MO file by re-saving the PO from the editor several times – it didn’t help.

    Could you look at my PHP settings, maybe you’ll see something strange: https://imgur.com/3Btecei

    I also can give you the access to my account.

    Vitaly

    Moderator Yui

    (@fierevere)

    永子

    mbstring.func_overload should be set to 0 (default)
    non-zero values can cause problems

    opcache config is weird too, but it shouldnt cause this specific problem.

    • This reply was modified 6 years, 2 months ago by Yui.
    Plugin Author Tim W

    (@timwhitlock)

    Thank you very much @fierevere. You have cracked it.

    I never even knew about this setting. A truly terrible idea, and rightfully DEPRECATED as of PHP 7.2.0

    @morgunovvit Please try with this set to 0 and mark as resolved if this fixes your issue.

    I will add a warning in the Loco Translate interface if this setting will break MO compilation.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Hi, guys!

    Thank You a lot!
    It really helped!
    Unfortunately, I can not remember for what reason the value had been changed to the value 2 (mbstring.func_overload=2). But I remember that there was an incident when with mbstring.func_overload = 0 the site was working with an error.

    But at the moment I see no mistakes and the translation working correctly!

    Привет всем! Перед началом работы, есть предусмотрительное предупреждение – цитирую – Ваша конфигурация mbstring приведет к повреждению файлов MO. Пожалуйста, убедитесь, что mbstring.func_overload отключен – конец цитаты!

    Начал искать место, где в этом следует убедиться, и пришёл к Вам! Поскольку послать можно куда угодно, только мало кто может точно указать конкретное место!

    Буду признателен за помощь!

    • This reply was modified 5 years, 11 months ago by alplekhov.
    Moderator Yui

    (@fierevere)

    永子

    @alplekhov

    php.ini , реже может определяться как php_flag mbstring.func_overload в файлах .htaccess
    если не найдете – спросите техподдержку хостинга

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Russian translation issue – Questions instead of text’ is closed to new replies.