[Résolu] Request: Add Hazaragi (haz) to RTL language list in core lang.php

Bonjour à tous,

I would like to propose an enhancement regarding Hazaragi (ISO 639-3 code: haz) language support in SPIP.

Hazaragi is a Right-to-Left (RTL) language. It is already listed as an option under ecrire/?exec=configurer_multilinguisme for language selection, which is great for multisite projects. However, when selected, it does not currently render with the correct RTL direction automatically.

For projects like the Hazaragi multisite I am currently working on, native RTL recognition would be incredibly beneficial. While it’s possible to manage this through a custom plugin, having haz officially recognized as RTL in the core would greatly streamline development and maintenance for the Hazaragi-speaking community using SPIP.

I am therefore requesting that 'haz' be added to the $lang_rtl array within the lang_dir function in ecrire/inc/lang.php.

The proposed change would look like this:

// C'est utilise par #LANG_DIR, #LANG_LEFT, #LANG_RIGHT.
function lang_dir($lang = '', $droitier = 'ltr', $gaucher = 'rtl')
{
    static $lang_rtl = ['ar', 'fa', 'ku', 'prs', 'ps', 'ur', 'haz', 'he', 'heb', 'hbo', 'yi'];
    // Adding 'haz' to the list above ^

    return in_array(($lang ?: $GLOBALS['spip_lang']), $lang_rtl) ?
        $gaucher : $droitier;
}

I have tested this modification locally, and it successfully ensures the correct RTL direction for Hazaragi content.

It would be fantastic to see this included in a future SPIP release. Thank you for your time and consideration!

Best regards,

1 « J'aime »

Hi and thanks for pointing this bug. Could you open an issue here spip / ecrire · GitLab and maybe a pull request to propose this change ?

1 « J'aime »

Thanks for your reply. Yes, I tried to sign up there and I am waiting for approval:
« Your account is pending approval from your GitLab administrator and hence blocked. Please contact your GitLab administrator if you think this is an error. »

1 « J'aime »

I’ve just approved your account request.

1 « J'aime »

still get the same message. « kamran » is the username of the account I am waiting for its approval.

I think it should be ok now.

I’ve manually added ‹ haz › to my local lang.php file for now. This has fixed the RTL issue on my end, and I hope to see this change included in a future SPIP release. Thank you!

1 « J'aime »

No, thanks to you for reporting the bug and proposing a fix for that :slight_smile:

2 « J'aime »

Hello Kamran

I can’t see the Hazaragi files in /ecrire/lang and I can’t see the translation interface of this language in trad.spip.net

1 « J'aime »

Ha, well spotted @George :slight_smile:

Hello George,
Yes, you are right. I am working on a customized translation of Hazaragi, and I save the language files under squelettes\lang for now. In the future, I hope I can work on the Hazaragi translation in https://trad.spip.net/